Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Side by Side Diff: components/cronet/android/cronet_url_request_context_adapter.cc

Issue 2593243003: Add network quality change events to net log (Closed)
Patch Set: rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | ios/chrome/browser/ios_chrome_io_thread.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 // Configure network quality estimator: Specify the algorithm that should 696 // Configure network quality estimator: Specify the algorithm that should
697 // be used for computing the effective connection type. The algorithm 697 // be used for computing the effective connection type. The algorithm
698 // is specified using the key-value pairs defined in 698 // is specified using the key-value pairs defined in
699 // //net/nqe/network_quality_estimator.cc. 699 // //net/nqe/network_quality_estimator.cc.
700 // TODO(tbansal): Investigate a more robust way of configuring the network 700 // TODO(tbansal): Investigate a more robust way of configuring the network
701 // quality estimator. 701 // quality estimator.
702 variation_params["effective_connection_type_algorithm"] = 702 variation_params["effective_connection_type_algorithm"] =
703 "TransportRTTOrDownstreamThroughput"; 703 "TransportRTTOrDownstreamThroughput";
704 network_quality_estimator_ = base::MakeUnique<net::NetworkQualityEstimator>( 704 network_quality_estimator_ = base::MakeUnique<net::NetworkQualityEstimator>(
705 std::unique_ptr<net::ExternalEstimateProvider>(), variation_params, 705 std::unique_ptr<net::ExternalEstimateProvider>(), variation_params,
706 false, false); 706 false, false, g_net_log.Get().net_log());
707 // Set the socket performance watcher factory so that network quality 707 // Set the socket performance watcher factory so that network quality
708 // estimator is notified of socket performance metrics from TCP and QUIC. 708 // estimator is notified of socket performance metrics from TCP and QUIC.
709 context_builder.set_socket_performance_watcher_factory( 709 context_builder.set_socket_performance_watcher_factory(
710 network_quality_estimator_->GetSocketPerformanceWatcherFactory()); 710 network_quality_estimator_->GetSocketPerformanceWatcherFactory());
711 network_quality_estimator_->AddEffectiveConnectionTypeObserver(this); 711 network_quality_estimator_->AddEffectiveConnectionTypeObserver(this);
712 network_quality_estimator_->AddRTTAndThroughputEstimatesObserver(this); 712 network_quality_estimator_->AddRTTAndThroughputEstimatesObserver(this);
713 713
714 // Set up network quality prefs if the storage path is specified. 714 // Set up network quality prefs if the storage path is specified.
715 if (!config->storage_path.empty()) { 715 if (!config->storage_path.empty()) {
716 DCHECK(!network_qualities_prefs_manager_); 716 DCHECK(!network_qualities_prefs_manager_);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 JNIEnv* env, 1189 JNIEnv* env,
1190 const JavaParamRef<jclass>& jcaller) { 1190 const JavaParamRef<jclass>& jcaller) {
1191 base::StatisticsRecorder::Initialize(); 1191 base::StatisticsRecorder::Initialize();
1192 std::vector<uint8_t> data; 1192 std::vector<uint8_t> data;
1193 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 1193 if (!HistogramManager::GetInstance()->GetDeltas(&data))
1194 return ScopedJavaLocalRef<jbyteArray>(); 1194 return ScopedJavaLocalRef<jbyteArray>();
1195 return base::android::ToJavaByteArray(env, &data[0], data.size()); 1195 return base::android::ToJavaByteArray(env, &data[0], data.size());
1196 } 1196 }
1197 1197
1198 } // namespace cronet 1198 } // namespace cronet
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | ios/chrome/browser/ios_chrome_io_thread.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698