Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: components/cronet/android/cronet_url_request_context_adapter.cc

Issue 2790063004: [Cronet] Initialize StatisticsRecorder early (Closed)
Patch Set: Address pauljensen comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/cronet/android/cronet_library_loader.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 jint jlog_level) { 1200 jint jlog_level) {
1201 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); 1201 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel());
1202 // MinLogLevel is global, shared by all URLRequestContexts. 1202 // MinLogLevel is global, shared by all URLRequestContexts.
1203 logging::SetMinLogLevel(static_cast<int>(jlog_level)); 1203 logging::SetMinLogLevel(static_cast<int>(jlog_level));
1204 return old_log_level; 1204 return old_log_level;
1205 } 1205 }
1206 1206
1207 static ScopedJavaLocalRef<jbyteArray> GetHistogramDeltas( 1207 static ScopedJavaLocalRef<jbyteArray> GetHistogramDeltas(
1208 JNIEnv* env, 1208 JNIEnv* env,
1209 const JavaParamRef<jclass>& jcaller) { 1209 const JavaParamRef<jclass>& jcaller) {
1210 base::StatisticsRecorder::Initialize(); 1210 DCHECK(base::StatisticsRecorder::IsActive());
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
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_library_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698