| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; | 43 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; |
| 44 virtual scoped_refptr<base::SingleThreadTaskRunner> | 44 virtual scoped_refptr<base::SingleThreadTaskRunner> |
| 45 GetNetworkTaskRunner() const OVERRIDE; | 45 GetNetworkTaskRunner() const OVERRIDE; |
| 46 | 46 |
| 47 DataReductionProxyConfigService* proxy_config_service(); | 47 DataReductionProxyConfigService* proxy_config_service(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 friend class AwBrowserContext; | 50 friend class AwBrowserContext; |
| 51 virtual ~AwURLRequestContextGetter(); | 51 virtual ~AwURLRequestContextGetter(); |
| 52 | 52 |
| 53 // Prior to GetURLRequestContext() being called, SetProtocolHandlers() is | 53 // Prior to GetURLRequestContext() being called, this is called to hand over |
| 54 // called to hand over the ProtocolHandlers that GetURLRequestContext() will | 54 // the objects that GetURLRequestContext() will later install into |
| 55 // later install into |job_factory_|. This ordering is enforced by having | 55 // |job_factory_|. This ordering is enforced by having |
| 56 // AwBrowserContext::CreateRequestContext() call SetProtocolHandlers(). | 56 // AwBrowserContext::CreateRequestContext() call this method. |
| 57 // SetProtocolHandlers() is necessary because the ProtocolHandlers are created | 57 // This method is necessary because the passed in objects are created |
| 58 // on the UI thread while |job_factory_| must be created on the IO thread. | 58 // on the UI thread while |job_factory_| must be created on the IO thread. |
| 59 void SetProtocolHandlers(content::ProtocolHandlerMap* protocol_handlers); | 59 void SetHandlersAndInterceptors( |
| 60 content::ProtocolHandlerMap* protocol_handlers, |
| 61 content::URLRequestInterceptorScopedVector request_interceptors); |
| 60 | 62 |
| 61 void InitializeURLRequestContext(); | 63 void InitializeURLRequestContext(); |
| 62 | 64 |
| 63 const base::FilePath partition_path_; | 65 const base::FilePath partition_path_; |
| 64 scoped_refptr<net::CookieStore> cookie_store_; | 66 scoped_refptr<net::CookieStore> cookie_store_; |
| 65 scoped_ptr<net::URLRequestContext> url_request_context_; | 67 scoped_ptr<net::URLRequestContext> url_request_context_; |
| 66 scoped_ptr<DataReductionProxyConfigService> proxy_config_service_; | 68 scoped_ptr<DataReductionProxyConfigService> proxy_config_service_; |
| 67 scoped_ptr<net::URLRequestJobFactory> job_factory_; | 69 scoped_ptr<net::URLRequestJobFactory> job_factory_; |
| 68 scoped_ptr<net::HttpTransactionFactory> main_http_factory_; | 70 scoped_ptr<net::HttpTransactionFactory> main_http_factory_; |
| 69 | 71 |
| 70 // ProtocolHandlers are stored here between SetProtocolHandlers() and the | 72 // ProtocolHandlers and interceptors are stored here between |
| 71 // first GetURLRequestContext() call. | 73 // SetHandlersAndInterceptors() and the first GetURLRequestContext() call. |
| 72 content::ProtocolHandlerMap protocol_handlers_; | 74 content::ProtocolHandlerMap protocol_handlers_; |
| 75 content::URLRequestInterceptorScopedVector request_interceptors_; |
| 73 | 76 |
| 74 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); | 77 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } // namespace android_webview | 80 } // namespace android_webview |
| 78 | 81 |
| 79 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ | 82 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |