| 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 "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "android_webview/browser/aw_request_interceptor.h" | 8 #include "android_webview/browser/aw_request_interceptor.h" |
| 9 #include "android_webview/browser/net/aw_network_delegate.h" | 9 #include "android_webview/browser/net/aw_network_delegate.h" |
| 10 #include "android_webview/browser/net/aw_url_request_job_factory.h" | 10 #include "android_webview/browser/net/aw_url_request_job_factory.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 chrome_devtools_protocol_handler_.release()); | 117 chrome_devtools_protocol_handler_.release()); |
| 118 DCHECK(set_protocol); | 118 DCHECK(set_protocol); |
| 119 // Create a chain of URLRequestJobFactories. Keep |job_factory_| pointed | 119 // Create a chain of URLRequestJobFactories. Keep |job_factory_| pointed |
| 120 // at the beginning of the chain. | 120 // at the beginning of the chain. |
| 121 job_factory_ = CreateAndroidJobFactoryAndCookieMonster( | 121 job_factory_ = CreateAndroidJobFactoryAndCookieMonster( |
| 122 url_request_context_.get(), job_factory.Pass()); | 122 url_request_context_.get(), job_factory.Pass()); |
| 123 job_factory_.reset(new net::ProtocolInterceptJobFactory( | 123 job_factory_.reset(new net::ProtocolInterceptJobFactory( |
| 124 job_factory_.Pass(), | 124 job_factory_.Pass(), |
| 125 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>( | 125 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>( |
| 126 new AwRequestInterceptor()))); | 126 new AwRequestInterceptor()))); |
| 127 job_factory_.reset(new net::ProtocolInterceptJobFactory( | |
| 128 job_factory_.Pass(), | |
| 129 developer_protocol_handler_.Pass())); | |
| 130 url_request_context_->set_job_factory(job_factory_.get()); | 127 url_request_context_->set_job_factory(job_factory_.get()); |
| 131 } | 128 } |
| 132 return url_request_context_.get(); | 129 return url_request_context_.get(); |
| 133 } | 130 } |
| 134 | 131 |
| 135 scoped_refptr<base::SingleThreadTaskRunner> | 132 scoped_refptr<base::SingleThreadTaskRunner> |
| 136 AwURLRequestContextGetter::GetNetworkTaskRunner() const { | 133 AwURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 137 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 134 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 138 } | 135 } |
| 139 | 136 |
| 140 void AwURLRequestContextGetter::SetProtocolHandlers( | 137 void AwURLRequestContextGetter::SetProtocolHandlers( |
| 141 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 138 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 142 blob_protocol_handler, | 139 blob_protocol_handler, |
| 143 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 140 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 144 file_system_protocol_handler, | 141 file_system_protocol_handler, |
| 145 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 142 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 146 developer_protocol_handler, | |
| 147 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 148 chrome_protocol_handler, | 143 chrome_protocol_handler, |
| 149 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 144 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 150 chrome_devtools_protocol_handler) { | 145 chrome_devtools_protocol_handler) { |
| 151 blob_protocol_handler_ = blob_protocol_handler.Pass(); | 146 blob_protocol_handler_ = blob_protocol_handler.Pass(); |
| 152 file_system_protocol_handler_ = file_system_protocol_handler.Pass(); | 147 file_system_protocol_handler_ = file_system_protocol_handler.Pass(); |
| 153 developer_protocol_handler_ = developer_protocol_handler.Pass(); | |
| 154 chrome_protocol_handler_ = chrome_protocol_handler.Pass(); | 148 chrome_protocol_handler_ = chrome_protocol_handler.Pass(); |
| 155 chrome_devtools_protocol_handler_ = chrome_devtools_protocol_handler.Pass(); | 149 chrome_devtools_protocol_handler_ = chrome_devtools_protocol_handler.Pass(); |
| 156 } | 150 } |
| 157 | 151 |
| 158 } // namespace android_webview | 152 } // namespace android_webview |
| OLD | NEW |