| 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 #include "components/cronet/ios/cronet_environment.h" | 5 #include "components/cronet/ios/cronet_environment.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 config->ConfigureURLRequestContextBuilder(&context_builder, net_log_.get(), | 305 config->ConfigureURLRequestContextBuilder(&context_builder, net_log_.get(), |
| 306 file_thread_.get()->task_runner()); | 306 file_thread_.get()->task_runner()); |
| 307 | 307 |
| 308 std::unique_ptr<net::MappedHostResolver> mapped_host_resolver( | 308 std::unique_ptr<net::MappedHostResolver> mapped_host_resolver( |
| 309 new net::MappedHostResolver( | 309 new net::MappedHostResolver( |
| 310 net::HostResolver::CreateDefaultResolver(nullptr))); | 310 net::HostResolver::CreateDefaultResolver(nullptr))); |
| 311 | 311 |
| 312 context_builder.set_host_resolver(std::move(mapped_host_resolver)); | 312 context_builder.set_host_resolver(std::move(mapped_host_resolver)); |
| 313 | 313 |
| 314 // TODO(690969): This behavior matches previous behavior of CookieStoreIOS in |
| 315 // CrNet, but should change to adhere to App's Cookie Accept Policy instead |
| 316 // of changing it. |
| 317 [[NSHTTPCookieStorage sharedHTTPCookieStorage] |
| 318 setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; |
| 314 std::unique_ptr<net::CookieStore> cookie_store = | 319 std::unique_ptr<net::CookieStore> cookie_store = |
| 315 base::MakeUnique<net::CookieStoreIOS>( | 320 base::MakeUnique<net::CookieStoreIOS>( |
| 316 [NSHTTPCookieStorage sharedHTTPCookieStorage]); | 321 [NSHTTPCookieStorage sharedHTTPCookieStorage]); |
| 317 context_builder.SetCookieAndChannelIdStores(std::move(cookie_store), nullptr); | 322 context_builder.SetCookieAndChannelIdStores(std::move(cookie_store), nullptr); |
| 318 | 323 |
| 319 std::unordered_set<std::string> quic_host_whitelist; | 324 std::unordered_set<std::string> quic_host_whitelist; |
| 320 std::unique_ptr<net::HttpServerProperties> http_server_properties( | 325 std::unique_ptr<net::HttpServerProperties> http_server_properties( |
| 321 new net::HttpServerPropertiesImpl()); | 326 new net::HttpServerPropertiesImpl()); |
| 322 for (const auto& quic_hint : quic_hints_) { | 327 for (const auto& quic_hint : quic_hints_) { |
| 323 net::AlternativeService alternative_service(net::kProtoQUIC, "", | 328 net::AlternativeService alternative_service(net::kProtoQUIC, "", |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 event->Signal(); | 376 event->Signal(); |
| 372 } | 377 } |
| 373 | 378 |
| 374 std::string CronetEnvironment::getDefaultQuicUserAgentId() const { | 379 std::string CronetEnvironment::getDefaultQuicUserAgentId() const { |
| 375 return base::SysNSStringToUTF8([[NSBundle mainBundle] | 380 return base::SysNSStringToUTF8([[NSBundle mainBundle] |
| 376 objectForInfoDictionaryKey:@"CFBundleDisplayName"]) + | 381 objectForInfoDictionaryKey:@"CFBundleDisplayName"]) + |
| 377 " Cronet/" + CRONET_VERSION; | 382 " Cronet/" + CRONET_VERSION; |
| 378 } | 383 } |
| 379 | 384 |
| 380 } // namespace cronet | 385 } // namespace cronet |
| OLD | NEW |