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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 net::ProxyConfigServiceAndroid* android_proxy_config_service = | 164 net::ProxyConfigServiceAndroid* android_proxy_config_service = |
165 static_cast<net::ProxyConfigServiceAndroid*>(proxy_config_service_.get()); | 165 static_cast<net::ProxyConfigServiceAndroid*>(proxy_config_service_.get()); |
166 // If a PAC URL is present, ignore it and use the address and port of | 166 // If a PAC URL is present, ignore it and use the address and port of |
167 // Android system's local HTTP proxy server. See: crbug.com/432539. | 167 // Android system's local HTTP proxy server. See: crbug.com/432539. |
168 // TODO(csharrison) Architect the wrapper better so we don't need to cast for | 168 // TODO(csharrison) Architect the wrapper better so we don't need to cast for |
169 // android ProxyConfigServices. | 169 // android ProxyConfigServices. |
170 android_proxy_config_service->set_exclude_pac_url(true); | 170 android_proxy_config_service->set_exclude_pac_url(true); |
171 GetNetworkTaskRunner()->PostTask( | 171 GetNetworkTaskRunner()->PostTask( |
172 FROM_HERE, | 172 FROM_HERE, |
173 base::Bind(&CronetURLRequestContextAdapter::InitializeOnNetworkThread, | 173 base::Bind(&CronetURLRequestContextAdapter::InitializeOnNetworkThread, |
174 base::Unretained(this), Passed(&context_config_), | 174 base::Unretained(this), base::Passed(&context_config_), |
175 jcaller_ref)); | 175 jcaller_ref)); |
176 } | 176 } |
177 | 177 |
178 void CronetURLRequestContextAdapter:: | 178 void CronetURLRequestContextAdapter:: |
179 EnableNetworkQualityEstimatorOnNetworkThread(bool use_local_host_requests, | 179 EnableNetworkQualityEstimatorOnNetworkThread(bool use_local_host_requests, |
180 bool use_smaller_responses) { | 180 bool use_smaller_responses) { |
181 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); | 181 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); |
182 DCHECK(!network_quality_estimator_); | 182 DCHECK(!network_quality_estimator_); |
183 network_quality_estimator_.reset(new net::NetworkQualityEstimator( | 183 network_quality_estimator_.reset(new net::NetworkQualityEstimator( |
184 scoped_ptr<net::ExternalEstimateProvider>(), | 184 scoped_ptr<net::ExternalEstimateProvider>(), |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 JNIEnv* env, | 545 JNIEnv* env, |
546 const JavaParamRef<jclass>& jcaller) { | 546 const JavaParamRef<jclass>& jcaller) { |
547 base::StatisticsRecorder::Initialize(); | 547 base::StatisticsRecorder::Initialize(); |
548 std::vector<uint8> data; | 548 std::vector<uint8> data; |
549 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 549 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
550 return ScopedJavaLocalRef<jbyteArray>(); | 550 return ScopedJavaLocalRef<jbyteArray>(); |
551 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 551 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
552 } | 552 } |
553 | 553 |
554 } // namespace cronet | 554 } // namespace cronet |
OLD | NEW |