Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/android/animation_frame_time_histogram.h" | |
| 6 | |
| 7 #include "base/android/jni_string.h" | |
| 8 #include "base/metrics/histogram_macros.h" | |
| 9 #include "jni/AnimationFrameTimeHistogram_jni.h" | |
| 10 | |
| 11 // static | |
| 12 void SaveHistogram(JNIEnv* env, | |
| 13 jobject jcaller, | |
| 14 jstring j_histogram_name, | |
| 15 jlongArray j_frame_times_ms, | |
| 16 jint j_count) { | |
| 17 jlong *frame_times_ns = env->GetLongArrayElements(j_frame_times_ms, NULL); | |
| 18 std::string histogram_name = base::android::ConvertJavaStringToUTF8( | |
| 19 env, j_histogram_name); | |
| 20 | |
| 21 for (int i = 0; i < j_count; ++i) { | |
|
nyquist
2015/02/27 04:02:19
size_t?
Kibeom Kim (inactive)
2015/02/27 19:56:40
Currently j_count is jint type so I'm getting "com
| |
| 22 UMA_HISTOGRAM_TIMES(histogram_name.c_str(), | |
| 23 base::TimeDelta::FromMilliseconds(frame_times_ns[i])); | |
| 24 } | |
| 25 } | |
| 26 | |
| 27 namespace base { | |
| 28 namespace android { | |
| 29 | |
| 30 // static | |
| 31 bool RegisterAnimationFrameTimeHistogram(JNIEnv* env) { | |
| 32 return RegisterNativesImpl(env); | |
| 33 } | |
| 34 | |
| 35 } // namespace android | |
| 36 } // namespace base | |
| OLD | NEW |