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_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 11 matching lines...) Expand all Loading... |
22 } // namespace base | 22 } // namespace base |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 class WriteToFileNetLogObserver; | 25 class WriteToFileNetLogObserver; |
26 class URLRequestContext; | 26 class URLRequestContext; |
27 class ProxyConfigService; | 27 class ProxyConfigService; |
28 } // namespace net | 28 } // namespace net |
29 | 29 |
30 namespace cronet { | 30 namespace cronet { |
31 | 31 |
| 32 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
32 class CronetDataReductionProxy; | 33 class CronetDataReductionProxy; |
| 34 #endif |
| 35 |
33 struct URLRequestContextConfig; | 36 struct URLRequestContextConfig; |
34 | 37 |
35 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); | 38 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); |
36 | 39 |
37 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. | 40 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. |
38 class CronetURLRequestContextAdapter { | 41 class CronetURLRequestContextAdapter { |
39 public: | 42 public: |
40 explicit CronetURLRequestContextAdapter( | 43 explicit CronetURLRequestContextAdapter( |
41 scoped_ptr<URLRequestContextConfig> context_config); | 44 scoped_ptr<URLRequestContextConfig> context_config); |
42 | 45 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 scoped_ptr<net::URLRequestContext> context_; | 95 scoped_ptr<net::URLRequestContext> context_; |
93 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 96 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
94 | 97 |
95 // Context config is only valid untng context is initialized. | 98 // Context config is only valid untng context is initialized. |
96 scoped_ptr<URLRequestContextConfig> context_config_; | 99 scoped_ptr<URLRequestContextConfig> context_config_; |
97 | 100 |
98 // A queue of tasks that need to be run after context has been initialized. | 101 // A queue of tasks that need to be run after context has been initialized. |
99 std::queue<base::Closure> tasks_waiting_for_context_; | 102 std::queue<base::Closure> tasks_waiting_for_context_; |
100 bool is_context_initialized_; | 103 bool is_context_initialized_; |
101 int default_load_flags_; | 104 int default_load_flags_; |
| 105 |
| 106 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
102 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_; | 107 scoped_ptr<CronetDataReductionProxy> data_reduction_proxy_; |
| 108 #endif |
103 | 109 |
104 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 110 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
105 }; | 111 }; |
106 | 112 |
107 } // namespace cronet | 113 } // namespace cronet |
108 | 114 |
109 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 115 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
OLD | NEW |