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

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java

Issue 874543003: Add support for TraceEvent before the native library is loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
index d1fd4eef3b6e1beb4cd3adc59537f4f30dfb9845..abe87f7b87c657b348a5674e3a5d66521241bb4e 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java
@@ -25,6 +25,7 @@ import org.chromium.base.BaseSwitches;
import org.chromium.base.CommandLine;
import org.chromium.base.ContentUriUtils;
import org.chromium.base.MemoryPressureListener;
+import org.chromium.base.TraceEvent;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.library_loader.LibraryProcessType;
@@ -121,9 +122,15 @@ public class ChromeShellActivity extends ActionBarActivity implements AppMenuPro
@Override
@SuppressFBWarnings("DM_EXIT")
protected void onCreate(final Bundle savedInstanceState) {
+ // Enable tracing as early as possible if required
+ ContentApplication.initCommandLine(this);
+ if (CommandLine.getInstance().hasSwitch("trace-startup")) {
+ TraceEvent.enableEarlyTracing();
+ }
+ TraceEvent.begin("ChromeShellActivity.onCreate");
+
super.onCreate(savedInstanceState);
- ContentApplication.initCommandLine(this);
waitForDebuggerIfNeeded();
DeviceUtils.addDeviceSpecificUserAgentSwitch(this);
@@ -150,6 +157,8 @@ public class ChromeShellActivity extends ActionBarActivity implements AppMenuPro
} catch (ProcessInitException e) {
Log.e(TAG, "Unable to load native library.", e);
System.exit(-1);
+ } finally {
+ TraceEvent.end("ChromeShellActivity.onCreate");
}
}

Powered by Google App Engine
This is Rietveld 408576698