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

Unified Diff: chrome/browser/chrome_browser_main.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
« no previous file with comments | « chrome/browser/android/uma_utils.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index e8612a18a4d7a25953c8afaf9187d781462b4dd1..7265e7465f63ba6012966866a9e6442157238615 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -686,7 +686,15 @@ void ChromeBrowserMainParts::RecordBrowserStartupTime() {
if (startup_metric_utils::WasNonBrowserUIDisplayed())
return;
+#if defined(OS_ANDROID)
+ // On Android the first run is handled in Java code, and the C++ side of
+ // Chrome doesn't know if this is the first run. This will cause some
+ // inaccuracy in the UMA statistics, but this should be minor (first runs are
+ // rare).
+ bool is_first_run = false;
+#else
bool is_first_run = first_run::IsChromeFirstRun();
+#endif
// CurrentProcessInfo::CreationTime() is currently only implemented on some
// platforms.
@@ -1595,7 +1603,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
delete parameters().ui_task;
run_message_loop_ = false;
}
-
+#if defined(OS_ANDROID)
+ // We never run the C++ main loop on Android, since the UI thread message
+ // loop is controlled by the OS, so this is as close as we can get to
+ // the start of the main loop
+ if (result_code_ <= 0) {
+ RecordBrowserStartupTime();
+ }
+#endif
return result_code_;
}
« no previous file with comments | « chrome/browser/android/uma_utils.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698