OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_ADAPTER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_ADAPTER_H_ |
6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_ADAPTER_H_ | 6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_ADAPTER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "net/log/net_log.h" | 18 #include "net/log/net_log.h" |
19 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
20 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | |
24 class WriteToFileNetLogObserver; | 23 class WriteToFileNetLogObserver; |
25 | |
26 class ProxyConfigService; | 24 class ProxyConfigService; |
27 | 25 class SdchOwner; |
28 } // namespace net | 26 } // namespace net |
29 | 27 |
30 namespace cronet { | 28 namespace cronet { |
31 | 29 |
32 struct URLRequestContextConfig; | 30 struct URLRequestContextConfig; |
33 typedef base::Callback<void(void)> RunAfterContextInitTask; | 31 typedef base::Callback<void(void)> RunAfterContextInitTask; |
34 | 32 |
35 // Implementation of the Chromium NetLog observer interface. | 33 // Implementation of the Chromium NetLog observer interface. |
36 class NetLogObserver : public net::NetLog::ThreadSafeObserver { | 34 class NetLogObserver : public net::NetLog::ThreadSafeObserver { |
37 public: | 35 public: |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void StopNetLogHelper(); | 100 void StopNetLogHelper(); |
103 | 101 |
104 scoped_refptr<URLRequestContextAdapterDelegate> delegate_; | 102 scoped_refptr<URLRequestContextAdapterDelegate> delegate_; |
105 scoped_ptr<net::URLRequestContext> context_; | 103 scoped_ptr<net::URLRequestContext> context_; |
106 std::string user_agent_; | 104 std::string user_agent_; |
107 bool load_disable_cache_; | 105 bool load_disable_cache_; |
108 base::Thread* network_thread_; | 106 base::Thread* network_thread_; |
109 scoped_ptr<NetLogObserver> net_log_observer_; | 107 scoped_ptr<NetLogObserver> net_log_observer_; |
110 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; | 108 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; |
111 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 109 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
| 110 scoped_ptr<net::SdchOwner> sdch_owner_; |
112 scoped_ptr<URLRequestContextConfig> config_; | 111 scoped_ptr<URLRequestContextConfig> config_; |
113 | 112 |
114 // A queue of tasks that need to be run after context has been initialized. | 113 // A queue of tasks that need to be run after context has been initialized. |
115 std::queue<RunAfterContextInitTask> tasks_waiting_for_context_; | 114 std::queue<RunAfterContextInitTask> tasks_waiting_for_context_; |
116 bool is_context_initialized_; | 115 bool is_context_initialized_; |
117 | 116 |
118 DISALLOW_COPY_AND_ASSIGN(URLRequestContextAdapter); | 117 DISALLOW_COPY_AND_ASSIGN(URLRequestContextAdapter); |
119 }; | 118 }; |
120 | 119 |
121 } // namespace cronet | 120 } // namespace cronet |
122 | 121 |
123 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_ADAPTER_H_ | 122 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_CONTEXT_ADAPTER_H_ |
OLD | NEW |