Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/browser/net/aw_url_request_context_getter.h" | 5 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
| 11 #include "android_webview/browser/aw_content_browser_client.h" | 11 #include "android_webview/browser/aw_content_browser_client.h" |
| 12 #include "android_webview/browser/net/aw_cookie_store_wrapper.h" | 12 #include "android_webview/browser/net/aw_cookie_store_wrapper.h" |
| 13 #include "android_webview/browser/net/aw_http_user_agent_settings.h" | 13 #include "android_webview/browser/net/aw_http_user_agent_settings.h" |
| 14 #include "android_webview/browser/net/aw_network_delegate.h" | 14 #include "android_webview/browser/net/aw_network_delegate.h" |
| 15 #include "android_webview/browser/net/aw_request_interceptor.h" | 15 #include "android_webview/browser/net/aw_request_interceptor.h" |
| 16 #include "android_webview/browser/net/aw_url_request_job_factory.h" | 16 #include "android_webview/browser/net/aw_url_request_job_factory.h" |
| 17 #include "android_webview/browser/net/init_native_callback.h" | 17 #include "android_webview/browser/net/init_native_callback.h" |
| 18 #include "android_webview/browser/net/token_binding_manager.h" | 18 #include "android_webview/browser/net/token_binding_manager.h" |
| 19 #include "android_webview/common/aw_content_client.h" | 19 #include "android_webview/common/aw_content_client.h" |
| 20 #include "base/bind.h" | 20 #include "base/bind.h" |
| 21 #include "base/command_line.h" | 21 #include "base/command_line.h" |
| 22 #include "base/files/file_path.h" | 22 #include "base/files/file_path.h" |
| 23 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
| 24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/task_scheduler/post_task.h" | 25 #include "base/task_scheduler/post_task.h" |
| 26 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
| 27 #include "components/network_session_configurator/common/network_switches.h" | |
| 27 #include "components/prefs/pref_service.h" | 28 #include "components/prefs/pref_service.h" |
| 28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
| 30 #include "content/public/browser/cookie_store_factory.h" | 31 #include "content/public/browser/cookie_store_factory.h" |
| 31 #include "content/public/common/content_client.h" | 32 #include "content/public/common/content_client.h" |
| 32 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
| 33 #include "content/public/common/url_constants.h" | 34 #include "content/public/common/url_constants.h" |
| 34 #include "net/base/cache_type.h" | 35 #include "net/base/cache_type.h" |
| 35 #include "net/cookies/cookie_store.h" | 36 #include "net/cookies/cookie_store.h" |
| 36 #include "net/dns/mapped_host_resolver.h" | 37 #include "net/dns/mapped_host_resolver.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 // If hostname remappings were specified on the command-line, layer these | 79 // If hostname remappings were specified on the command-line, layer these |
| 79 // rules on top of the real host resolver. This allows forwarding all | 80 // rules on top of the real host resolver. This allows forwarding all |
| 80 // requests through a designated test server. | 81 // requests through a designated test server. |
| 81 host_resolver->SetRulesFromString( | 82 host_resolver->SetRulesFromString( |
| 82 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); | 83 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 | 86 |
| 86 void ApplyCmdlineOverridesToNetworkSessionParams( | 87 void ApplyCmdlineOverridesToNetworkSessionParams( |
| 87 net::HttpNetworkSession::Params* params) { | 88 net::HttpNetworkSession::Params* params) { |
| 89 // TODO(mmenke): Should this use network_session_configurator? | |
|
Tobias Sargeant
2017/06/09 17:55:36
I think the answer to this is at the moment no, be
mmenke
2017/06/09 18:02:35
But it also sets up command line flags, including
| |
| 88 int value; | 90 int value; |
| 89 const base::CommandLine& command_line = | 91 const base::CommandLine& command_line = |
| 90 *base::CommandLine::ForCurrentProcess(); | 92 *base::CommandLine::ForCurrentProcess(); |
| 91 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { | 93 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { |
| 92 base::StringToInt(command_line.GetSwitchValueASCII( | 94 base::StringToInt(command_line.GetSwitchValueASCII( |
| 93 switches::kTestingFixedHttpPort), &value); | 95 switches::kTestingFixedHttpPort), &value); |
| 94 params->testing_fixed_http_port = value; | 96 params->testing_fixed_http_port = value; |
| 95 } | 97 } |
| 96 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | 98 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { |
| 97 base::StringToInt(command_line.GetSwitchValueASCII( | 99 base::StringToInt(command_line.GetSwitchValueASCII( |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 http_auth_preferences_->set_server_whitelist( | 339 http_auth_preferences_->set_server_whitelist( |
| 338 auth_server_whitelist_.GetValue()); | 340 auth_server_whitelist_.GetValue()); |
| 339 } | 341 } |
| 340 | 342 |
| 341 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { | 343 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { |
| 342 http_auth_preferences_->set_auth_android_negotiate_account_type( | 344 http_auth_preferences_->set_auth_android_negotiate_account_type( |
| 343 auth_android_negotiate_account_type_.GetValue()); | 345 auth_android_negotiate_account_type_.GetValue()); |
| 344 } | 346 } |
| 345 | 347 |
| 346 } // namespace android_webview | 348 } // namespace android_webview |
| OLD | NEW |