Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: content/common/android/trace_event_binding.cc

Issue 12221047: Support JellyBean MR2 style of systrace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) { 79 static void StartATrace(JNIEnv* env, jclass clazz) {
80 base::debug::TraceLog::InitATrace(); 80 base::debug::TraceLog::GetInstance()->StartATrace();
81 }
82
83 static void StopATrace(JNIEnv* env, jclass clazz) {
84 base::debug::TraceLog::GetInstance()->StopATrace();
81 } 85 }
82 86
83 static void Instant(JNIEnv* env, jclass clazz, 87 static void Instant(JNIEnv* env, jclass clazz,
84 jstring jname, jstring jarg) { 88 jstring jname, jstring jarg) {
85 TraceEventDataConverter converter(env, jname, jarg); 89 TraceEventDataConverter converter(env, jname, jarg);
86 if (converter.arg()) { 90 if (converter.arg()) {
87 TRACE_EVENT_COPY_INSTANT1(kJavaCategory, converter.name(), 91 TRACE_EVENT_COPY_INSTANT1(kJavaCategory, converter.name(),
88 converter.arg_name(), converter.arg()); 92 converter.arg_name(), converter.arg());
89 } else { 93 } else {
90 TRACE_EVENT_COPY_INSTANT0(kJavaCategory, converter.name()); 94 TRACE_EVENT_COPY_INSTANT0(kJavaCategory, converter.name());
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } else { 145 } else {
142 TRACE_EVENT_COPY_ASYNC_END0(kJavaCategory, 146 TRACE_EVENT_COPY_ASYNC_END0(kJavaCategory,
143 converter.name(), 147 converter.name(),
144 converter.id()); 148 converter.id());
145 } 149 }
146 } 150 }
147 151
148 bool RegisterTraceEvent(JNIEnv* env) { 152 bool RegisterTraceEvent(JNIEnv* env) {
149 return RegisterNativesImpl(env); 153 return RegisterNativesImpl(env);
150 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698