OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "components/cronet/ios/Cronet.h" | 5 #import "components/cronet/ios/Cronet.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 @implementation Cronet | 105 @implementation Cronet |
106 | 106 |
107 + (void)configureCronetEnvironmentForTesting: | 107 + (void)configureCronetEnvironmentForTesting: |
108 (cronet::CronetEnvironment*)cronetEnvironment { | 108 (cronet::CronetEnvironment*)cronetEnvironment { |
109 cronetEnvironment->set_host_resolver_rules( | 109 cronetEnvironment->set_host_resolver_rules( |
110 [gHostResolverRulesForTesting UTF8String]); | 110 [gHostResolverRulesForTesting UTF8String]); |
111 if (gEnableTestCertVerifierForTesting) { | 111 if (gEnableTestCertVerifierForTesting) { |
112 std::unique_ptr<TestCertVerifier> test_cert_verifier = | 112 std::unique_ptr<TestCertVerifier> test_cert_verifier = |
113 base::MakeUnique<TestCertVerifier>(); | 113 base::MakeUnique<TestCertVerifier>(); |
114 cronetEnvironment->set_cert_verifier(std::move(test_cert_verifier)); | 114 cronetEnvironment->set_mock_cert_verifier(std::move(test_cert_verifier)); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 + (NSString*)getAcceptLanguages { | 118 + (NSString*)getAcceptLanguages { |
119 // Use the framework bundle to search for resources. | 119 // Use the framework bundle to search for resources. |
120 NSBundle* frameworkBundle = [NSBundle bundleForClass:self]; | 120 NSBundle* frameworkBundle = [NSBundle bundleForClass:self]; |
121 NSString* bundlePath = | 121 NSString* bundlePath = |
122 [frameworkBundle pathForResource:@"cronet_resources" ofType:@"bundle"]; | 122 [frameworkBundle pathForResource:@"cronet_resources" ofType:@"bundle"]; |
123 NSBundle* bundle = [NSBundle bundleWithPath:bundlePath]; | 123 NSBundle* bundle = [NSBundle bundleWithPath:bundlePath]; |
124 NSString* acceptLanguages = NSLocalizedStringWithDefaultValue( | 124 NSString* acceptLanguages = NSLocalizedStringWithDefaultValue( |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 gHostResolverRulesForTesting = hostResolverRulesForTesting; | 280 gHostResolverRulesForTesting = hostResolverRulesForTesting; |
281 } | 281 } |
282 | 282 |
283 // This is a non-public dummy method that prevents the linker from stripping out | 283 // This is a non-public dummy method that prevents the linker from stripping out |
284 // the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'. | 284 // the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'. |
285 + (void)preventStrippingCronetBidirectionalStream { | 285 + (void)preventStrippingCronetBidirectionalStream { |
286 cronet_bidirectional_stream_create(NULL, 0, 0); | 286 cronet_bidirectional_stream_create(NULL, 0, 0); |
287 } | 287 } |
288 | 288 |
289 @end | 289 @end |
OLD | NEW |