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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 #endif // defined(DATA_REDUCTION_PROXY_SUPPORT) | 283 #endif // defined(DATA_REDUCTION_PROXY_SUPPORT) |
284 context_builder.set_network_delegate(network_delegate.Pass()); | 284 context_builder.set_network_delegate(network_delegate.Pass()); |
285 context_builder.set_net_log(net_log_.get()); | 285 context_builder.set_net_log(net_log_.get()); |
286 | 286 |
287 // Android provides a local HTTP proxy server that handles proxying when a PAC | 287 // Android provides a local HTTP proxy server that handles proxying when a PAC |
288 // URL is present. Create a proxy service without a resolver and rely on this | 288 // URL is present. Create a proxy service without a resolver and rely on this |
289 // local HTTP proxy. See: crbug.com/432539. | 289 // local HTTP proxy. See: crbug.com/432539. |
290 context_builder.set_proxy_service( | 290 context_builder.set_proxy_service( |
291 net::ProxyService::CreateWithoutProxyResolver( | 291 net::ProxyService::CreateWithoutProxyResolver( |
292 proxy_config_service_.Pass(), net_log_.get())); | 292 proxy_config_service_.Pass(), net_log_.get())); |
293 config->ConfigureURLRequestContextBuilder(&context_builder); | 293 config->ConfigureURLRequestContextBuilder(&context_builder, net_log_.get()); |
294 | 294 |
295 // Set up pref file if storage path is specified. | 295 // Set up pref file if storage path is specified. |
296 if (!config->storage_path.empty()) { | 296 if (!config->storage_path.empty()) { |
297 base::FilePath filepath(config->storage_path); | 297 base::FilePath filepath(config->storage_path); |
298 filepath = filepath.Append(FILE_PATH_LITERAL("local_prefs.json")); | 298 filepath = filepath.Append(FILE_PATH_LITERAL("local_prefs.json")); |
299 json_pref_store_ = new JsonPrefStore( | 299 json_pref_store_ = new JsonPrefStore( |
300 filepath, GetFileThread()->task_runner(), scoped_ptr<PrefFilter>()); | 300 filepath, GetFileThread()->task_runner(), scoped_ptr<PrefFilter>()); |
301 context_builder.SetFileTaskRunner(GetFileThread()->task_runner()); | 301 context_builder.SetFileTaskRunner(GetFileThread()->task_runner()); |
302 | 302 |
303 // Set up HttpServerPropertiesManager. | 303 // Set up HttpServerPropertiesManager. |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 JNIEnv* env, | 654 JNIEnv* env, |
655 const JavaParamRef<jclass>& jcaller) { | 655 const JavaParamRef<jclass>& jcaller) { |
656 base::StatisticsRecorder::Initialize(); | 656 base::StatisticsRecorder::Initialize(); |
657 std::vector<uint8> data; | 657 std::vector<uint8> data; |
658 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 658 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
659 return ScopedJavaLocalRef<jbyteArray>(); | 659 return ScopedJavaLocalRef<jbyteArray>(); |
660 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 660 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
661 } | 661 } |
662 | 662 |
663 } // namespace cronet | 663 } // namespace cronet |
OLD | NEW |