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_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_content_browser_client.h" | 10 #include "android_webview/browser/aw_content_browser_client.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 params->next_protos = net::NextProtosSpdy31(); | 96 params->next_protos = net::NextProtosSpdy31(); |
97 params->use_alternate_protocols = true; | 97 params->use_alternate_protocols = true; |
98 | 98 |
99 ApplyCmdlineOverridesToNetworkSessionParams(params); | 99 ApplyCmdlineOverridesToNetworkSessionParams(params); |
100 } | 100 } |
101 | 101 |
102 scoped_ptr<net::URLRequestJobFactory> CreateJobFactory( | 102 scoped_ptr<net::URLRequestJobFactory> CreateJobFactory( |
103 content::ProtocolHandlerMap* protocol_handlers) { | 103 content::ProtocolHandlerMap* protocol_handlers) { |
104 scoped_ptr<AwURLRequestJobFactory> aw_job_factory(new AwURLRequestJobFactory); | 104 scoped_ptr<AwURLRequestJobFactory> aw_job_factory(new AwURLRequestJobFactory); |
105 bool set_protocol = aw_job_factory->SetProtocolHandler( | 105 bool set_protocol = aw_job_factory->SetProtocolHandler( |
106 content::kFileScheme, | 106 url::kFileScheme, |
107 new net::FileProtocolHandler( | 107 new net::FileProtocolHandler( |
108 content::BrowserThread::GetBlockingPool()-> | 108 content::BrowserThread::GetBlockingPool()-> |
109 GetTaskRunnerWithShutdownBehavior( | 109 GetTaskRunnerWithShutdownBehavior( |
110 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 110 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
111 DCHECK(set_protocol); | 111 DCHECK(set_protocol); |
112 set_protocol = aw_job_factory->SetProtocolHandler( | 112 set_protocol = aw_job_factory->SetProtocolHandler( |
113 content::kDataScheme, new net::DataProtocolHandler()); | 113 url::kDataScheme, new net::DataProtocolHandler()); |
114 DCHECK(set_protocol); | 114 DCHECK(set_protocol); |
115 set_protocol = aw_job_factory->SetProtocolHandler( | 115 set_protocol = aw_job_factory->SetProtocolHandler( |
116 content::kBlobScheme, | 116 url::kBlobScheme, |
117 (*protocol_handlers)[content::kBlobScheme].release()); | 117 (*protocol_handlers)[url::kBlobScheme].release()); |
118 DCHECK(set_protocol); | 118 DCHECK(set_protocol); |
119 set_protocol = aw_job_factory->SetProtocolHandler( | 119 set_protocol = aw_job_factory->SetProtocolHandler( |
120 content::kFileSystemScheme, | 120 url::kFileSystemScheme, |
121 (*protocol_handlers)[content::kFileSystemScheme].release()); | 121 (*protocol_handlers)[url::kFileSystemScheme].release()); |
122 DCHECK(set_protocol); | 122 DCHECK(set_protocol); |
123 set_protocol = aw_job_factory->SetProtocolHandler( | 123 set_protocol = aw_job_factory->SetProtocolHandler( |
124 content::kChromeUIScheme, | 124 content::kChromeUIScheme, |
125 (*protocol_handlers)[content::kChromeUIScheme].release()); | 125 (*protocol_handlers)[content::kChromeUIScheme].release()); |
126 DCHECK(set_protocol); | 126 DCHECK(set_protocol); |
127 set_protocol = aw_job_factory->SetProtocolHandler( | 127 set_protocol = aw_job_factory->SetProtocolHandler( |
128 content::kChromeDevToolsScheme, | 128 content::kChromeDevToolsScheme, |
129 (*protocol_handlers)[content::kChromeDevToolsScheme].release()); | 129 (*protocol_handlers)[content::kChromeDevToolsScheme].release()); |
130 DCHECK(set_protocol); | 130 DCHECK(set_protocol); |
131 protocol_handlers->clear(); | 131 protocol_handlers->clear(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 std::swap(protocol_handlers_, *protocol_handlers); | 261 std::swap(protocol_handlers_, *protocol_handlers); |
262 } | 262 } |
263 | 263 |
264 DataReductionProxyConfigService* | 264 DataReductionProxyConfigService* |
265 AwURLRequestContextGetter::proxy_config_service() { | 265 AwURLRequestContextGetter::proxy_config_service() { |
266 // TODO(bengr): return system config if data reduction proxy is disabled. | 266 // TODO(bengr): return system config if data reduction proxy is disabled. |
267 return proxy_config_service_.get(); | 267 return proxy_config_service_.get(); |
268 } | 268 } |
269 | 269 |
270 } // namespace android_webview | 270 } // namespace android_webview |
OLD | NEW |