Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Unified Diff: components/cronet/ios/Cronet.mm

Issue 2492703002: Third try at landing gRPC refactoring. Previous issue failed on the waterfall (Closed)
Patch Set: Change DCHECK Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cronet/ios/Cronet.h ('k') | components/cronet/ios/cronet_bidirectional_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/Cronet.mm
diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm
index 150be2435ff32b9919574f60c8766995eb4f698b..d413f97de704039f29790589dff8d5ff0b7e70d9 100644
--- a/components/cronet/ios/Cronet.mm
+++ b/components/cronet/ios/Cronet.mm
@@ -41,7 +41,6 @@ RequestFilterBlock gRequestFilterBlock = nil;
std::unique_ptr<CronetHttpProtocolHandlerDelegate> gHttpProtocolHandlerDelegate;
NSURLCache* gPreservedSharedURLCache = nil;
BOOL gEnableTestCertVerifierForTesting = FALSE;
-NSString* gHostResolverRulesForTesting = @"";
// CertVerifier, which allows any certificates for testing.
class TestCertVerifier : public net::CertVerifier {
@@ -106,8 +105,6 @@ class CronetHttpProtocolHandlerDelegate
+ (void)configureCronetEnvironmentForTesting:
(cronet::CronetEnvironment*)cronetEnvironment {
- cronetEnvironment->set_host_resolver_rules(
- [gHostResolverRulesForTesting UTF8String]);
if (gEnableTestCertVerifierForTesting) {
std::unique_ptr<TestCertVerifier> test_cert_verifier =
base::MakeUnique<TestCertVerifier>();
@@ -254,11 +251,11 @@ class CronetHttpProtocolHandlerDelegate
encoding:[NSString defaultCStringEncoding]];
}
-+ (cronet_engine*)getGlobalEngine {
++ (stream_engine*)getGlobalEngine {
DCHECK(gChromeNet.Get().get());
if (gChromeNet.Get().get()) {
- static cronet_engine engine;
- engine.obj = gChromeNet.Get().get();
+ static stream_engine engine;
+ engine.obj = gChromeNet.Get()->GetURLRequestContextGetter();
return &engine;
}
return nil;
@@ -277,13 +274,15 @@ class CronetHttpProtocolHandlerDelegate
}
+ (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting {
- gHostResolverRulesForTesting = hostResolverRulesForTesting;
+ DCHECK(gChromeNet.Get().get());
+ gChromeNet.Get()->SetHostResolverRules(
+ base::SysNSStringToUTF8(hostResolverRulesForTesting));
}
// This is a non-public dummy method that prevents the linker from stripping out
-// the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'.
+// the otherwise non-referenced methods from 'bidirectional_stream.cc'.
+ (void)preventStrippingCronetBidirectionalStream {
- cronet_bidirectional_stream_create(NULL, 0, 0);
+ bidirectional_stream_create(NULL, 0, 0);
}
@end
« no previous file with comments | « components/cronet/ios/Cronet.h ('k') | components/cronet/ios/cronet_bidirectional_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698