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

Unified Diff: base/android/record_histogram.cc

Issue 1312153003: jni_generator: Pass object parameters as JavaParamRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 | « base/android/path_service_android.cc ('k') | base/android/record_user_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/record_histogram.cc
diff --git a/base/android/record_histogram.cc b/base/android/record_histogram.cc
index 0688e4f4ba799f928aa7699fa4cb9aa014398b26..51ca482e291b9c451331be9442c25239e21aaea4 100644
--- a/base/android/record_histogram.cc
+++ b/base/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) {
+ 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 | « base/android/path_service_android.cc ('k') | base/android/record_user_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698