OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/android/tracing_controller_android.h" | 5 #include "content/browser/android/tracing_controller_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
12 #include "content/public/browser/tracing_controller.h" | 12 #include "content/public/browser/tracing_controller.h" |
13 #include "jni/TracingControllerAndroid_jni.h" | 13 #include "jni/TracingControllerAndroid_jni.h" |
14 | 14 |
| 15 using base::android::JavaParamRef; |
| 16 using base::android::ScopedJavaLocalRef; |
| 17 |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 20 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
18 TracingControllerAndroid* profiler = new TracingControllerAndroid(env, obj); | 21 TracingControllerAndroid* profiler = new TracingControllerAndroid(env, obj); |
19 return reinterpret_cast<intptr_t>(profiler); | 22 return reinterpret_cast<intptr_t>(profiler); |
20 } | 23 } |
21 | 24 |
22 TracingControllerAndroid::TracingControllerAndroid(JNIEnv* env, jobject obj) | 25 TracingControllerAndroid::TracingControllerAndroid(JNIEnv* env, jobject obj) |
23 : weak_java_object_(env, obj), | 26 : weak_java_object_(env, obj), |
24 weak_factory_(this) {} | 27 weak_factory_(this) {} |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 base::trace_event::TraceConfig trace_config; | 115 base::trace_event::TraceConfig trace_config; |
113 return base::android::ConvertUTF8ToJavaString( | 116 return base::android::ConvertUTF8ToJavaString( |
114 env, trace_config.ToCategoryFilterString()); | 117 env, trace_config.ToCategoryFilterString()); |
115 } | 118 } |
116 | 119 |
117 bool RegisterTracingControllerAndroid(JNIEnv* env) { | 120 bool RegisterTracingControllerAndroid(JNIEnv* env) { |
118 return RegisterNativesImpl(env); | 121 return RegisterNativesImpl(env); |
119 } | 122 } |
120 | 123 |
121 } // namespace content | 124 } // namespace content |
OLD | NEW |