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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void ProvideRTTObservations( | 125 void ProvideRTTObservations( |
125 JNIEnv* env, | 126 JNIEnv* env, |
126 const base::android::JavaParamRef<jobject>& jcaller, | 127 const base::android::JavaParamRef<jobject>& jcaller, |
127 bool should); | 128 bool should); |
128 void ProvideThroughputObservations( | 129 void ProvideThroughputObservations( |
129 JNIEnv* env, | 130 JNIEnv* env, |
130 const base::android::JavaParamRef<jobject>& jcaller, | 131 const base::android::JavaParamRef<jobject>& jcaller, |
131 bool should); | 132 bool should); |
132 | 133 |
133 private: | 134 private: |
| 135 friend class TestUtil; |
| 136 |
134 // Initializes |context_| on the Network thread. | 137 // Initializes |context_| on the Network thread. |
135 void InitializeOnNetworkThread( | 138 void InitializeOnNetworkThread( |
136 std::unique_ptr<URLRequestContextConfig> config, | 139 std::unique_ptr<URLRequestContextConfig> config, |
137 const base::android::ScopedJavaGlobalRef<jobject>& | 140 const base::android::ScopedJavaGlobalRef<jobject>& |
138 jcronet_url_request_context); | 141 jcronet_url_request_context); |
139 | 142 |
140 // Runs a task that might depend on the context being initialized. | 143 // Runs a task that might depend on the context being initialized. |
141 // This method should only be run on the network thread. | 144 // This method should only be run on the network thread. |
142 void RunTaskAfterContextInitOnNetworkThread( | 145 void RunTaskAfterContextInitOnNetworkThread( |
143 const base::Closure& task_to_run_after_context_init); | 146 const base::Closure& task_to_run_after_context_init); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 #if defined(DATA_REDUCTION_PROXY_SUPPORT) | 240 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
238 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; | 241 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; |
239 #endif | 242 #endif |
240 | 243 |
241 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 244 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
242 }; | 245 }; |
243 | 246 |
244 } // namespace cronet | 247 } // namespace cronet |
245 | 248 |
246 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 249 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
OLD | NEW |