| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 @"IDS_ACCEPT_LANGUAGES", @"Localizable", bundle, @"en-US,en", | 122 @"IDS_ACCEPT_LANGUAGES", @"Localizable", bundle, @"en-US,en", |
| 123 @"These values are copied from Chrome's .xtb files, so the same " | 123 @"These values are copied from Chrome's .xtb files, so the same " |
| 124 "values are used in the |Accept-Language| header. Key name matches " | 124 "values are used in the |Accept-Language| header. Key name matches " |
| 125 "Chrome's."); | 125 "Chrome's."); |
| 126 if (acceptLanguages == Nil) | 126 if (acceptLanguages == Nil) |
| 127 acceptLanguages = @""; | 127 acceptLanguages = @""; |
| 128 return acceptLanguages; | 128 return acceptLanguages; |
| 129 } | 129 } |
| 130 | 130 |
| 131 + (void)checkNotStarted { | 131 + (void)checkNotStarted { |
| 132 CHECK(gChromeNet == NULL) << "Cronet is already started."; | 132 // Cronet is already started. |
| 133 CHECK(gChromeNet == NULL); |
| 133 } | 134 } |
| 134 | 135 |
| 135 + (void)setHttp2Enabled:(BOOL)http2Enabled { | 136 + (void)setHttp2Enabled:(BOOL)http2Enabled { |
| 136 [self checkNotStarted]; | 137 [self checkNotStarted]; |
| 137 gHttp2Enabled = http2Enabled; | 138 gHttp2Enabled = http2Enabled; |
| 138 } | 139 } |
| 139 | 140 |
| 140 + (void)setQuicEnabled:(BOOL)quicEnabled { | 141 + (void)setQuicEnabled:(BOOL)quicEnabled { |
| 141 [self checkNotStarted]; | 142 [self checkNotStarted]; |
| 142 gQuicEnabled = quicEnabled; | 143 gQuicEnabled = quicEnabled; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 base::SysNSStringToUTF8(hostResolverRulesForTesting)); | 280 base::SysNSStringToUTF8(hostResolverRulesForTesting)); |
| 280 } | 281 } |
| 281 | 282 |
| 282 // 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 |
| 283 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. | 284 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. |
| 284 + (void)preventStrippingCronetBidirectionalStream { | 285 + (void)preventStrippingCronetBidirectionalStream { |
| 285 bidirectional_stream_create(NULL, 0, 0); | 286 bidirectional_stream_create(NULL, 0, 0); |
| 286 } | 287 } |
| 287 | 288 |
| 288 @end | 289 @end |
| OLD | NEW |