| 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/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
| 26 #include "components/prefs/pref_service.h" | 27 #include "components/prefs/pref_service.h" |
| 27 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 28 #include "content/public/browser/content_browser_client.h" | 29 #include "content/public/browser/content_browser_client.h" |
| 29 #include "content/public/browser/cookie_store_factory.h" | 30 #include "content/public/browser/cookie_store_factory.h" |
| 30 #include "content/public/common/content_client.h" | 31 #include "content/public/common/content_client.h" |
| 31 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
| 32 #include "content/public/common/url_constants.h" | 33 #include "content/public/common/url_constants.h" |
| 33 #include "net/base/cache_type.h" | 34 #include "net/base/cache_type.h" |
| 34 #include "net/cookies/cookie_store.h" | 35 #include "net/cookies/cookie_store.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 std::unique_ptr<net::URLRequestJobFactory> CreateJobFactory( | 105 std::unique_ptr<net::URLRequestJobFactory> CreateJobFactory( |
| 105 content::ProtocolHandlerMap* protocol_handlers, | 106 content::ProtocolHandlerMap* protocol_handlers, |
| 106 content::URLRequestInterceptorScopedVector request_interceptors) { | 107 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 107 std::unique_ptr<AwURLRequestJobFactory> aw_job_factory( | 108 std::unique_ptr<AwURLRequestJobFactory> aw_job_factory( |
| 108 new AwURLRequestJobFactory); | 109 new AwURLRequestJobFactory); |
| 109 // Note that the registered schemes must also be specified in | 110 // Note that the registered schemes must also be specified in |
| 110 // AwContentBrowserClient::IsHandledURL. | 111 // AwContentBrowserClient::IsHandledURL. |
| 111 bool set_protocol = aw_job_factory->SetProtocolHandler( | 112 bool set_protocol = aw_job_factory->SetProtocolHandler( |
| 112 url::kFileScheme, | 113 url::kFileScheme, |
| 113 base::MakeUnique<net::FileProtocolHandler>( | 114 base::MakeUnique<net::FileProtocolHandler>( |
| 114 content::BrowserThread::GetBlockingPool() | 115 base::CreateTaskRunnerWithTraits( |
| 115 ->GetTaskRunnerWithShutdownBehavior( | 116 base::TaskTraits() |
| 116 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 117 .MayBlock() |
| 118 .WithPriority(base::TaskPriority::BACKGROUND) |
| 119 .WithShutdownBehavior( |
| 120 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))); |
| 117 DCHECK(set_protocol); | 121 DCHECK(set_protocol); |
| 118 set_protocol = aw_job_factory->SetProtocolHandler( | 122 set_protocol = aw_job_factory->SetProtocolHandler( |
| 119 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); | 123 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); |
| 120 DCHECK(set_protocol); | 124 DCHECK(set_protocol); |
| 121 set_protocol = aw_job_factory->SetProtocolHandler( | 125 set_protocol = aw_job_factory->SetProtocolHandler( |
| 122 url::kBlobScheme, | 126 url::kBlobScheme, |
| 123 base::WrapUnique((*protocol_handlers)[url::kBlobScheme].release())); | 127 base::WrapUnique((*protocol_handlers)[url::kBlobScheme].release())); |
| 124 DCHECK(set_protocol); | 128 DCHECK(set_protocol); |
| 125 set_protocol = aw_job_factory->SetProtocolHandler( | 129 set_protocol = aw_job_factory->SetProtocolHandler( |
| 126 url::kFileSystemScheme, | 130 url::kFileSystemScheme, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 http_auth_preferences_->set_server_whitelist( | 340 http_auth_preferences_->set_server_whitelist( |
| 337 auth_server_whitelist_.GetValue()); | 341 auth_server_whitelist_.GetValue()); |
| 338 } | 342 } |
| 339 | 343 |
| 340 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { | 344 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { |
| 341 http_auth_preferences_->set_auth_android_negotiate_account_type( | 345 http_auth_preferences_->set_auth_android_negotiate_account_type( |
| 342 auth_android_negotiate_account_type_.GetValue()); | 346 auth_android_negotiate_account_type_.GetValue()); |
| 343 } | 347 } |
| 344 | 348 |
| 345 } // namespace android_webview | 349 } // namespace android_webview |
| OLD | NEW |