| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 content::kDataScheme, new net::DataProtocolHandler()); | 102 content::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()); |
| 106 DCHECK(set_protocol); | 106 DCHECK(set_protocol); |
| 107 set_protocol = aw_job_factory->SetProtocolHandler( | 107 set_protocol = aw_job_factory->SetProtocolHandler( |
| 108 content::kFileSystemScheme, | 108 content::kFileSystemScheme, |
| 109 (*protocol_handlers)[content::kFileSystemScheme].release()); | 109 (*protocol_handlers)[content::kFileSystemScheme].release()); |
| 110 DCHECK(set_protocol); | 110 DCHECK(set_protocol); |
| 111 set_protocol = aw_job_factory->SetProtocolHandler( | 111 set_protocol = aw_job_factory->SetProtocolHandler( |
| 112 chrome::kChromeUIScheme, | 112 content::kChromeUIScheme, |
| 113 (*protocol_handlers)[chrome::kChromeUIScheme].release()); | 113 (*protocol_handlers)[content::kChromeUIScheme].release()); |
| 114 DCHECK(set_protocol); | 114 DCHECK(set_protocol); |
| 115 set_protocol = aw_job_factory->SetProtocolHandler( | 115 set_protocol = aw_job_factory->SetProtocolHandler( |
| 116 chrome::kChromeDevToolsScheme, | 116 chrome::kChromeDevToolsScheme, |
| 117 (*protocol_handlers)[chrome::kChromeDevToolsScheme].release()); | 117 (*protocol_handlers)[chrome::kChromeDevToolsScheme].release()); |
| 118 DCHECK(set_protocol); | 118 DCHECK(set_protocol); |
| 119 protocol_handlers->clear(); | 119 protocol_handlers->clear(); |
| 120 | 120 |
| 121 // Create a chain of URLRequestJobFactories. The handlers will be invoked | 121 // Create a chain of URLRequestJobFactories. The handlers will be invoked |
| 122 // in the order in which they appear in the protocol_handlers vector. | 122 // in the order in which they appear in the protocol_handlers vector. |
| 123 typedef std::vector<net::URLRequestJobFactory::ProtocolHandler*> | 123 typedef std::vector<net::URLRequestJobFactory::ProtocolHandler*> |
| (...skipping 106 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 |