Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 23 #include "base/files/file_path.h" | 23 #include "base/files/file_path.h" |
| 24 #include "base/files/file_util.h" | 24 #include "base/files/file_util.h" |
| 25 #include "base/files/scoped_file.h" | 25 #include "base/files/scoped_file.h" |
| 26 #include "base/lazy_instance.h" | 26 #include "base/lazy_instance.h" |
| 27 #include "base/logging.h" | 27 #include "base/logging.h" |
| 28 #include "base/macros.h" | 28 #include "base/macros.h" |
| 29 #include "base/memory/ptr_util.h" | 29 #include "base/memory/ptr_util.h" |
| 30 #include "base/memory/scoped_vector.h" | 30 #include "base/memory/scoped_vector.h" |
| 31 #include "base/message_loop/message_loop.h" | 31 #include "base/message_loop/message_loop.h" |
| 32 #include "base/metrics/histogram_macros.h" | 32 #include "base/metrics/histogram_macros.h" |
| 33 #include "base/metrics/statistics_recorder.h" | |
| 34 #include "base/single_thread_task_runner.h" | 33 #include "base/single_thread_task_runner.h" |
| 35 #include "base/threading/thread_task_runner_handle.h" | 34 #include "base/threading/thread_task_runner_handle.h" |
| 36 #include "base/time/time.h" | 35 #include "base/time/time.h" |
| 37 #include "base/values.h" | 36 #include "base/values.h" |
| 38 #include "components/cronet/android/cert/cert_verifier_cache_serializer.h" | 37 #include "components/cronet/android/cert/cert_verifier_cache_serializer.h" |
| 39 #include "components/cronet/android/cert/proto/cert_verification.pb.h" | 38 #include "components/cronet/android/cert/proto/cert_verification.pb.h" |
| 40 #include "components/cronet/histogram_manager.h" | 39 #include "components/cronet/histogram_manager.h" |
| 41 #include "components/cronet/url_request_context_config.h" | 40 #include "components/cronet/url_request_context_config.h" |
| 42 #include "components/prefs/pref_change_registrar.h" | 41 #include "components/prefs/pref_change_registrar.h" |
| 43 #include "components/prefs/pref_filter.h" | 42 #include "components/prefs/pref_filter.h" |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1200 jint jlog_level) { | 1199 jint jlog_level) { |
| 1201 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); | 1200 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); |
| 1202 // MinLogLevel is global, shared by all URLRequestContexts. | 1201 // MinLogLevel is global, shared by all URLRequestContexts. |
| 1203 logging::SetMinLogLevel(static_cast<int>(jlog_level)); | 1202 logging::SetMinLogLevel(static_cast<int>(jlog_level)); |
| 1204 return old_log_level; | 1203 return old_log_level; |
| 1205 } | 1204 } |
| 1206 | 1205 |
| 1207 static ScopedJavaLocalRef<jbyteArray> GetHistogramDeltas( | 1206 static ScopedJavaLocalRef<jbyteArray> GetHistogramDeltas( |
| 1208 JNIEnv* env, | 1207 JNIEnv* env, |
| 1209 const JavaParamRef<jclass>& jcaller) { | 1208 const JavaParamRef<jclass>& jcaller) { |
| 1210 base::StatisticsRecorder::Initialize(); | |
| 1211 std::vector<uint8_t> data; | 1209 std::vector<uint8_t> data; |
|
pauljensen
2017/04/04 19:11:12
Perhaps add DCHECK(base::StatisticsRecorder::IsAct
xunjieli
2017/04/04 19:39:57
Done.
| |
| 1212 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1210 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
| 1213 return ScopedJavaLocalRef<jbyteArray>(); | 1211 return ScopedJavaLocalRef<jbyteArray>(); |
| 1214 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1212 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
| 1215 } | 1213 } |
| 1216 | 1214 |
| 1217 } // namespace cronet | 1215 } // namespace cronet |
| OLD | NEW |