OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/android/trace_event_binding.h" | 5 #include "content/common/android/trace_event_binding.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "jni/trace_event_jni.h" | 13 #include "jni/TraceEvent_jni.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const char kJavaCategory[] = "Java"; | 17 const char kJavaCategory[] = "Java"; |
18 | 18 |
19 // Boilerplate for safely converting Java data to TRACE_EVENT data. | 19 // Boilerplate for safely converting Java data to TRACE_EVENT data. |
20 class TraceEventDataConverter { | 20 class TraceEventDataConverter { |
21 public: | 21 public: |
22 TraceEventDataConverter(JNIEnv* env, | 22 TraceEventDataConverter(JNIEnv* env, |
23 jstring jname, | 23 jstring jname, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 TRACE_EVENT_COPY_END1(kJavaCategory, converter.name(), | 84 TRACE_EVENT_COPY_END1(kJavaCategory, converter.name(), |
85 converter.arg_name(), converter.arg()); | 85 converter.arg_name(), converter.arg()); |
86 } else { | 86 } else { |
87 TRACE_EVENT_COPY_END0(kJavaCategory, converter.name()); | 87 TRACE_EVENT_COPY_END0(kJavaCategory, converter.name()); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 bool RegisterTraceEvent(JNIEnv* env) { | 91 bool RegisterTraceEvent(JNIEnv* env) { |
92 return RegisterNativesImpl(env); | 92 return RegisterNativesImpl(env); |
93 } | 93 } |
OLD | NEW |