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

Side by Side Diff: base/android/animation_frame_time_histogram.cc

Issue 2209993003: Add missing using statements for JNI types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/android/animation_frame_time_histogram.h" 5 #include "base/android/animation_frame_time_histogram.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "jni/AnimationFrameTimeHistogram_jni.h" 9 #include "jni/AnimationFrameTimeHistogram_jni.h"
10 10
11 using base::android::JavaParamRef;
12
11 // static 13 // static
12 void SaveHistogram(JNIEnv* env, 14 void SaveHistogram(JNIEnv* env,
13 const JavaParamRef<jobject>& jcaller, 15 const JavaParamRef<jobject>& jcaller,
14 const JavaParamRef<jstring>& j_histogram_name, 16 const JavaParamRef<jstring>& j_histogram_name,
15 const JavaParamRef<jlongArray>& j_frame_times_ms, 17 const JavaParamRef<jlongArray>& j_frame_times_ms,
16 jint j_count) { 18 jint j_count) {
17 jlong *frame_times_ms = env->GetLongArrayElements(j_frame_times_ms, NULL); 19 jlong *frame_times_ms = env->GetLongArrayElements(j_frame_times_ms, NULL);
18 std::string histogram_name = base::android::ConvertJavaStringToUTF8( 20 std::string histogram_name = base::android::ConvertJavaStringToUTF8(
19 env, j_histogram_name); 21 env, j_histogram_name);
20 22
21 for (int i = 0; i < j_count; ++i) { 23 for (int i = 0; i < j_count; ++i) {
22 UMA_HISTOGRAM_TIMES(histogram_name.c_str(), 24 UMA_HISTOGRAM_TIMES(histogram_name.c_str(),
23 base::TimeDelta::FromMilliseconds(frame_times_ms[i])); 25 base::TimeDelta::FromMilliseconds(frame_times_ms[i]));
24 } 26 }
25 } 27 }
26 28
27 namespace base { 29 namespace base {
28 namespace android { 30 namespace android {
29 31
30 // static 32 // static
31 bool RegisterAnimationFrameTimeHistogram(JNIEnv* env) { 33 bool RegisterAnimationFrameTimeHistogram(JNIEnv* env) {
32 return RegisterNativesImpl(env); 34 return RegisterNativesImpl(env);
33 } 35 }
34 36
35 } // namespace android 37 } // namespace android
36 } // namespace base 38 } // namespace base
OLDNEW
« no previous file with comments | « android_webview/native/token_binding_manager_bridge.cc ('k') | base/android/command_line_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698