| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class CronetDataReductionProxy; | 45 class CronetDataReductionProxy; |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 struct URLRequestContextConfig; | 48 struct URLRequestContextConfig; |
| 49 | 49 |
| 50 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); | 50 bool CronetUrlRequestContextAdapterRegisterJni(JNIEnv* env); |
| 51 | 51 |
| 52 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. | 52 // Adapter between Java CronetUrlRequestContext and net::URLRequestContext. |
| 53 class CronetURLRequestContextAdapter | 53 class CronetURLRequestContextAdapter |
| 54 : public net::NetworkQualityEstimator::EffectiveConnectionTypeObserver, | 54 : public net::NetworkQualityEstimator::EffectiveConnectionTypeObserver, |
| 55 public net::NetworkQualityEstimator::RTTAndThroughputEstimatesObserver, | |
| 56 public net::NetworkQualityEstimator::RTTObserver, | 55 public net::NetworkQualityEstimator::RTTObserver, |
| 57 public net::NetworkQualityEstimator::ThroughputObserver { | 56 public net::NetworkQualityEstimator::ThroughputObserver { |
| 58 public: | 57 public: |
| 59 explicit CronetURLRequestContextAdapter( | 58 explicit CronetURLRequestContextAdapter( |
| 60 std::unique_ptr<URLRequestContextConfig> context_config); | 59 std::unique_ptr<URLRequestContextConfig> context_config); |
| 61 | 60 |
| 62 ~CronetURLRequestContextAdapter() override; | 61 ~CronetURLRequestContextAdapter() override; |
| 63 | 62 |
| 64 // Called on main Java thread to initialize URLRequestContext. | 63 // Called on main Java thread to initialize URLRequestContext. |
| 65 void InitRequestContextOnMainThread( | 64 void InitRequestContextOnMainThread( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 bool use_smaller_responses); | 159 bool use_smaller_responses); |
| 161 | 160 |
| 162 void ProvideRTTObservationsOnNetworkThread(bool should); | 161 void ProvideRTTObservationsOnNetworkThread(bool should); |
| 163 void ProvideThroughputObservationsOnNetworkThread(bool should); | 162 void ProvideThroughputObservationsOnNetworkThread(bool should); |
| 164 | 163 |
| 165 // net::NetworkQualityEstimator::EffectiveConnectionTypeObserver | 164 // net::NetworkQualityEstimator::EffectiveConnectionTypeObserver |
| 166 // implementation. | 165 // implementation. |
| 167 void OnEffectiveConnectionTypeChanged( | 166 void OnEffectiveConnectionTypeChanged( |
| 168 net::EffectiveConnectionType effective_connection_type) override; | 167 net::EffectiveConnectionType effective_connection_type) override; |
| 169 | 168 |
| 170 // net::NetworkQualityEstimator::RTTAndThroughputEstimatesObserver | |
| 171 // implementation. | |
| 172 void OnRTTOrThroughputEstimatesComputed( | |
| 173 base::TimeDelta http_rtt, | |
| 174 base::TimeDelta transport_rtt, | |
| 175 int32_t downstream_throughput_kbps) override; | |
| 176 | |
| 177 // net::NetworkQualityEstimator::RTTObserver implementation. | 169 // net::NetworkQualityEstimator::RTTObserver implementation. |
| 178 void OnRTTObservation(int32_t rtt_ms, | 170 void OnRTTObservation(int32_t rtt_ms, |
| 179 const base::TimeTicks& timestamp, | 171 const base::TimeTicks& timestamp, |
| 180 net::NetworkQualityObservationSource source) override; | 172 net::NetworkQualityObservationSource source) override; |
| 181 | 173 |
| 182 // net::NetworkQualityEstimator::ThroughputObserver implementation. | 174 // net::NetworkQualityEstimator::ThroughputObserver implementation. |
| 183 void OnThroughputObservation( | 175 void OnThroughputObservation( |
| 184 int32_t throughput_kbps, | 176 int32_t throughput_kbps, |
| 185 const base::TimeTicks& timestamp, | 177 const base::TimeTicks& timestamp, |
| 186 net::NetworkQualityObservationSource source) override; | 178 net::NetworkQualityObservationSource source) override; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 #if defined(DATA_REDUCTION_PROXY_SUPPORT) | 237 #if defined(DATA_REDUCTION_PROXY_SUPPORT) |
| 246 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; | 238 std::unique_ptr<CronetDataReductionProxy> data_reduction_proxy_; |
| 247 #endif | 239 #endif |
| 248 | 240 |
| 249 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); | 241 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestContextAdapter); |
| 250 }; | 242 }; |
| 251 | 243 |
| 252 } // namespace cronet | 244 } // namespace cronet |
| 253 | 245 |
| 254 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ | 246 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_CONTEXT_ADAPTER_H_ |
| OLD | NEW |