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

Unified Diff: content/public/android/java/src/org/chromium/content/common/TraceEvent.java

Issue 11090082: Move PerfTest TraceEvent to async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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: content/public/android/java/src/org/chromium/content/common/TraceEvent.java
diff --git a/content/public/android/java/src/org/chromium/content/common/TraceEvent.java b/content/public/android/java/src/org/chromium/content/common/TraceEvent.java
index 458db8bfb1be63edb402c1f641be065f304d9903..d4635a886a6fb396c9ca8bd968090eca9866ae13 100644
--- a/content/public/android/java/src/org/chromium/content/common/TraceEvent.java
+++ b/content/public/android/java/src/org/chromium/content/common/TraceEvent.java
@@ -73,6 +73,50 @@ public class TraceEvent {
}
/**
+ * Convenience wrapper around the versions of startAsync() that take string parameters.
+ * @see #begin()
+ */
+ public static void startAsync(long id) {
+ if (sEnabled) {
Ted C 2012/10/11 23:46:30 I would make these all one liners
David Trainor- moved to gerrit 2012/10/12 00:10:49 Done.
+ nativeStartAsync(getCallerName(), id, null);
+ }
+ }
+
+ public static void startAsync(String name, long id) {
Ted C 2012/10/11 23:46:30 no javadocs?
David Trainor- moved to gerrit 2012/10/12 00:10:49 Done.
+ if (sEnabled) {
+ nativeStartAsync(name, id, null);
+ }
+ }
+
+ public static void startAsync(String name, long id, String arg) {
+ if (sEnabled) {
+ nativeStartAsync(name, id, arg);
+ }
+ }
+
+ /**
+ * Convenience wrapper around the versions of finishAsync() that take string parameters.
+ * @see #finish()
+ */
+ public static void finishAsync(long id) {
+ if (sEnabled) {
+ nativeFinishAsync(getCallerName(), id, null);
+ }
+ }
+
+ public static void finishAsync(String name, long id) {
+ if (sEnabled) {
+ nativeFinishAsync(name, id, null);
+ }
+ }
+
+ public static void finishAsync(String name, long id, String arg) {
+ if (sEnabled) {
+ nativeFinishAsync(name, id, arg);
+ }
+ }
+
+ /**
* Convenience wrapper around the versions of begin() that take string parameters.
* The name of the event will be derived from the class and function name that call this.
* IMPORTANT: if using this version, ensure end() (no parameters) is always called from the
@@ -137,4 +181,6 @@ public class TraceEvent {
private static native void nativeInstant(String name, String arg);
private static native void nativeBegin(String name, String arg);
private static native void nativeEnd(String name, String arg);
+ private static native void nativeStartAsync(String name, long id, String arg);
+ private static native void nativeFinishAsync(String name, long id, String arg);
}

Powered by Google App Engine
This is Rietveld 408576698