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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 1283243002: Add UMA and Rappor metrics to capture URLs passed in at startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 1 Created 5 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/browser/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 7daf465e1e645f127adc8e255a8a264e69fbc751..8bb408f57c16bc521517ca37f20d2f45f8d9adbe 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -16,7 +16,7 @@
#include "base/environment.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
-#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_macros.h"
#include "base/metrics/statistics_recorder.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
@@ -79,6 +79,7 @@
#include "chrome/grit/locale_settings.h"
#include "chrome/installer/util/browser_distribution.h"
#include "components/google/core/browser/google_util.h"
+#include "components/rappor/rappor_utils.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/notification_observer.h"
@@ -325,6 +326,10 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
const std::vector<GURL>& urls_to_open,
bool process_startup,
chrome::HostDesktopType desktop_type) {
+ UMA_HISTOGRAM_COUNTS_100("Startup.BrowserLaunchURLCount",
+ urls_to_open.size());
Peter Kasting 2015/08/12 22:28:23 Nit: To avoid a (currently disabled) warning on MS
rkaplow 2015/08/12 22:37:40 The current convention for this macro is just a nu
Peter Kasting 2015/08/12 22:46:11 I'm not sure if I'm being clear. Passing a number
rkaplow 2015/08/13 02:11:58 Ah thanks, that makes sense.
+ RecordRapporOnStartupURLs(urls_to_open);
+
DCHECK(profile);
profile_ = profile;
@@ -1015,3 +1020,11 @@ void StartupBrowserCreatorImpl::InitializeWelcomeRunType(
welcome_run_type_ = WelcomeRunType::FIRST_RUN_LAST_TAB;
#endif // !OS_WIN
}
+
+void StartupBrowserCreatorImpl::RecordRapporOnStartupURLs(
+ const std::vector<GURL>& urls_to_open) {
+ for (const GURL& url : urls_to_open) {
+ rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
+ "Startup.BrowserLaunchURL", url);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698