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

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

Issue 794493002: Add UMA Histogram Manager to Cronet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors Created 6 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/cronet/android/histogram_manager.h"
6
7 #include <string>
8 #include <vector>
9
10 #include "base/android/jni_array.h"
11 #include "components/metrics/histogram_manager.h"
12
13 #include "jni/HistogramManager_jni.h"
14
15 namespace cronet {
16
17 // Explicitly register static JNI functions.
18 bool HistogramManagerRegisterJni(JNIEnv* env) {
19 return RegisterNativesImpl(env);
20 }
21
22 static jbyteArray GetHistogramDeltas(JNIEnv* env, jobject jcaller) {
23 std::vector<uint8> data =
24 metrics::HistogramManager::GetInstance()->GetDeltas();
mef 2014/12/11 23:11:40 qq: how big are deltas? Would this result in extra
ramant (doing other things) 2014/12/12 02:43:05 Do we do return value optimization on Android? A
25 if (!data.empty()) {
26 return base::android::ToJavaByteArray(env, &data[0], data.size()).Release();
mef 2014/12/11 23:11:40 nit: no need for curly braces.
ramant (doing other things) 2014/12/12 02:43:05 Done.
27 }
28 return NULL;
29 }
30
31 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698