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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 } // namespace | 102 } // namespace |
103 | 103 |
104 @implementation Cronet | 104 @implementation Cronet |
105 | 105 |
106 + (void)configureCronetEnvironmentForTesting: | 106 + (void)configureCronetEnvironmentForTesting: |
107 (cronet::CronetEnvironment*)cronetEnvironment { | 107 (cronet::CronetEnvironment*)cronetEnvironment { |
108 if (gEnableTestCertVerifierForTesting) { | 108 if (gEnableTestCertVerifierForTesting) { |
109 std::unique_ptr<TestCertVerifier> test_cert_verifier = | 109 std::unique_ptr<TestCertVerifier> test_cert_verifier = |
110 base::MakeUnique<TestCertVerifier>(); | 110 base::MakeUnique<TestCertVerifier>(); |
111 cronetEnvironment->set_cert_verifier(std::move(test_cert_verifier)); | 111 cronetEnvironment->set_mock_cert_verifier(std::move(test_cert_verifier)); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 + (NSString*)getAcceptLanguages { | 115 + (NSString*)getAcceptLanguages { |
116 // Use the framework bundle to search for resources. | 116 // Use the framework bundle to search for resources. |
117 NSBundle* frameworkBundle = [NSBundle bundleForClass:self]; | 117 NSBundle* frameworkBundle = [NSBundle bundleForClass:self]; |
118 NSString* bundlePath = | 118 NSString* bundlePath = |
119 [frameworkBundle pathForResource:@"cronet_resources" ofType:@"bundle"]; | 119 [frameworkBundle pathForResource:@"cronet_resources" ofType:@"bundle"]; |
120 NSBundle* bundle = [NSBundle bundleWithPath:bundlePath]; | 120 NSBundle* bundle = [NSBundle bundleWithPath:bundlePath]; |
121 NSString* acceptLanguages = NSLocalizedStringWithDefaultValue( | 121 NSString* acceptLanguages = NSLocalizedStringWithDefaultValue( |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 base::SysNSStringToUTF8(hostResolverRulesForTesting)); | 279 base::SysNSStringToUTF8(hostResolverRulesForTesting)); |
280 } | 280 } |
281 | 281 |
282 // This is a non-public dummy method that prevents the linker from stripping out | 282 // This is a non-public dummy method that prevents the linker from stripping out |
283 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. | 283 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. |
284 + (void)preventStrippingCronetBidirectionalStream { | 284 + (void)preventStrippingCronetBidirectionalStream { |
285 bidirectional_stream_create(NULL, 0, 0); | 285 bidirectional_stream_create(NULL, 0, 0); |
286 } | 286 } |
287 | 287 |
288 @end | 288 @end |
OLD | NEW |