Commit 54946426 authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Log user manager information during windows notification activation

There have been reports that user manager showed up in chrome's startup when
dealing with Windows native notification activation. This CL logs relevant
data to help investigation.

Bug: 833663
Change-Id: I90a64c7854e25d1a8dc704a452a3c2eddb97c041
Reviewed-on: https://chromium-review.googlesource.com/1019103
Commit-Queue: Xi Cheng <chengx@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarTommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552262}
parent 29bf9f28
......@@ -105,6 +105,24 @@ using content::ChildProcessSecurityPolicy;
namespace {
#if defined(OS_WIN)
// TODO(chengx): remove all UserManagerShowupStatus related code after bug
// 833663 is fixed.
//
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class UserManagerShowupStatus {
kLastOpenedProfileNonEmpty = 0,
kLastUsedProfileCannotOpen = 1,
kMaxValue = kLastUsedProfileCannotOpen,
};
void LogUserManagerShowupStatus(UserManagerShowupStatus status) {
UMA_HISTOGRAM_ENUMERATION("Notifications.Windows.UserManagerShowupStatus",
status);
}
#endif // defined(OS_WIN)
// Keeps track on which profiles have been launched.
class ProfileLaunchObserver : public content::NotificationObserver {
public:
......@@ -756,6 +774,14 @@ bool StartupBrowserCreator::LaunchBrowserForLastProfiles(
return LaunchBrowser(command_line, profile_to_open, cur_dir,
is_process_startup, is_first_run);
}
#if defined(OS_WIN)
if (command_line.HasSwitch(switches::kNotificationLaunchId)) {
LogUserManagerShowupStatus(
UserManagerShowupStatus::kLastUsedProfileCannotOpen);
}
#endif // defined(OS_WIN)
// Show UserManager if |last_used_profile| can't be auto opened.
ShowUserManagerOnStartup(command_line);
return true;
......@@ -838,6 +864,14 @@ bool StartupBrowserCreator::ProcessLastOpenedProfiles(
is_process_startup = chrome::startup::IS_NOT_PROCESS_STARTUP;
}
#if defined(OS_WIN)
if (command_line.HasSwitch(switches::kNotificationLaunchId) &&
is_process_startup == chrome::startup::IS_PROCESS_STARTUP) {
LogUserManagerShowupStatus(
UserManagerShowupStatus::kLastOpenedProfileNonEmpty);
}
#endif // defined(OS_WIN)
// Set the |last_used_profile| to activate if a browser is launched for at
// least one profile. Otherwise, show UserManager.
// Note that this must be done after all profiles have
......
......@@ -47744,6 +47744,11 @@ Full version information for the fingerprint enum values:
<int value="3" label="SHORTCUT_MISCONFIGURATION"/>
</enum>
<enum name="WindowsNotificationUserManagerShowupStatus">
<int value="0" label="Last opened profile is non-empty"/>
<int value="1" label="Cannot open last used profile"/>
</enum>
<enum name="WindowsVersion">
<int value="0" label="Pre-XP"/>
<int value="1" label="XP"/>
......@@ -57036,6 +57036,17 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
<histogram name="Notifications.Windows.UserManagerShowupStatus"
enum="WindowsNotificationUserManagerShowupStatus">
<owner>chengx@chromium.org</owner>
<owner>peter@chromium.org</owner>
<summary>
Used to indicate the code path where the user profile manager shows up
during startup (Windows only). Logged whenever a notification event is being
handled.
</summary>
</histogram>
<histogram name="Notifications.XPCConnectionEvent" enum="XPCConnectionEvent">
<owner>miguelg@chromium.org</owner>
<owner>rsesek@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment