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 2407b8eb0e085e5a99193734cf1d6aa63f57fd09..f6491a37612ec346812d16e87336144490b66da9 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 |
@@ -23,6 +23,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.ProcessInitException; |
@@ -116,9 +117,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"); |
dsinclair
2015/02/09 21:11:20
This trace event seems unrelated to this CL, can y
dsinclair
2015/02/09 21:11:20
This trace event seems unrelated to this CL, can y
Benoit L
2015/02/10 15:31:35
I left it here as an example of use for the early
|
+ |
super.onCreate(savedInstanceState); |
- ContentApplication.initCommandLine(this); |
waitForDebuggerIfNeeded(); |
DeviceUtils.addDeviceSpecificUserAgentSwitch(this); |
@@ -144,6 +151,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"); |
} |
} |