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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java

Issue 2653733002: Android: Re-order deferred async task UMA record (Closed)
Patch Set: New histogram name Created 3 years, 11 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
index f63bca998a36140a33c3bb0e7e489fb1f95923c3..b36634b6a52ce2f1befa06bd3999f8ec0bc30401 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
@@ -234,22 +234,20 @@ public class DeferredStartupHandler {
private void initAsyncDiskTask() {
new AsyncTask<Void, Void, Void>() {
+ private long mAsyncTaskStartTime;
+
@Override
protected Void doInBackground(Void... params) {
try {
TraceEvent.begin("ChromeBrowserInitializer.onDeferredStartup.doInBackground");
- long asyncTaskStartTime = SystemClock.uptimeMillis();
-
- // Initialize the WebappRegistry if it's not already initialized. Must be in
- // async task due to shared preferences disk access on N.
- WebappRegistry.getInstance();
+ mAsyncTaskStartTime = SystemClock.uptimeMillis();
boolean crashDumpDisabled = CommandLine.getInstance().hasSwitch(
ChromeSwitches.DISABLE_CRASH_DUMP_UPLOAD);
if (!crashDumpDisabled) {
RecordHistogram.recordLongTimesHistogram(
"UMA.Debug.EnableCrashUpload.Uptime3",
- asyncTaskStartTime - UmaUtils.getForegroundStartTime(),
+ mAsyncTaskStartTime - UmaUtils.getForegroundStartTime(),
TimeUnit.MILLISECONDS);
PrivacyPreferencesManager.getInstance().enablePotentialCrashUploading();
MinidumpUploadService.tryUploadAllCrashDumps(mAppContext);
@@ -261,6 +259,10 @@ public class DeferredStartupHandler {
MinidumpUploadService.storeBreakpadUploadStatsInUma(
ChromePreferenceManager.getInstance(mAppContext));
+ // Initialize the WebappRegistry if it's not already initialized. Must be in
+ // async task due to shared preferences disk access on N.
+ WebappRegistry.getInstance();
+
// Force a widget refresh in order to wake up any possible zombie widgets.
// This is needed to ensure the right behavior when the process is suddenly
// killed.
@@ -277,11 +279,6 @@ public class DeferredStartupHandler {
cacheIsChromeDefaultBrowser();
- RecordHistogram.recordLongTimesHistogram(
- "UMA.Debug.EnableCrashUpload.DeferredStartUpDurationAsync",
- SystemClock.uptimeMillis() - asyncTaskStartTime,
- TimeUnit.MILLISECONDS);
-
// Warm up all web app shared prefs. This must be run after the WebappRegistry
// instance is initialized.
WebappRegistry.warmUpSharedPrefs();
@@ -296,6 +293,11 @@ public class DeferredStartupHandler {
protected void onPostExecute(Void params) {
// Must be run on the UI thread after the WebappRegistry has been completely warmed.
WebappRegistry.getInstance().unregisterOldWebapps(System.currentTimeMillis());
+
+ RecordHistogram.recordLongTimesHistogram(
+ "UMA.Debug.EnableCrashUpload.DeferredStartUpAsyncTaskDuration",
+ SystemClock.uptimeMillis() - mAsyncTaskStartTime,
+ TimeUnit.MILLISECONDS);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698