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 21 matching lines...) Expand all Loading... |
32 class AwNetworkDelegate; | 32 class AwNetworkDelegate; |
33 | 33 |
34 class AwURLRequestContextGetter : public net::URLRequestContextGetter { | 34 class AwURLRequestContextGetter : public net::URLRequestContextGetter { |
35 public: | 35 public: |
36 AwURLRequestContextGetter( | 36 AwURLRequestContextGetter( |
37 const base::FilePath& cache_path, | 37 const base::FilePath& cache_path, |
38 net::CookieStore* cookie_store, | 38 net::CookieStore* cookie_store, |
39 scoped_ptr<net::ProxyConfigService> config_service); | 39 scoped_ptr<net::ProxyConfigService> config_service); |
40 | 40 |
41 // net::URLRequestContextGetter implementation. | 41 // net::URLRequestContextGetter implementation. |
42 virtual net::URLRequestContext* GetURLRequestContext() override; | 42 net::URLRequestContext* GetURLRequestContext() override; |
43 virtual scoped_refptr<base::SingleThreadTaskRunner> | 43 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
44 GetNetworkTaskRunner() const override; | 44 const override; |
45 | 45 |
46 data_reduction_proxy::DataReductionProxyAuthRequestHandler* | 46 data_reduction_proxy::DataReductionProxyAuthRequestHandler* |
47 GetDataReductionProxyAuthRequestHandler() const; | 47 GetDataReductionProxyAuthRequestHandler() const; |
48 | 48 |
49 // NetLog is thread-safe, so clients can call this method from arbitrary | 49 // NetLog is thread-safe, so clients can call this method from arbitrary |
50 // threads (UI and IO). | 50 // threads (UI and IO). |
51 net::NetLog* GetNetLog(); | 51 net::NetLog* GetNetLog(); |
52 | 52 |
53 // This should be called before the network stack is ever used. It can be | 53 // This should be called before the network stack is ever used. It can be |
54 // called again afterwards if the key updates. | 54 // called again afterwards if the key updates. |
55 void SetKeyOnIO(const std::string& key); | 55 void SetKeyOnIO(const std::string& key); |
56 | 56 |
57 private: | 57 private: |
58 friend class AwBrowserContext; | 58 friend class AwBrowserContext; |
59 virtual ~AwURLRequestContextGetter(); | 59 ~AwURLRequestContextGetter() override; |
60 | 60 |
61 // Prior to GetURLRequestContext() being called, this is called to hand over | 61 // Prior to GetURLRequestContext() being called, this is called to hand over |
62 // the objects that GetURLRequestContext() will later install into | 62 // the objects that GetURLRequestContext() will later install into |
63 // |job_factory_|. This ordering is enforced by having | 63 // |job_factory_|. This ordering is enforced by having |
64 // AwBrowserContext::CreateRequestContext() call this method. | 64 // AwBrowserContext::CreateRequestContext() call this method. |
65 // This method is necessary because the passed in objects are created | 65 // This method is necessary because the passed in objects are created |
66 // on the UI thread while |job_factory_| must be created on the IO thread. | 66 // on the UI thread while |job_factory_| must be created on the IO thread. |
67 void SetHandlersAndInterceptors( | 67 void SetHandlersAndInterceptors( |
68 content::ProtocolHandlerMap* protocol_handlers, | 68 content::ProtocolHandlerMap* protocol_handlers, |
69 content::URLRequestInterceptorScopedVector request_interceptors); | 69 content::URLRequestInterceptorScopedVector request_interceptors); |
(...skipping 14 matching lines...) Expand all Loading... |
84 // SetHandlersAndInterceptors() and the first GetURLRequestContext() call. | 84 // SetHandlersAndInterceptors() and the first GetURLRequestContext() call. |
85 content::ProtocolHandlerMap protocol_handlers_; | 85 content::ProtocolHandlerMap protocol_handlers_; |
86 content::URLRequestInterceptorScopedVector request_interceptors_; | 86 content::URLRequestInterceptorScopedVector request_interceptors_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); | 88 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace android_webview | 91 } // namespace android_webview |
92 | 92 |
93 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ | 93 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |