| 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 #include "components/cronet/android/cronet_url_request_context_adapter.h" | 5 #include "components/cronet/android/cronet_url_request_context_adapter.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 // Configure network quality estimator: Specify the algorithm that should | 617 // Configure network quality estimator: Specify the algorithm that should |
| 618 // be used for computing the effective connection type. The algorithm | 618 // be used for computing the effective connection type. The algorithm |
| 619 // is specified using the key-value pairs defined in | 619 // is specified using the key-value pairs defined in |
| 620 // //net/nqe/network_quality_estimator.cc. | 620 // //net/nqe/network_quality_estimator.cc. |
| 621 // TODO(tbansal): Investigate a more robust way of configuring the network | 621 // TODO(tbansal): Investigate a more robust way of configuring the network |
| 622 // quality estimator. | 622 // quality estimator. |
| 623 variation_params["effective_connection_type_algorithm"] = | 623 variation_params["effective_connection_type_algorithm"] = |
| 624 "TransportRTTOrDownstreamThroughput"; | 624 "TransportRTTOrDownstreamThroughput"; |
| 625 network_quality_estimator_.reset(new net::NetworkQualityEstimator( | 625 network_quality_estimator_.reset(new net::NetworkQualityEstimator( |
| 626 std::unique_ptr<net::ExternalEstimateProvider>(), variation_params, | 626 std::unique_ptr<net::ExternalEstimateProvider>(), variation_params, |
| 627 false, false)); | 627 false, false, g_net_log.Get().net_log())); |
| 628 // Set the socket performance watcher factory so that network quality | 628 // Set the socket performance watcher factory so that network quality |
| 629 // estimator is notified of socket performance metrics from TCP and QUIC. | 629 // estimator is notified of socket performance metrics from TCP and QUIC. |
| 630 context_builder.set_socket_performance_watcher_factory( | 630 context_builder.set_socket_performance_watcher_factory( |
| 631 network_quality_estimator_->GetSocketPerformanceWatcherFactory()); | 631 network_quality_estimator_->GetSocketPerformanceWatcherFactory()); |
| 632 network_quality_estimator_->AddEffectiveConnectionTypeObserver(this); | 632 network_quality_estimator_->AddEffectiveConnectionTypeObserver(this); |
| 633 network_quality_estimator_->AddRTTAndThroughputEstimatesObserver(this); | 633 network_quality_estimator_->AddRTTAndThroughputEstimatesObserver(this); |
| 634 } | 634 } |
| 635 | 635 |
| 636 context_ = context_builder.Build(); | 636 context_ = context_builder.Build(); |
| 637 | 637 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 JNIEnv* env, | 1099 JNIEnv* env, |
| 1100 const JavaParamRef<jclass>& jcaller) { | 1100 const JavaParamRef<jclass>& jcaller) { |
| 1101 base::StatisticsRecorder::Initialize(); | 1101 base::StatisticsRecorder::Initialize(); |
| 1102 std::vector<uint8_t> data; | 1102 std::vector<uint8_t> data; |
| 1103 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1103 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
| 1104 return ScopedJavaLocalRef<jbyteArray>(); | 1104 return ScopedJavaLocalRef<jbyteArray>(); |
| 1105 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1105 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 } // namespace cronet | 1108 } // namespace cronet |
| OLD | NEW |