| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 + (void)startInternal { | 64 + (void)startInternal { |
| 65 cronet::CronetEnvironment::Initialize(); | 65 cronet::CronetEnvironment::Initialize(); |
| 66 std::string partialUserAgent = base::SysNSStringToUTF8(gUserAgent); | 66 std::string partialUserAgent = base::SysNSStringToUTF8(gUserAgent); |
| 67 gChromeNet.Get().reset(new cronet::CronetEnvironment(partialUserAgent)); | 67 gChromeNet.Get().reset(new cronet::CronetEnvironment(partialUserAgent)); |
| 68 | 68 |
| 69 gChromeNet.Get()->set_http2_enabled(gHttp2Enabled); | 69 gChromeNet.Get()->set_http2_enabled(gHttp2Enabled); |
| 70 gChromeNet.Get()->set_quic_enabled(gQuicEnabled); | 70 gChromeNet.Get()->set_quic_enabled(gQuicEnabled); |
| 71 gChromeNet.Get()->set_ssl_key_log_file_name( | 71 gChromeNet.Get()->set_ssl_key_log_file_name( |
| 72 base::SysNSStringToUTF8(gSslKeyLogFileName)); | 72 base::SysNSStringToUTF8(gSslKeyLogFileName)); |
| 73 for (const auto& quicHint : gQuicHints) { | 73 for (auto* quicHint : gQuicHints) { |
| 74 gChromeNet.Get()->AddQuicHint(quicHint->host, quicHint->port, | 74 gChromeNet.Get()->AddQuicHint(quicHint->host, quicHint->port, |
| 75 quicHint->alternate_port); | 75 quicHint->alternate_port); |
| 76 } | 76 } |
| 77 gChromeNet.Get()->Start(); | 77 gChromeNet.Get()->Start(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 + (void)start { | 80 + (void)start { |
| 81 static dispatch_once_t onceToken; | 81 static dispatch_once_t onceToken; |
| 82 dispatch_once(&onceToken, ^{ | 82 dispatch_once(&onceToken, ^{ |
| 83 if (![NSThread isMainThread]) { | 83 if (![NSThread isMainThread]) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return nil; | 121 return nil; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // This is a non-public dummy method that prevents the linker from stripping out | 124 // This is a non-public dummy method that prevents the linker from stripping out |
| 125 // the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'. | 125 // the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'. |
| 126 + (void)preventStrippingCronetBidirectionalStream { | 126 + (void)preventStrippingCronetBidirectionalStream { |
| 127 cronet_bidirectional_stream_create(NULL, 0, 0); | 127 cronet_bidirectional_stream_create(NULL, 0, 0); |
| 128 } | 128 } |
| 129 | 129 |
| 130 @end | 130 @end |
| OLD | NEW |