| 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 "base/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/TraceEvent_jni.h" | 13 #include "jni/TraceEvent_jni.h" |
| 14 | 14 |
| 15 namespace base { |
| 16 namespace android { |
| 17 |
| 15 namespace { | 18 namespace { |
| 16 | 19 |
| 17 const char kJavaCategory[] = "Java"; | 20 const char kJavaCategory[] = "Java"; |
| 18 | 21 |
| 19 // Boilerplate for safely converting Java data to TRACE_EVENT data. | 22 // Boilerplate for safely converting Java data to TRACE_EVENT data. |
| 20 class TraceEventDataConverter { | 23 class TraceEventDataConverter { |
| 21 public: | 24 public: |
| 22 TraceEventDataConverter(JNIEnv* env, | 25 TraceEventDataConverter(JNIEnv* env, |
| 23 jstring jname, | 26 jstring jname, |
| 24 jstring jarg) | 27 jstring jarg) |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } else { | 129 } else { |
| 127 TRACE_EVENT_COPY_ASYNC_END0(kJavaCategory, | 130 TRACE_EVENT_COPY_ASYNC_END0(kJavaCategory, |
| 128 converter.name(), | 131 converter.name(), |
| 129 jid); | 132 jid); |
| 130 } | 133 } |
| 131 } | 134 } |
| 132 | 135 |
| 133 bool RegisterTraceEvent(JNIEnv* env) { | 136 bool RegisterTraceEvent(JNIEnv* env) { |
| 134 return RegisterNativesImpl(env); | 137 return RegisterNativesImpl(env); |
| 135 } | 138 } |
| 139 |
| 140 } // namespace android |
| 141 } // namespace base |
| OLD | NEW |