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

Unified Diff: android/record_histogram.cc

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android/path_service_android.cc ('k') | android/record_user_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android/record_histogram.cc
diff --git a/android/record_histogram.cc b/android/record_histogram.cc
index 0688e4f4ba799f928aa7699fa4cb9aa014398b26..61bbf884da65926ba271354b2104cccf12fccb99 100644
--- a/android/record_histogram.cc
+++ b/android/record_histogram.cc
@@ -174,8 +174,8 @@ base::LazyInstance<HistogramCache>::Leaky g_histograms;
} // namespace
void RecordBooleanHistogram(JNIEnv* env,
- jclass clazz,
- jstring j_histogram_name,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& j_histogram_name,
jint j_histogram_key,
jboolean j_sample) {
bool sample = static_cast<bool>(j_sample);
@@ -185,8 +185,8 @@ void RecordBooleanHistogram(JNIEnv* env,
}
void RecordEnumeratedHistogram(JNIEnv* env,
- jclass clazz,
- jstring j_histogram_name,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& j_histogram_name,
jint j_histogram_key,
jint j_sample,
jint j_boundary) {
@@ -198,8 +198,8 @@ void RecordEnumeratedHistogram(JNIEnv* env,
}
void RecordCustomCountHistogram(JNIEnv* env,
- jclass clazz,
- jstring j_histogram_name,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& j_histogram_name,
jint j_histogram_key,
jint j_sample,
jint j_min,
@@ -214,8 +214,8 @@ void RecordCustomCountHistogram(JNIEnv* env,
}
void RecordLinearCountHistogram(JNIEnv* env,
- jclass clazz,
- jstring j_histogram_name,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& j_histogram_name,
jint j_histogram_key,
jint j_sample,
jint j_min,
@@ -230,31 +230,32 @@ void RecordLinearCountHistogram(JNIEnv* env,
}
void RecordSparseHistogram(JNIEnv* env,
- jclass clazz,
- jstring j_histogram_name,
- jint j_histogram_key,
- jint j_sample) {
- int sample = static_cast<int>(j_sample);
- g_histograms.Get()
- .SparseHistogram(env, j_histogram_name, j_histogram_key)
- ->Add(sample);
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& j_histogram_name,
+ jint j_histogram_key,
+ jint j_sample) {
+ int sample = static_cast<int>(j_sample);
+ g_histograms.Get()
+ .SparseHistogram(env, j_histogram_name, j_histogram_key)
+ ->Add(sample);
}
-void RecordCustomTimesHistogramMilliseconds(JNIEnv* env,
- jclass clazz,
- jstring j_histogram_name,
- jint j_histogram_key,
- jlong j_duration,
- jlong j_min,
- jlong j_max,
- jint j_num_buckets) {
+void RecordCustomTimesHistogramMilliseconds(
+ JNIEnv* env,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& j_histogram_name,
+ jint j_histogram_key,
+ jlong j_duration,
+ jlong j_min,
+ jlong j_max,
+ jint j_num_buckets) {
g_histograms.Get()
.CustomTimesHistogram(env, j_histogram_name, j_histogram_key, j_min,
j_max, j_num_buckets)
->AddTime(TimeDelta::FromMilliseconds(static_cast<int64>(j_duration)));
}
-void Initialize(JNIEnv* env, jclass) {
+void Initialize(JNIEnv* env, const JavaParamRef<jclass>&) {
StatisticsRecorder::Initialize();
}
@@ -262,10 +263,11 @@ void Initialize(JNIEnv* env, jclass) {
// MetricsUtils.HistogramDelta. It should live in a test-specific file, but we
// currently can't have test-specific native code packaged in test-specific Java
// targets - see http://crbug.com/415945.
-jint GetHistogramValueCountForTesting(JNIEnv* env,
- jclass clazz,
- jstring histogram_name,
- jint sample) {
+jint GetHistogramValueCountForTesting(
+ JNIEnv* env,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& histogram_name,
+ jint sample) {
HistogramBase* histogram = StatisticsRecorder::FindHistogram(
android::ConvertJavaStringToUTF8(env, histogram_name));
if (histogram == nullptr) {
« no previous file with comments | « android/path_service_android.cc ('k') | android/record_user_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698