statistics_recorder_android.cc 839 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2016 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. #include <string>
  5. #include "base/android/jni_string.h"
  6. #include "base/base_jni_headers/StatisticsRecorderAndroid_jni.h"
  7. #include "base/metrics/histogram_base.h"
  8. #include "base/metrics/statistics_recorder.h"
  9. #include "base/system/sys_info.h"
  10. using base::android::JavaParamRef;
  11. using base::android::ConvertUTF8ToJavaString;
  12. namespace base {
  13. namespace android {
  14. static ScopedJavaLocalRef<jstring> JNI_StatisticsRecorderAndroid_ToJson(
  15. JNIEnv* env,
  16. jint verbosityLevel) {
  17. return ConvertUTF8ToJavaString(
  18. env, base::StatisticsRecorder::ToJSON(
  19. static_cast<JSONVerbosityLevel>(verbosityLevel)));
  20. }
  21. } // namespace android
  22. } // namespace base