| 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 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 private: | 69 private: |
| 70 long long id_; | 70 long long id_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 static jboolean TraceEnabled(JNIEnv* env, jclass clazz) { | 75 static jboolean TraceEnabled(JNIEnv* env, jclass clazz) { |
| 76 return base::debug::TraceLog::GetInstance()->IsEnabled(); | 76 return base::debug::TraceLog::GetInstance()->IsEnabled(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 static void InitATrace(JNIEnv* env, jclass clazz) { |
| 80 base::debug::TraceLog::InitATrace(); |
| 81 } |
| 82 |
| 79 static void Instant(JNIEnv* env, jclass clazz, | 83 static void Instant(JNIEnv* env, jclass clazz, |
| 80 jstring jname, jstring jarg) { | 84 jstring jname, jstring jarg) { |
| 81 TraceEventDataConverter converter(env, jname, jarg); | 85 TraceEventDataConverter converter(env, jname, jarg); |
| 82 if (converter.arg()) { | 86 if (converter.arg()) { |
| 83 TRACE_EVENT_COPY_INSTANT1(kJavaCategory, converter.name(), | 87 TRACE_EVENT_COPY_INSTANT1(kJavaCategory, converter.name(), |
| 84 converter.arg_name(), converter.arg()); | 88 converter.arg_name(), converter.arg()); |
| 85 } else { | 89 } else { |
| 86 TRACE_EVENT_COPY_INSTANT0(kJavaCategory, converter.name()); | 90 TRACE_EVENT_COPY_INSTANT0(kJavaCategory, converter.name()); |
| 87 } | 91 } |
| 88 } | 92 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } else { | 141 } else { |
| 138 TRACE_EVENT_COPY_ASYNC_END0(kJavaCategory, | 142 TRACE_EVENT_COPY_ASYNC_END0(kJavaCategory, |
| 139 converter.name(), | 143 converter.name(), |
| 140 converter.id()); | 144 converter.id()); |
| 141 } | 145 } |
| 142 } | 146 } |
| 143 | 147 |
| 144 bool RegisterTraceEvent(JNIEnv* env) { | 148 bool RegisterTraceEvent(JNIEnv* env) { |
| 145 return RegisterNativesImpl(env); | 149 return RegisterNativesImpl(env); |
| 146 } | 150 } |
| OLD | NEW |