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 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 class HttpServerPropertiesManager; | 33 class HttpServerPropertiesManager; |
34 class NetLog; | 34 class NetLog; |
35 class ProxyConfigService; | 35 class ProxyConfigService; |
36 class SdchOwner; | 36 class SdchOwner; |
37 class URLRequestContext; | 37 class URLRequestContext; |
38 class WriteToFileNetLogObserver; | 38 class WriteToFileNetLogObserver; |
39 class BoundedFileNetLogObserver; | 39 class BoundedFileNetLogObserver; |
40 } // namespace net | 40 } // namespace net |
41 | 41 |
42 namespace cronet { | 42 namespace cronet { |
| 43 class TestUtil; |
43 | 44 |
44 #if defined(DATA_REDUCTION_PROXY_SUPPORT) | 45 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
45 class CronetDataReductionProxy; | 46 class CronetDataReductionProxy; |
46 #endif | 47 #endif |
47 | 48 |
48 struct URLRequestContextConfig; | 49 struct URLRequestContextConfig; |
49 | 50 |
50 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); | 51 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); |
51 | 52 |
52 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. | 53 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void ProvideRTTObservations( | 126 void ProvideRTTObservations( |
126 JNIEnv* env, | 127 JNIEnv* env, |
127 const base::android::JavaParamRef<jobject>& jcaller, | 128 const base::android::JavaParamRef<jobject>& jcaller, |
128 bool should); | 129 bool should); |
129 void ProvideThroughputObservations( | 130 void ProvideThroughputObservations( |
130 JNIEnv* env, | 131 JNIEnv* env, |
131 const base::android::JavaParamRef<jobject>& jcaller, | 132 const base::android::JavaParamRef<jobject>& jcaller, |
132 bool should); | 133 bool should); |
133 | 134 |
134 private: | 135 private: |
| 136 friend class TestUtil; |
| 137 |
135 // Initializes |context_| on the Network thread. | 138 // Initializes |context_| on the Network thread. |
136 void InitializeOnNetworkThread( | 139 void InitializeOnNetworkThread( |
137 std::unique_ptr<URLRequestContextConfig> config, | 140 std::unique_ptr<URLRequestContextConfig> config, |
138 const base::android::ScopedJavaGlobalRef<jobject>& | 141 const base::android::ScopedJavaGlobalRef<jobject>& |
139 jcronet_url_request_context); | 142 jcronet_url_request_context); |
140 | 143 |
141 // Runs a task that might depend on the context being initialized. | 144 // Runs a task that might depend on the context being initialized. |
142 // This method should only be run on the network thread. | 145 // This method should only be run on the network thread. |
143 void RunTaskAfterContextInitOnNetworkThread( | 146 void RunTaskAfterContextInitOnNetworkThread( |
144 const base::Closure& task_to_run_after_context_init); | 147 const base::Closure& task_to_run_after_context_init); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 #if defined(DATA_REDUCTION_PROXY_SUPPORT) | 248 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
246 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; | 249 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; |
247 #endif | 250 #endif |
248 | 251 |
249 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 252 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
250 }; | 253 }; |
251 | 254 |
252 } // namespace cronet | 255 } // namespace cronet |
253 | 256 |
254 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 257 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
OLD | NEW |