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

Unified Diff: components/cronet/android/histogram_manager.cc

Issue 890893006: [Cronet] HistogramManager now ensures that StatisticsRecorder is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/HistogramManager.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/histogram_manager.cc
diff --git a/components/cronet/android/histogram_manager.cc b/components/cronet/android/histogram_manager.cc
index 5ad7bb8f4b863415a3d6adc0c12478ea3434ed93..4db69601387a2bfd5cbe18fefeef01c5b544bb98 100644
--- a/components/cronet/android/histogram_manager.cc
+++ b/components/cronet/android/histogram_manager.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/android/jni_array.h"
+#include "base/metrics/statistics_recorder.h"
#include "components/metrics/histogram_manager.h"
#include "jni/HistogramManager_jni.h"
@@ -19,6 +20,10 @@ bool HistogramManagerRegisterJni(JNIEnv* env) {
return RegisterNativesImpl(env);
}
+static void EnsureInitialized(JNIEnv* env, jobject jcaller) {
+ base::StatisticsRecorder::Initialize();
+}
+
static jbyteArray GetHistogramDeltas(JNIEnv* env, jobject jcaller) {
std::vector<uint8> data;
if (!metrics::HistogramManager::GetInstance()->GetDeltas(&data))
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/HistogramManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698