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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "net/base/url_util.h" | 54 #include "net/base/url_util.h" |
55 #include "net/cert/caching_cert_verifier.h" | 55 #include "net/cert/caching_cert_verifier.h" |
56 #include "net/cert/cert_verifier.h" | 56 #include "net/cert/cert_verifier.h" |
57 #include "net/cookies/cookie_monster.h" | 57 #include "net/cookies/cookie_monster.h" |
58 #include "net/http/http_auth_handler_factory.h" | 58 #include "net/http/http_auth_handler_factory.h" |
59 #include "net/http/http_server_properties_manager.h" | 59 #include "net/http/http_server_properties_manager.h" |
60 #include "net/log/file_net_log_observer.h" | 60 #include "net/log/file_net_log_observer.h" |
61 #include "net/log/net_log_util.h" | 61 #include "net/log/net_log_util.h" |
62 #include "net/nqe/external_estimate_provider.h" | 62 #include "net/nqe/external_estimate_provider.h" |
63 #include "net/nqe/network_qualities_prefs_manager.h" | 63 #include "net/nqe/network_qualities_prefs_manager.h" |
| 64 #include "net/nqe/network_quality_estimator_params.h" |
64 #include "net/proxy/proxy_config_service_android.h" | 65 #include "net/proxy/proxy_config_service_android.h" |
65 #include "net/proxy/proxy_service.h" | 66 #include "net/proxy/proxy_service.h" |
66 #include "net/sdch/sdch_owner.h" | 67 #include "net/sdch/sdch_owner.h" |
67 #include "net/ssl/channel_id_service.h" | 68 #include "net/ssl/channel_id_service.h" |
68 #include "net/url_request/url_request_context.h" | 69 #include "net/url_request/url_request_context.h" |
69 #include "net/url_request/url_request_context_builder.h" | 70 #include "net/url_request/url_request_context_builder.h" |
70 #include "net/url_request/url_request_interceptor.h" | 71 #include "net/url_request/url_request_interceptor.h" |
71 | 72 |
72 using base::android::JavaParamRef; | 73 using base::android::JavaParamRef; |
73 using base::android::ScopedJavaLocalRef; | 74 using base::android::ScopedJavaLocalRef; |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 std::map<std::string, std::string> variation_params; | 679 std::map<std::string, std::string> variation_params; |
679 // Configure network quality estimator: Specify the algorithm that should | 680 // Configure network quality estimator: Specify the algorithm that should |
680 // be used for computing the effective connection type. The algorithm | 681 // be used for computing the effective connection type. The algorithm |
681 // is specified using the key-value pairs defined in | 682 // is specified using the key-value pairs defined in |
682 // //net/nqe/network_quality_estimator.cc. | 683 // //net/nqe/network_quality_estimator.cc. |
683 // TODO(tbansal): Investigate a more robust way of configuring the network | 684 // TODO(tbansal): Investigate a more robust way of configuring the network |
684 // quality estimator. | 685 // quality estimator. |
685 variation_params["effective_connection_type_algorithm"] = | 686 variation_params["effective_connection_type_algorithm"] = |
686 "TransportRTTOrDownstreamThroughput"; | 687 "TransportRTTOrDownstreamThroughput"; |
687 network_quality_estimator_ = base::MakeUnique<net::NetworkQualityEstimator>( | 688 network_quality_estimator_ = base::MakeUnique<net::NetworkQualityEstimator>( |
688 std::unique_ptr<net::ExternalEstimateProvider>(), variation_params, | 689 std::unique_ptr<net::ExternalEstimateProvider>(), |
689 false, false, g_net_log.Get().net_log()); | 690 base::MakeUnique<net::NetworkQualityEstimatorParams>(variation_params), |
| 691 g_net_log.Get().net_log()); |
690 // Set the socket performance watcher factory so that network quality | 692 // Set the socket performance watcher factory so that network quality |
691 // estimator is notified of socket performance metrics from TCP and QUIC. | 693 // estimator is notified of socket performance metrics from TCP and QUIC. |
692 context_builder.set_socket_performance_watcher_factory( | 694 context_builder.set_socket_performance_watcher_factory( |
693 network_quality_estimator_->GetSocketPerformanceWatcherFactory()); | 695 network_quality_estimator_->GetSocketPerformanceWatcherFactory()); |
694 network_quality_estimator_->AddEffectiveConnectionTypeObserver(this); | 696 network_quality_estimator_->AddEffectiveConnectionTypeObserver(this); |
695 network_quality_estimator_->AddRTTAndThroughputEstimatesObserver(this); | 697 network_quality_estimator_->AddRTTAndThroughputEstimatesObserver(this); |
696 | 698 |
697 // Set up network quality prefs if the storage path is specified. | 699 // Set up network quality prefs if the storage path is specified. |
698 if (!config->storage_path.empty()) { | 700 if (!config->storage_path.empty()) { |
699 DCHECK(!network_qualities_prefs_manager_); | 701 DCHECK(!network_qualities_prefs_manager_); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 JNIEnv* env, | 1176 JNIEnv* env, |
1175 const JavaParamRef<jclass>& jcaller) { | 1177 const JavaParamRef<jclass>& jcaller) { |
1176 DCHECK(base::StatisticsRecorder::IsActive()); | 1178 DCHECK(base::StatisticsRecorder::IsActive()); |
1177 std::vector<uint8_t> data; | 1179 std::vector<uint8_t> data; |
1178 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1180 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
1179 return ScopedJavaLocalRef<jbyteArray>(); | 1181 return ScopedJavaLocalRef<jbyteArray>(); |
1180 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1182 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
1181 } | 1183 } |
1182 | 1184 |
1183 } // namespace cronet | 1185 } // namespace cronet |
OLD | NEW |