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

Unified Diff: chrome/app/android/chrome_main_delegate_android.cc

Issue 23443009: [Android] Support startup histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Android] Support startup histogram - fix missing copyright notice Created 7 years, 4 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/app/android/chrome_main_delegate_android.cc
diff --git a/chrome/app/android/chrome_main_delegate_android.cc b/chrome/app/android/chrome_main_delegate_android.cc
index 6b726c6147f63599fa024b026a7a59b86540dd56..2b62047c837bce8a3540d57e3ce34fa9d4035967 100644
--- a/chrome/app/android/chrome_main_delegate_android.cc
+++ b/chrome/app/android/chrome_main_delegate_android.cc
@@ -8,6 +8,8 @@
#include "base/debug/trace_event.h"
#include "chrome/browser/android/chrome_jni_registrar.h"
#include "chrome/browser/android/chrome_startup_flags.h"
+#include "chrome/browser/android/uma_utils.h"
+#include "chrome/common/startup_metric_utils.h"
#include "content/public/browser/browser_main_runner.h"
// ChromeMainDelegateAndroid is created when the library is loaded. It is always
@@ -33,10 +35,14 @@ int ChromeMainDelegateAndroid::RunProcess(
RegisterApplicationNativeMethods(env);
// Because the browser process can be started asynchronously as a series of
- // of UI thread tasks a second request to start it can come in while the
- // first request is still being processed. We must keep the same
+ // UI thread tasks a second request to start it can come in while the
+ // first request is still being processed. Chrome must keep the same
// browser runner for the second request.
+ // Also only record the start time the first time round, since this is the
+ // start time of the application, and will be same for all requests.
if (!browser_runner_.get()) {
+ base::Time startTime = chrome::android::GetMainEntryPointTime();
+ startup_metric_utils::RecordSavedMainEntryPointTime(startTime);
browser_runner_.reset(content::BrowserMainRunner::Create());
}
return browser_runner_->Initialize(main_function_params);

Powered by Google App Engine
This is Rietveld 408576698