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

Side by Side Diff: webrtc/api/android/jni/androidhistogram_jni.cc

Issue 2516403002: Revert of Allow custom metrics implementations on Android. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « webrtc/api/android/jni/OWNERS ('k') | webrtc/api/android/jni/androidmetrics_jni.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include <map>
12 #include <memory>
13
14 #include "webrtc/api/android/jni/classreferenceholder.h"
15 #include "webrtc/api/android/jni/jni_helpers.h"
16 #include "webrtc/api/android/jni/native_handle_impl.h"
17 #include "webrtc/system_wrappers/include/metrics.h"
18
19 // Enables collection of native histograms and creating them.
20 namespace webrtc_jni {
21
22 JOW(jlong, Histogram_nativeCreateCounts)
23 (JNIEnv* jni, jclass, jstring j_name, jint min, jint max, jint buckets) {
24 std::string name = JavaToStdString(jni, j_name);
25 return jlongFromPointer(
26 webrtc::metrics::HistogramFactoryGetCounts(name, min, max, buckets));
27 }
28
29 JOW(jlong, Histogram_nativeCreateEnumeration)
30 (JNIEnv* jni, jclass, jstring j_name, jint max) {
31 std::string name = JavaToStdString(jni, j_name);
32 return jlongFromPointer(
33 webrtc::metrics::HistogramFactoryGetEnumeration(name, max));
34 }
35
36 JOW(void, Histogram_nativeAddSample)
37 (JNIEnv* jni, jclass, jlong histogram, jint sample) {
38 if (histogram) {
39 HistogramAdd(reinterpret_cast<webrtc::metrics::Histogram*>(histogram),
40 sample);
41 }
42 }
43
44 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « webrtc/api/android/jni/OWNERS ('k') | webrtc/api/android/jni/androidmetrics_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698