| 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 json_pref_store_ = | 662 json_pref_store_ = |
| 663 new JsonPrefStore(filepath, GetFileThread()->task_runner(), | 663 new JsonPrefStore(filepath, GetFileThread()->task_runner(), |
| 664 std::unique_ptr<PrefFilter>()); | 664 std::unique_ptr<PrefFilter>()); |
| 665 context_builder.SetFileTaskRunner(GetFileThread()->task_runner()); | 665 context_builder.SetFileTaskRunner(GetFileThread()->task_runner()); |
| 666 | 666 |
| 667 // Set up HttpServerPropertiesManager. | 667 // Set up HttpServerPropertiesManager. |
| 668 PrefServiceFactory factory; | 668 PrefServiceFactory factory; |
| 669 factory.set_user_prefs(json_pref_store_); | 669 factory.set_user_prefs(json_pref_store_); |
| 670 scoped_refptr<PrefRegistrySimple> registry(new PrefRegistrySimple()); | 670 scoped_refptr<PrefRegistrySimple> registry(new PrefRegistrySimple()); |
| 671 registry->RegisterDictionaryPref(kHttpServerProperties, | 671 registry->RegisterDictionaryPref(kHttpServerProperties, |
| 672 new base::DictionaryValue()); | 672 base::MakeUnique<base::DictionaryValue>()); |
| 673 if (config->enable_network_quality_estimator) { | 673 if (config->enable_network_quality_estimator) { |
| 674 // Use lossy prefs to limit the overhead of reading/writing the prefs. | 674 // Use lossy prefs to limit the overhead of reading/writing the prefs. |
| 675 registry->RegisterDictionaryPref(kNetworkQualities, | 675 registry->RegisterDictionaryPref(kNetworkQualities, |
| 676 PrefRegistry::LOSSY_PREF); | 676 PrefRegistry::LOSSY_PREF); |
| 677 } | 677 } |
| 678 pref_service_ = factory.Create(registry.get()); | 678 pref_service_ = factory.Create(registry.get()); |
| 679 | 679 |
| 680 std::unique_ptr<net::HttpServerPropertiesManager> | 680 std::unique_ptr<net::HttpServerPropertiesManager> |
| 681 http_server_properties_manager(new net::HttpServerPropertiesManager( | 681 http_server_properties_manager(new net::HttpServerPropertiesManager( |
| 682 new PrefServiceAdapter(pref_service_.get()), | 682 new PrefServiceAdapter(pref_service_.get()), |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 JNIEnv* env, | 1208 JNIEnv* env, |
| 1209 const JavaParamRef<jclass>& jcaller) { | 1209 const JavaParamRef<jclass>& jcaller) { |
| 1210 base::StatisticsRecorder::Initialize(); | 1210 base::StatisticsRecorder::Initialize(); |
| 1211 std::vector<uint8_t> data; | 1211 std::vector<uint8_t> data; |
| 1212 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1212 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
| 1213 return ScopedJavaLocalRef<jbyteArray>(); | 1213 return ScopedJavaLocalRef<jbyteArray>(); |
| 1214 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1214 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 } // namespace cronet | 1217 } // namespace cronet |
| OLD | NEW |