| 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 #ifndef ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 virtual ~AwURLRequestContextGetter(); | 47 virtual ~AwURLRequestContextGetter(); |
| 48 | 48 |
| 49 // Prior to GetURLRequestContext() being called, SetProtocolHandlers() is | 49 // Prior to GetURLRequestContext() being called, SetProtocolHandlers() is |
| 50 // called to hand over the ProtocolHandlers that GetURLRequestContext() will | 50 // called to hand over the ProtocolHandlers that GetURLRequestContext() will |
| 51 // later install into |job_factory_|. This ordering is enforced by having | 51 // later install into |job_factory_|. This ordering is enforced by having |
| 52 // AwBrowserContext::CreateRequestContext() call SetProtocolHandlers(). | 52 // AwBrowserContext::CreateRequestContext() call SetProtocolHandlers(). |
| 53 // SetProtocolHandlers() is necessary because the ProtocolHandlers are created | 53 // SetProtocolHandlers() is necessary because the ProtocolHandlers are created |
| 54 // on the UI thread while |job_factory_| must be created on the IO thread. | 54 // on the UI thread while |job_factory_| must be created on the IO thread. |
| 55 void SetProtocolHandlers( | 55 void SetProtocolHandlers( |
| 56 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 56 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 57 blob_protocol_handler, | |
| 58 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 59 file_system_protocol_handler, | |
| 60 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 61 developer_protocol_handler, | 57 developer_protocol_handler, |
| 62 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 58 content::ProtocolHandlerMap* protocol_handlers); |
| 63 chrome_protocol_handler, | |
| 64 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 65 chrome_devtools_protocol_handler); | |
| 66 | 59 |
| 67 void PopulateNetworkSessionParams(net::HttpNetworkSession::Params* params); | 60 void PopulateNetworkSessionParams(net::HttpNetworkSession::Params* params); |
| 68 | 61 |
| 69 AwBrowserContext* browser_context_; // weak | 62 AwBrowserContext* browser_context_; // weak |
| 70 scoped_ptr<net::URLRequestContext> url_request_context_; | 63 scoped_ptr<net::URLRequestContext> url_request_context_; |
| 71 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 64 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
| 72 scoped_ptr<net::URLRequestJobFactory> job_factory_; | 65 scoped_ptr<net::URLRequestJobFactory> job_factory_; |
| 73 scoped_ptr<net::HttpTransactionFactory> main_http_factory_; | 66 scoped_ptr<net::HttpTransactionFactory> main_http_factory_; |
| 74 | 67 |
| 75 // ProtocolHandlers are stored here between SetProtocolHandlers() and the | 68 // ProtocolHandlers are stored here between SetProtocolHandlers() and the |
| 76 // first GetURLRequestContext() call. | 69 // first GetURLRequestContext() call. |
| 77 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> blob_protocol_handler_; | |
| 78 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 79 file_system_protocol_handler_; | |
| 80 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 70 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 81 developer_protocol_handler_; | 71 developer_protocol_handler_; |
| 82 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 72 content::ProtocolHandlerMap protocol_handlers_; |
| 83 chrome_protocol_handler_; | |
| 84 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 85 chrome_devtools_protocol_handler_; | |
| 86 | 73 |
| 87 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); | 74 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); |
| 88 }; | 75 }; |
| 89 | 76 |
| 90 } // namespace android_webview | 77 } // namespace android_webview |
| 91 | 78 |
| 92 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ | 79 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |