| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/mac/bundle_locations.h" | 12 #include "base/mac/bundle_locations.h" |
| 13 #include "base/mac/scoped_block.h" | 13 #include "base/mac/scoped_block.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "components/cronet/ios/accept_languages_table.h" | 17 #include "components/cronet/ios/accept_languages_table.h" |
| 18 #include "components/cronet/ios/cronet_environment.h" | 18 #include "components/cronet/ios/cronet_environment.h" |
| 19 #include "components/cronet/url_request_context_config.h" | 19 #include "components/cronet/url_request_context_config.h" |
| 20 #include "ios/net/crn_http_protocol_handler.h" | 20 #include "ios/net/crn_http_protocol_handler.h" |
| 21 #include "ios/net/empty_nsurlcache.h" | 21 #include "ios/net/empty_nsurlcache.h" |
| 22 #include "net/cert/cert_verifier.h" | 22 #include "net/cert/cert_verifier.h" |
| 23 #include "net/url_request/url_request_context_getter.h" | 23 #include "net/url_request/url_request_context_getter.h" |
| 24 | 24 |
| 25 // Cronet NSError constants. |
| 26 NSString* const CRNCronetErrorDomain = @"CRNCronetErrorDomain"; |
| 27 NSString* const CRNInvalidArgumentKey = @"CRNInvalidArgumentKey"; |
| 28 |
| 25 namespace { | 29 namespace { |
| 26 | 30 |
| 27 class CronetHttpProtocolHandlerDelegate; | 31 class CronetHttpProtocolHandlerDelegate; |
| 28 | 32 |
| 29 using QuicHintVector = | 33 using QuicHintVector = |
| 30 std::vector<std::unique_ptr<cronet::URLRequestContextConfig::QuicHint>>; | 34 std::vector<std::unique_ptr<cronet::URLRequestContextConfig::QuicHint>>; |
| 31 // Currently there is one and only one instance of CronetEnvironment, | 35 // Currently there is one and only one instance of CronetEnvironment, |
| 32 // which is leaked at the shutdown. We should consider allowing multiple | 36 // which is leaked at the shutdown. We should consider allowing multiple |
| 33 // instances if that makes sense in the future. | 37 // instances if that makes sense in the future. |
| 34 base::LazyInstance<std::unique_ptr<cronet::CronetEnvironment>>::Leaky | 38 base::LazyInstance<std::unique_ptr<cronet::CronetEnvironment>>::Leaky |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 417 } |
| 414 | 418 |
| 415 + (NSError*)createCronetErrorWith:(int)errorCode | 419 + (NSError*)createCronetErrorWith:(int)errorCode |
| 416 userInfo:(NSDictionary*)userInfo { | 420 userInfo:(NSDictionary*)userInfo { |
| 417 return [NSError errorWithDomain:CRNCronetErrorDomain | 421 return [NSError errorWithDomain:CRNCronetErrorDomain |
| 418 code:errorCode | 422 code:errorCode |
| 419 userInfo:userInfo]; | 423 userInfo:userInfo]; |
| 420 } | 424 } |
| 421 | 425 |
| 422 @end | 426 @end |
| OLD | NEW |