| 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" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 content::ProtocolHandlerMap* protocol_handlers, | 106 content::ProtocolHandlerMap* protocol_handlers, |
| 107 content::URLRequestInterceptorScopedVector request_interceptors) { | 107 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 108 std::unique_ptr<AwURLRequestJobFactory> aw_job_factory( | 108 std::unique_ptr<AwURLRequestJobFactory> aw_job_factory( |
| 109 new AwURLRequestJobFactory); | 109 new AwURLRequestJobFactory); |
| 110 // Note that the registered schemes must also be specified in | 110 // Note that the registered schemes must also be specified in |
| 111 // AwContentBrowserClient::IsHandledURL. | 111 // AwContentBrowserClient::IsHandledURL. |
| 112 bool set_protocol = aw_job_factory->SetProtocolHandler( | 112 bool set_protocol = aw_job_factory->SetProtocolHandler( |
| 113 url::kFileScheme, | 113 url::kFileScheme, |
| 114 base::MakeUnique<net::FileProtocolHandler>( | 114 base::MakeUnique<net::FileProtocolHandler>( |
| 115 base::CreateTaskRunnerWithTraits( | 115 base::CreateTaskRunnerWithTraits( |
| 116 base::TaskTraits() | 116 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 117 .MayBlock() | 117 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))); |
| 118 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 119 .WithShutdownBehavior( | |
| 120 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))); | |
| 121 DCHECK(set_protocol); | 118 DCHECK(set_protocol); |
| 122 set_protocol = aw_job_factory->SetProtocolHandler( | 119 set_protocol = aw_job_factory->SetProtocolHandler( |
| 123 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); | 120 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); |
| 124 DCHECK(set_protocol); | 121 DCHECK(set_protocol); |
| 125 set_protocol = aw_job_factory->SetProtocolHandler( | 122 set_protocol = aw_job_factory->SetProtocolHandler( |
| 126 url::kBlobScheme, | 123 url::kBlobScheme, |
| 127 base::WrapUnique((*protocol_handlers)[url::kBlobScheme].release())); | 124 base::WrapUnique((*protocol_handlers)[url::kBlobScheme].release())); |
| 128 DCHECK(set_protocol); | 125 DCHECK(set_protocol); |
| 129 set_protocol = aw_job_factory->SetProtocolHandler( | 126 set_protocol = aw_job_factory->SetProtocolHandler( |
| 130 url::kFileSystemScheme, | 127 url::kFileSystemScheme, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) | 214 #if !BUILDFLAG(DISABLE_FTP_SUPPORT) |
| 218 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet. | 215 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet. |
| 219 #endif | 216 #endif |
| 220 DCHECK(proxy_config_service_.get()); | 217 DCHECK(proxy_config_service_.get()); |
| 221 std::unique_ptr<net::ChannelIDService> channel_id_service; | 218 std::unique_ptr<net::ChannelIDService> channel_id_service; |
| 222 if (TokenBindingManager::GetInstance()->is_enabled()) { | 219 if (TokenBindingManager::GetInstance()->is_enabled()) { |
| 223 base::FilePath channel_id_path = | 220 base::FilePath channel_id_path = |
| 224 browser_context->GetPath().Append(kChannelIDFilename); | 221 browser_context->GetPath().Append(kChannelIDFilename); |
| 225 scoped_refptr<net::SQLiteChannelIDStore> channel_id_db; | 222 scoped_refptr<net::SQLiteChannelIDStore> channel_id_db; |
| 226 channel_id_db = new net::SQLiteChannelIDStore( | 223 channel_id_db = new net::SQLiteChannelIDStore( |
| 227 channel_id_path, base::CreateSequencedTaskRunnerWithTraits( | 224 channel_id_path, |
| 228 base::TaskTraits().MayBlock().WithPriority( | 225 base::CreateSequencedTaskRunnerWithTraits( |
| 229 base::TaskPriority::BACKGROUND))); | 226 {base::MayBlock(), base::TaskPriority::BACKGROUND})); |
| 230 | 227 |
| 231 channel_id_service.reset(new net::ChannelIDService( | 228 channel_id_service.reset(new net::ChannelIDService( |
| 232 new net::DefaultChannelIDStore(channel_id_db.get()))); | 229 new net::DefaultChannelIDStore(channel_id_db.get()))); |
| 233 } | 230 } |
| 234 | 231 |
| 235 // Android provides a local HTTP proxy that handles all the proxying. | 232 // Android provides a local HTTP proxy that handles all the proxying. |
| 236 // Create the proxy without a resolver since we rely on this local HTTP proxy. | 233 // Create the proxy without a resolver since we rely on this local HTTP proxy. |
| 237 // TODO(sgurun) is this behavior guaranteed through SDK? | 234 // TODO(sgurun) is this behavior guaranteed through SDK? |
| 238 | 235 |
| 239 const base::CommandLine& command_line = | 236 const base::CommandLine& command_line = |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 http_auth_preferences_->set_server_whitelist( | 337 http_auth_preferences_->set_server_whitelist( |
| 341 auth_server_whitelist_.GetValue()); | 338 auth_server_whitelist_.GetValue()); |
| 342 } | 339 } |
| 343 | 340 |
| 344 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { | 341 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { |
| 345 http_auth_preferences_->set_auth_android_negotiate_account_type( | 342 http_auth_preferences_->set_auth_android_negotiate_account_type( |
| 346 auth_android_negotiate_account_type_.GetValue()); | 343 auth_android_negotiate_account_type_.GetValue()); |
| 347 } | 344 } |
| 348 | 345 |
| 349 } // namespace android_webview | 346 } // namespace android_webview |
| OLD | NEW |