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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 137753007: Adding number of users to crash record (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 6 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 | « chrome/browser/chromeos/login/user_manager_impl.h ('k') | chrome/common/crash_keys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index db4dd135d7c3e31d60c335d2902ff76fc7861b2e..d0ce2ceba88680d52ad23fa4150091b73fac4954 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/format_macros.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_registry_simple.h"
@@ -49,6 +50,7 @@
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/crash_keys.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/cryptohome/async_method_caller.h"
@@ -193,6 +195,7 @@ UserManagerImpl::UserManagerImpl()
manager_creation_time_(base::TimeTicks::Now()),
multi_profile_first_run_notification_(
new MultiProfileFirstRunNotification) {
+ UpdateNumberOfUsers();
// UserManager instance should be used only on UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
registrar_.Add(this, chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED,
@@ -1377,6 +1380,7 @@ void UserManagerImpl::RetailModeUserLoggedIn() {
}
void UserManagerImpl::NotifyOnLogin() {
+ UpdateNumberOfUsers();
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
NotifyActiveUserHashChanged(active_user_->username_hash());
NotifyActiveUserChanged(active_user_);
@@ -1697,6 +1701,7 @@ void UserManagerImpl::NotifyActiveUserChanged(const User* active_user) {
}
void UserManagerImpl::NotifyUserAddedToSession(const User* added_user) {
+ UpdateNumberOfUsers();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
FOR_EACH_OBSERVER(UserManager::UserSessionStateObserver,
session_state_observer_list_,
@@ -1869,5 +1874,9 @@ void UserManagerImpl::DoUpdateAccountLocale(
user->SetAccountLocale(resolved_locale);
}
+void UserManagerImpl::UpdateNumberOfUsers() {
+ base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers,
+ base::StringPrintf("%" PRIuS, GetLoggedInUsers().size()));
+}
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.h ('k') | chrome/common/crash_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698