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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // net::URLRequestContextGetter implementation. | 43 // net::URLRequestContextGetter implementation. |
44 net::URLRequestContext* GetURLRequestContext() override; | 44 net::URLRequestContext* GetURLRequestContext() override; |
45 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() | 45 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
46 const override; | 46 const override; |
47 | 47 |
48 // NetLog is thread-safe, so clients can call this method from arbitrary | 48 // NetLog is thread-safe, so clients can call this method from arbitrary |
49 // threads (UI and IO). | 49 // threads (UI and IO). |
50 net::NetLog* GetNetLog(); | 50 net::NetLog* GetNetLog(); |
51 | 51 |
52 // This should be called before the network stack is ever used. It can be | |
53 // called again afterwards if the key updates. | |
54 void SetKeyOnIO(const std::string& key); | |
55 | |
56 private: | 52 private: |
57 friend class AwBrowserContext; | 53 friend class AwBrowserContext; |
58 ~AwURLRequestContextGetter() override; | 54 ~AwURLRequestContextGetter() override; |
59 | 55 |
60 // Prior to GetURLRequestContext() being called, this is called to hand over | 56 // Prior to GetURLRequestContext() being called, this is called to hand over |
61 // the objects that GetURLRequestContext() will later install into | 57 // the objects that GetURLRequestContext() will later install into |
62 // |job_factory_|. This ordering is enforced by having | 58 // |job_factory_|. This ordering is enforced by having |
63 // AwBrowserContext::CreateRequestContext() call this method. | 59 // AwBrowserContext::CreateRequestContext() call this method. |
64 // This method is necessary because the passed in objects are created | 60 // This method is necessary because the passed in objects are created |
65 // on the UI thread while |job_factory_| must be created on the IO thread. | 61 // on the UI thread while |job_factory_| must be created on the IO thread. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // SetHandlersAndInterceptors() and the first GetURLRequestContext() call. | 93 // SetHandlersAndInterceptors() and the first GetURLRequestContext() call. |
98 content::ProtocolHandlerMap protocol_handlers_; | 94 content::ProtocolHandlerMap protocol_handlers_; |
99 content::URLRequestInterceptorScopedVector request_interceptors_; | 95 content::URLRequestInterceptorScopedVector request_interceptors_; |
100 | 96 |
101 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); | 97 DISALLOW_COPY_AND_ASSIGN(AwURLRequestContextGetter); |
102 }; | 98 }; |
103 | 99 |
104 } // namespace android_webview | 100 } // namespace android_webview |
105 | 101 |
106 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ | 102 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |