Skip to content

Commit

Permalink
Revert of Moving gRPC support interfaces out of cronet and into a new…
Browse files Browse the repository at this point in the history
… component. (patchset #67 id:1300001 of https://codereview.chromium.org/2273403003/ )

Reason for revert:
Causes failures on "Mac10.9 Tests" builder:

https://uberchromegw.corp.google.com/i/chromium.mac/builders/Mac10.9%20Tests/builds/30817

An example failure:

[ RUN      ] BidirectionalStreamDelayRequestHeadersUntilFlush/BidirectionalStreamTest.StartExampleBidiStream/1
[12832:13571:1027/123821:4064068458447:ERROR:quic_simple_server.cc(97)] Listen() failed: net::ERR_ADDRESS_IN_USE
[12832:13571:1027/123821:4064068534048:FATAL:quic_test_server.cc(87)] Check failed: rv >= 0 (-147 vs. 0)Quic server fails to start
0   components_unittests                0x00000001095d79c3 _ZN4base5debug10StackTraceC1Ev + 19
1   components_unittests                0x00000001095ee9d7 _ZN7logging10LogMessageD2Ev + 71
2   components_unittests                0x0000000109461920 _ZN12grpc_support29StartQuicServerOnServerThreadERKN4base8FilePathEPNS0_13WaitableEventE + 608
3   components_unittests                0x00000001095d7f49 _ZN4base5debug13TaskAnnotator7RunTaskEPKcPNS_11PendingTaskE + 217
4   components_unittests                0x00000001095f8236 _ZN4base11MessageLoop7RunTaskEPNS_11PendingTaskE + 390
5   components_unittests                0x00000001095f850c _ZN4base11MessageLoop21DeferOrRunPendingTaskENS_11PendingTaskE + 44
6   components_unittests                0x00000001095f8853 _ZN4base11MessageLoop6DoWorkEv + 371
7   components_unittests                0x00000001095fa223 _ZN4base19MessagePumpLibevent3RunEPNS_11MessagePump8DelegateE + 83
8   components_unittests                0x00000001095f7f9e _ZN4base11MessageLoop10RunHandlerEv + 94
9   components_unittests                0x00000001096103f3 _ZN4base7RunLoop3RunEv + 115
10  components_unittests                0x0000000109630f92 _ZN4base6Thread10ThreadMainEv + 386
11  components_unittests                0x000000010962c6d7 _ZN4base12_GLOBAL__N_110ThreadFuncEPv + 87
12  libsystem_pthread.dylib             0x00007fff8e718899 _pthread_body + 138
13  libsystem_pthread.dylib             0x00007fff8e71872a _pthread_struct_init + 0
14  libsystem_pthread.dylib             0x00007fff8e71cfc9 thread_start + 13

Original issue's description:
> Moving gRPC support interfaces out of cronet and into a new component.
>
> BUG=650462
>
> Committed: https://crrev.com/ef2a6d130430d93b29b4258c814ea94a3cbbfb31
> Cr-Commit-Position: refs/heads/master@{#428099}

TBR=mef@chromium.org,blundell@chromium.org,gcasto@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=650462

Review-Url: https://codereview.chromium.org/2454183002
Cr-Commit-Position: refs/heads/master@{#428122}
  • Loading branch information
mohsen authored and Commit bot committed Oct 27, 2016
1 parent 92d41b2 commit 3b72ebe
Show file tree
Hide file tree
Showing 29 changed files with 785 additions and 1,042 deletions.
1 change: 0 additions & 1 deletion components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ test("components_unittests") {
"//components/gcm_driver:unit_tests",
"//components/gcm_driver/crypto:unit_tests",
"//components/google/core/browser:unit_tests",
"//components/grpc_support/test:unit_tests",
"//components/history/core/browser:unit_tests",
"//components/history/core/common:unit_tests",
"//components/image_fetcher:unit_tests",
Expand Down
1 change: 0 additions & 1 deletion components/cronet/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_rules = [
"+components/grpc_support",
"+components/metrics",
"+components/prefs",
"+net",
Expand Down
19 changes: 8 additions & 11 deletions components/cronet/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import("//build/config/mac/symbols.gni")
import("//build/mac/tweak_info_plist.gni")
import("//build/util/process_version.gni")
import("//build/util/version.gni")
import("//components/grpc_support/include/headers.gni")
import("//testing/test.gni")
import("//url/features.gni")

Expand All @@ -34,7 +33,6 @@ source_set("cronet_sources") {
deps = [
":cronet_version_header",
"//base:base",
"//components/grpc_support",
"//components/metrics:metrics",
"//components/metrics/proto:proto",
"//components/prefs:prefs",
Expand All @@ -53,12 +51,14 @@ source_set("cronet_sources") {
"../url_request_context_config.h",
"Cronet.h",
"Cronet.mm",
"cronet_bidirectional_stream.cc",
"cronet_bidirectional_stream.h",
"cronet_c_for_grpc.cc",
"cronet_c_for_grpc.h",
"cronet_environment.cc",
"cronet_environment.h",
]

include_dirs = [ "//components/grpc_support/include" ]

if (!use_platform_icu_alternatives) {
deps += [ "//base:i18n" ]
}
Expand Down Expand Up @@ -148,17 +148,14 @@ ios_framework_bundle("cronet_framework") {

libs = [ "UIKit.Framework" ]

include_dirs = [ "//components/grpc_support/include" ]

public_deps = [
"//components/grpc_support",
public_headers = [
"Cronet.h",
"cronet_c_for_grpc.h",
]

public_headers = [ "Cronet.h" ]
public_headers += grpc_public_headers

sources = [
"Cronet.h",
"cronet_c_for_grpc.h",
]

configs -= [ "//build/config/compiler:default_symbols" ]
Expand Down
8 changes: 3 additions & 5 deletions components/cronet/ios/Cronet.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

#import <Foundation/Foundation.h>

#include "bidirectional_stream_c.h"
#include "cronet_c_for_grpc.h"

// A block, that takes a request, and returns YES if the request should
// be handled.
typedef BOOL (^RequestFilterBlock)(NSURLRequest* request);

// Interface for installing Cronet.
// TODO(gcasto): Should this macro be separate from the one defined in
// bidirectional_stream_c.h?
GRPC_SUPPORT_EXPORT
CRONET_EXPORT
@interface Cronet : NSObject

// Sets whether HTTP/2 should be supported by CronetEngine. This method only has
Expand Down Expand Up @@ -91,7 +89,7 @@ GRPC_SUPPORT_EXPORT
+ (NSString*)getUserAgent;

// Get a pointer to global instance of cronet_engine for GRPC C API.
+ (stream_engine*)getGlobalEngine;
+ (cronet_engine*)getGlobalEngine;

// Returns differences in metrics collected by Cronet since the last call to
// getGlobalMetricsDeltas, serialized as a [protobuf]
Expand Down
10 changes: 5 additions & 5 deletions components/cronet/ios/Cronet.mm
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ + (NSString*)getUserAgent {
encoding:[NSString defaultCStringEncoding]];
}

+ (stream_engine*)getGlobalEngine {
+ (cronet_engine*)getGlobalEngine {
DCHECK(gChromeNet.Get().get());
if (gChromeNet.Get().get()) {
static stream_engine engine;
engine.obj = gChromeNet.Get()->GetURLRequestContextGetter();
static cronet_engine engine;
engine.obj = gChromeNet.Get().get();
return &engine;
}
return nil;
Expand All @@ -281,9 +281,9 @@ + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting {
}

// This is a non-public dummy method that prevents the linker from stripping out
// the otherwise non-referenced methods from 'bidirectional_stream.cc'.
// the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'.
+ (void)preventStrippingCronetBidirectionalStream {
bidirectional_stream_create(NULL, 0, 0);
cronet_bidirectional_stream_create(NULL, 0, 0);
}

@end
Loading

0 comments on commit 3b72ebe

Please sign in to comment.