| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // verifications of |context_|'s |cert_verifier|. | 91 // verifications of |context_|'s |cert_verifier|. |
| 92 void GetCertVerifierData(JNIEnv* env, | 92 void GetCertVerifierData(JNIEnv* env, |
| 93 const base::android::JavaParamRef<jobject>& jcaller); | 93 const base::android::JavaParamRef<jobject>& jcaller); |
| 94 | 94 |
| 95 // Default net::LOAD flags used to create requests. | 95 // Default net::LOAD flags used to create requests. |
| 96 int default_load_flags() const { return default_load_flags_; } | 96 int default_load_flags() const { return default_load_flags_; } |
| 97 | 97 |
| 98 // Called on main Java thread to initialize URLRequestContext. | 98 // Called on main Java thread to initialize URLRequestContext. |
| 99 void InitRequestContextOnMainThread(); | 99 void InitRequestContextOnMainThread(); |
| 100 | 100 |
| 101 // Enables the network quality estimator. | |
| 102 // TODO(tbansal): http://crbug.com/618034 Remove this API. | |
| 103 void EnableNetworkQualityEstimator( | |
| 104 JNIEnv* env, | |
| 105 const base::android::JavaParamRef<jobject>& jcaller); | |
| 106 | |
| 107 // Configures the network quality estimator to observe localhost requests, and | 101 // Configures the network quality estimator to observe localhost requests, and |
| 108 // to consider smaller responses when observing throughput for testing. This | 102 // to consider smaller responses when observing throughput for testing. This |
| 109 // should be called after the network quality estimator has been enabled. | 103 // should be called after the network quality estimator has been enabled. |
| 110 void ConfigureNetworkQualityEstimatorForTesting( | 104 void ConfigureNetworkQualityEstimatorForTesting( |
| 111 JNIEnv* env, | 105 JNIEnv* env, |
| 112 const base::android::JavaParamRef<jobject>& jcaller, | 106 const base::android::JavaParamRef<jobject>& jcaller, |
| 113 jboolean use_local_host_requests, | 107 jboolean use_local_host_requests, |
| 114 jboolean use_smaller_responses); | 108 jboolean use_smaller_responses); |
| 115 | 109 |
| 116 // Request that RTT and/or throughput observations should or should not be | 110 // Request that RTT and/or throughput observations should or should not be |
| (...skipping 21 matching lines...) Expand all Loading... |
| 138 | 132 |
| 139 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const; | 133 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const; |
| 140 | 134 |
| 141 // Serializes results of certificate verifications of |context_|'s | 135 // Serializes results of certificate verifications of |context_|'s |
| 142 // |cert_verifier| on the Network thread. | 136 // |cert_verifier| on the Network thread. |
| 143 void GetCertVerifierDataOnNetworkThread(); | 137 void GetCertVerifierDataOnNetworkThread(); |
| 144 | 138 |
| 145 // Gets the file thread. Create one if there is none. | 139 // Gets the file thread. Create one if there is none. |
| 146 base::Thread* GetFileThread(); | 140 base::Thread* GetFileThread(); |
| 147 | 141 |
| 148 // Instantiate and configure the network quality estimator. | |
| 149 // TODO(tbansal): http://crbug.com/618034 Remove this API. | |
| 150 void EnableNetworkQualityEstimatorOnNetworkThread(); | |
| 151 | |
| 152 // Configures the network quality estimator to observe requests to localhost, | 142 // Configures the network quality estimator to observe requests to localhost, |
| 153 // as well as to use smaller responses when estimating throughput. This | 143 // as well as to use smaller responses when estimating throughput. This |
| 154 // should only be used for testing. | 144 // should only be used for testing. |
| 155 void ConfigureNetworkQualityEstimatorOnNetworkThreadForTesting( | 145 void ConfigureNetworkQualityEstimatorOnNetworkThreadForTesting( |
| 156 bool use_local_host_requests, | 146 bool use_local_host_requests, |
| 157 bool use_smaller_responses); | 147 bool use_smaller_responses); |
| 158 | 148 |
| 159 void ProvideRTTObservationsOnNetworkThread(bool should); | 149 void ProvideRTTObservationsOnNetworkThread(bool should); |
| 160 void ProvideThroughputObservationsOnNetworkThread(bool should); | 150 void ProvideThroughputObservationsOnNetworkThread(bool should); |
| 161 | 151 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 #if defined(DATA_REDUCTION_PROXY_SUPPORT) | 205 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
| 216 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; | 206 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; |
| 217 #endif | 207 #endif |
| 218 | 208 |
| 219 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 209 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
| 220 }; | 210 }; |
| 221 | 211 |
| 222 } // namespace cronet | 212 } // namespace cronet |
| 223 | 213 |
| 224 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 214 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
| OLD | NEW |