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

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

Issue 1075503002: Move histogram_manager from components/metrics to components/cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Raman's comments Created 5 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/DEPS ('k') | components/cronet/cronet_static.gypi » ('j') | 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_histogram_manager.h" 5 #include "components/cronet/android/cronet_histogram_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
11 #include "base/metrics/statistics_recorder.h" 11 #include "base/metrics/statistics_recorder.h"
12 #include "components/metrics/histogram_manager.h" 12 #include "components/cronet/histogram_manager.h"
13 13
14 #include "jni/CronetHistogramManager_jni.h" 14 #include "jni/CronetHistogramManager_jni.h"
15 15
16 namespace cronet { 16 namespace cronet {
17 17
18 // Explicitly register static JNI functions. 18 // Explicitly register static JNI functions.
19 bool CronetHistogramManagerRegisterJni(JNIEnv* env) { 19 bool CronetHistogramManagerRegisterJni(JNIEnv* env) {
20 return RegisterNativesImpl(env); 20 return RegisterNativesImpl(env);
21 } 21 }
22 22
23 static void EnsureInitialized(JNIEnv* env, jobject jcaller) { 23 static void EnsureInitialized(JNIEnv* env, jobject jcaller) {
24 base::StatisticsRecorder::Initialize(); 24 base::StatisticsRecorder::Initialize();
25 } 25 }
26 26
27 static jbyteArray GetHistogramDeltas(JNIEnv* env, jobject jcaller) { 27 static jbyteArray GetHistogramDeltas(JNIEnv* env, jobject jcaller) {
28 std::vector<uint8> data; 28 std::vector<uint8> data;
29 if (!metrics::HistogramManager::GetInstance()->GetDeltas(&data)) 29 if (!HistogramManager::GetInstance()->GetDeltas(&data))
30 return NULL; 30 return NULL;
31 return base::android::ToJavaByteArray(env, &data[0], data.size()).Release(); 31 return base::android::ToJavaByteArray(env, &data[0], data.size()).Release();
32 } 32 }
33 33
34 } // namespace cronet 34 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/DEPS ('k') | components/cronet/cronet_static.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698