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

Unified Diff: base/android/java/src/org/chromium/base/TraceEvent.java

Issue 2145443002: Revert of Android: Add support for TraceEvent before the native library is loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: base/android/java/src/org/chromium/base/TraceEvent.java
diff --git a/base/android/java/src/org/chromium/base/TraceEvent.java b/base/android/java/src/org/chromium/base/TraceEvent.java
index 95d01dcef21e26d75c3c8d57c0d25eb7ed56e0ff..878275c2b80a60b28a8b763a53cdc5441d3c0a83 100644
--- a/base/android/java/src/org/chromium/base/TraceEvent.java
+++ b/base/android/java/src/org/chromium/base/TraceEvent.java
@@ -16,8 +16,8 @@
* Java mirror of Chrome trace event API. See base/trace_event/trace_event.h. Unlike the native
* version, Java does not have stack objects, so a TRACE_EVENT() which does both TRACE_EVENT_BEGIN()
* and TRACE_EVENT_END() in ctor/dtor is not possible.
- * It is OK to use tracing before the native library has loaded, in a slightly restricted fashion.
- * @see EarlyTraceEvent for details.
+ * It is OK to use tracing before the native library has loaded, but such traces will
+ * be ignored. (Perhaps we could devise to buffer them up in future?).
*/
@JNINamespace("base::android")
public class TraceEvent {
@@ -179,21 +179,11 @@
*/
@CalledByNative
public static void setEnabled(boolean enabled) {
- if (enabled) EarlyTraceEvent.disable();
sEnabled = enabled;
// Android M+ systrace logs this on its own. Only log it if not writing to Android systrace.
if (sATraceEnabled) return;
ThreadUtils.getUiThreadLooper().setMessageLogging(
enabled ? LooperMonitorHolder.sInstance : null);
- }
-
- /**
- * May enable early tracing depending on the environment.
- *
- * Must be called after the command-line has been read.
- */
- public static void maybeEnableEarlyTracing() {
- EarlyTraceEvent.maybeEnable();
}
/**
@@ -264,7 +254,7 @@
* @param name The name of the event.
*/
public static void begin(String name) {
- begin(name, null);
+ if (sEnabled) nativeBegin(name, null);
}
/**
@@ -273,7 +263,6 @@
* @param arg The arguments of the event.
*/
public static void begin(String name, String arg) {
- EarlyTraceEvent.begin(name);
if (sEnabled) nativeBegin(name, arg);
}
@@ -282,7 +271,7 @@
* @param name The name of the event.
*/
public static void end(String name) {
- end(name, null);
+ if (sEnabled) nativeEnd(name, null);
}
/**
@@ -291,7 +280,6 @@
* @param arg The arguments of the event.
*/
public static void end(String name, String arg) {
- EarlyTraceEvent.end(name);
if (sEnabled) nativeEnd(name, arg);
}

Powered by Google App Engine
This is Rietveld 408576698