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/debug/trace_event.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "content/browser/tracing/trace_subscriber_stdio.h" | 13 #include "content/browser/tracing/trace_subscriber_stdio.h" |
14 #include "content/public/browser/trace_controller.h" | 14 #include "content/public/browser/trace_controller.h" |
15 #include "jni/TracingControllerAndroid_jni.h" | 15 #include "jni/TracingControllerAndroid_jni.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 static jint Init(JNIEnv* env, jobject obj) { | 19 static jlong Init(JNIEnv* env, jobject obj) { |
20 TracingControllerAndroid* profiler = new TracingControllerAndroid(env, obj); | 20 TracingControllerAndroid* profiler = new TracingControllerAndroid(env, obj); |
21 return reinterpret_cast<jint>(profiler); | 21 return reinterpret_cast<intptr_t>(profiler); |
22 } | 22 } |
23 | 23 |
24 class TracingControllerAndroid::Subscriber | 24 class TracingControllerAndroid::Subscriber |
25 : public content::TraceSubscriberStdio { | 25 : public content::TraceSubscriberStdio { |
26 public: | 26 public: |
27 Subscriber(TracingControllerAndroid* profiler, const base::FilePath& path) | 27 Subscriber(TracingControllerAndroid* profiler, const base::FilePath& path) |
28 : TraceSubscriberStdio(path, FILE_TYPE_ARRAY, false), | 28 : TraceSubscriberStdio(path, FILE_TYPE_ARRAY, false), |
29 profiler_(profiler) {} | 29 profiler_(profiler) {} |
30 | 30 |
31 void set_profiler(TracingControllerAndroid* profiler) { | 31 void set_profiler(TracingControllerAndroid* profiler) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 static jstring GetDefaultCategories(JNIEnv* env, jobject obj) { | 94 static jstring GetDefaultCategories(JNIEnv* env, jobject obj) { |
95 return base::android::ConvertUTF8ToJavaString(env, | 95 return base::android::ConvertUTF8ToJavaString(env, |
96 base::debug::CategoryFilter::kDefaultCategoryFilterString).Release(); | 96 base::debug::CategoryFilter::kDefaultCategoryFilterString).Release(); |
97 } | 97 } |
98 | 98 |
99 bool RegisterTracingControllerAndroid(JNIEnv* env) { | 99 bool RegisterTracingControllerAndroid(JNIEnv* env) { |
100 return RegisterNativesImpl(env); | 100 return RegisterNativesImpl(env); |
101 } | 101 } |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
OLD | NEW |