| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" |
| 10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "content/browser/tracing/trace_subscriber_stdio.h" | 13 #include "content/browser/tracing/trace_subscriber_stdio.h" |
| 13 #include "content/public/browser/trace_controller.h" | 14 #include "content/public/browser/trace_controller.h" |
| 14 #include "jni/TracingControllerAndroid_jni.h" | 15 #include "jni/TracingControllerAndroid_jni.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 static jint Init(JNIEnv* env, jobject obj) { | 19 static jint Init(JNIEnv* env, jobject obj) { |
| 19 TracingControllerAndroid* profiler = new TracingControllerAndroid(env, obj); | 20 TracingControllerAndroid* profiler = new TracingControllerAndroid(env, obj); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 84 |
| 84 void TracingControllerAndroid::OnTracingStopped() { | 85 void TracingControllerAndroid::OnTracingStopped() { |
| 85 JNIEnv* env = base::android::AttachCurrentThread(); | 86 JNIEnv* env = base::android::AttachCurrentThread(); |
| 86 base::android::ScopedJavaLocalRef<jobject> obj = weak_java_object_.get(env); | 87 base::android::ScopedJavaLocalRef<jobject> obj = weak_java_object_.get(env); |
| 87 if (obj.obj()) { | 88 if (obj.obj()) { |
| 88 Java_TracingControllerAndroid_onTracingStopped(env, obj.obj()); | 89 Java_TracingControllerAndroid_onTracingStopped(env, obj.obj()); |
| 89 } | 90 } |
| 90 subscriber_.reset(); | 91 subscriber_.reset(); |
| 91 } | 92 } |
| 92 | 93 |
| 94 static jstring GetDefaultCategories(JNIEnv* env, jobject obj) { |
| 95 return base::android::ConvertUTF8ToJavaString(env, |
| 96 base::debug::CategoryFilter::kDefaultCategoryFilterString).Release(); |
| 97 } |
| 98 |
| 93 bool RegisterTracingControllerAndroid(JNIEnv* env) { | 99 bool RegisterTracingControllerAndroid(JNIEnv* env) { |
| 94 return RegisterNativesImpl(env); | 100 return RegisterNativesImpl(env); |
| 95 } | 101 } |
| 96 | 102 |
| 97 } // namespace content | 103 } // namespace content |
| OLD | NEW |