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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 504 |
505 // Stop NetLog observer if there is one. | 505 // Stop NetLog observer if there is one. |
506 StopNetLogOnNetworkThread(); | 506 StopNetLogOnNetworkThread(); |
507 } | 507 } |
508 | 508 |
509 void CronetURLRequestContextAdapter::InitRequestContextOnInitThread( | 509 void CronetURLRequestContextAdapter::InitRequestContextOnInitThread( |
510 JNIEnv* env, | 510 JNIEnv* env, |
511 const JavaParamRef<jobject>& jcaller) { | 511 const JavaParamRef<jobject>& jcaller) { |
512 base::android::ScopedJavaGlobalRef<jobject> jcaller_ref; | 512 base::android::ScopedJavaGlobalRef<jobject> jcaller_ref; |
513 jcaller_ref.Reset(env, jcaller); | 513 jcaller_ref.Reset(env, jcaller); |
514 proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService( | 514 proxy_config_service_ = |
515 GetNetworkTaskRunner(), nullptr /* Ignored on Android */); | 515 net::ProxyService::CreateSystemProxyConfigService(GetNetworkTaskRunner()); |
516 net::ProxyConfigServiceAndroid* android_proxy_config_service = | 516 net::ProxyConfigServiceAndroid* android_proxy_config_service = |
517 static_cast<net::ProxyConfigServiceAndroid*>(proxy_config_service_.get()); | 517 static_cast<net::ProxyConfigServiceAndroid*>(proxy_config_service_.get()); |
518 // If a PAC URL is present, ignore it and use the address and port of | 518 // If a PAC URL is present, ignore it and use the address and port of |
519 // Android system's local HTTP proxy server. See: crbug.com/432539. | 519 // Android system's local HTTP proxy server. See: crbug.com/432539. |
520 // TODO(csharrison) Architect the wrapper better so we don't need to cast for | 520 // TODO(csharrison) Architect the wrapper better so we don't need to cast for |
521 // android ProxyConfigServices. | 521 // android ProxyConfigServices. |
522 android_proxy_config_service->set_exclude_pac_url(true); | 522 android_proxy_config_service->set_exclude_pac_url(true); |
523 g_net_log.Get().EnsureInitializedOnInitThread(); | 523 g_net_log.Get().EnsureInitializedOnInitThread(); |
524 GetNetworkTaskRunner()->PostTask( | 524 GetNetworkTaskRunner()->PostTask( |
525 FROM_HERE, | 525 FROM_HERE, |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 JNIEnv* env, | 1171 JNIEnv* env, |
1172 const JavaParamRef<jclass>& jcaller) { | 1172 const JavaParamRef<jclass>& jcaller) { |
1173 DCHECK(base::StatisticsRecorder::IsActive()); | 1173 DCHECK(base::StatisticsRecorder::IsActive()); |
1174 std::vector<uint8_t> data; | 1174 std::vector<uint8_t> data; |
1175 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1175 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
1176 return ScopedJavaLocalRef<jbyteArray>(); | 1176 return ScopedJavaLocalRef<jbyteArray>(); |
1177 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1177 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
1178 } | 1178 } |
1179 | 1179 |
1180 } // namespace cronet | 1180 } // namespace cronet |
OLD | NEW |