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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "android_webview/browser/aw_content_browser_client.h" | 9 #include "android_webview/browser/aw_content_browser_client.h" |
10 #include "android_webview/browser/aw_request_interceptor.h" | 10 #include "android_webview/browser/aw_request_interceptor.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 params->network_delegate = context->network_delegate(); | 85 params->network_delegate = context->network_delegate(); |
86 params->http_server_properties = context->http_server_properties(); | 86 params->http_server_properties = context->http_server_properties(); |
87 params->net_log = context->net_log(); | 87 params->net_log = context->net_log(); |
88 ApplyCmdlineOverridesToNetworkSessionParams(params); | 88 ApplyCmdlineOverridesToNetworkSessionParams(params); |
89 } | 89 } |
90 | 90 |
91 scoped_ptr<net::URLRequestJobFactory> CreateJobFactory( | 91 scoped_ptr<net::URLRequestJobFactory> CreateJobFactory( |
92 content::ProtocolHandlerMap* protocol_handlers) { | 92 content::ProtocolHandlerMap* protocol_handlers) { |
93 scoped_ptr<AwURLRequestJobFactory> aw_job_factory(new AwURLRequestJobFactory); | 93 scoped_ptr<AwURLRequestJobFactory> aw_job_factory(new AwURLRequestJobFactory); |
94 bool set_protocol = aw_job_factory->SetProtocolHandler( | 94 bool set_protocol = aw_job_factory->SetProtocolHandler( |
95 chrome::kFileScheme, | 95 content::kFileScheme, |
96 new net::FileProtocolHandler( | 96 new net::FileProtocolHandler( |
97 content::BrowserThread::GetBlockingPool()-> | 97 content::BrowserThread::GetBlockingPool()-> |
98 GetTaskRunnerWithShutdownBehavior( | 98 GetTaskRunnerWithShutdownBehavior( |
99 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 99 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
100 DCHECK(set_protocol); | 100 DCHECK(set_protocol); |
101 set_protocol = aw_job_factory->SetProtocolHandler( | 101 set_protocol = aw_job_factory->SetProtocolHandler( |
102 chrome::kDataScheme, new net::DataProtocolHandler()); | 102 chrome::kDataScheme, new net::DataProtocolHandler()); |
103 DCHECK(set_protocol); | 103 DCHECK(set_protocol); |
104 set_protocol = aw_job_factory->SetProtocolHandler( | 104 set_protocol = aw_job_factory->SetProtocolHandler( |
105 chrome::kBlobScheme, (*protocol_handlers)[chrome::kBlobScheme].release()); | 105 chrome::kBlobScheme, (*protocol_handlers)[chrome::kBlobScheme].release()); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 AwURLRequestContextGetter::GetNetworkTaskRunner() const { | 230 AwURLRequestContextGetter::GetNetworkTaskRunner() const { |
231 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 231 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
232 } | 232 } |
233 | 233 |
234 void AwURLRequestContextGetter::SetProtocolHandlers( | 234 void AwURLRequestContextGetter::SetProtocolHandlers( |
235 content::ProtocolHandlerMap* protocol_handlers) { | 235 content::ProtocolHandlerMap* protocol_handlers) { |
236 std::swap(protocol_handlers_, *protocol_handlers); | 236 std::swap(protocol_handlers_, *protocol_handlers); |
237 } | 237 } |
238 | 238 |
239 } // namespace android_webview | 239 } // namespace android_webview |
OLD | NEW |