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

Unified Diff: components/mus/ws/user_id_tracker.cc

Issue 1770533002: Change userid from a uint32_t to a string guid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@33connector
Patch Set: . Created 4 years, 9 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 | « components/mus/ws/user_id_tracker.h ('k') | components/mus/ws/user_id_tracker_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/user_id_tracker.cc
diff --git a/components/mus/ws/user_id_tracker.cc b/components/mus/ws/user_id_tracker.cc
index 85845fcb4257a41c354c6db2837ac9fda231a3d9..453fde6d5a1581d03a27a355b19df738112a18a8 100644
--- a/components/mus/ws/user_id_tracker.cc
+++ b/components/mus/ws/user_id_tracker.cc
@@ -11,16 +11,16 @@ namespace mus {
namespace ws {
UserIdTracker::UserIdTracker()
- : active_id_(mojo::shell::mojom::Connector::kInvalidApplicationID) {}
+ : active_id_(mojo::shell::mojom::kRootUserID) {}
UserIdTracker::~UserIdTracker() {
DCHECK(ids_.empty());
}
-bool UserIdTracker::IsValidUserId(UserId id) const {
+bool UserIdTracker::IsValidUserId(const UserId& id) const {
return ids_.count(id) > 0;
}
-void UserIdTracker::SetActiveUserId(UserId id) {
+void UserIdTracker::SetActiveUserId(const UserId& id) {
if (id == active_id_)
return;
@@ -29,13 +29,13 @@ void UserIdTracker::SetActiveUserId(UserId id) {
OnActiveUserIdChanged(id));
}
-void UserIdTracker::AddUserId(UserId id) {
+void UserIdTracker::AddUserId(const UserId& id) {
DCHECK(!IsValidUserId(id));
ids_.insert(id);
FOR_EACH_OBSERVER(UserIdTrackerObserver, observers_, OnUserIdAdded(id));
}
-void UserIdTracker::RemoveUserId(UserId id) {
+void UserIdTracker::RemoveUserId(const UserId& id) {
DCHECK(IsValidUserId(id));
ids_.erase(id);
FOR_EACH_OBSERVER(UserIdTrackerObserver, observers_, OnUserIdRemoved(id));
« no previous file with comments | « components/mus/ws/user_id_tracker.h ('k') | components/mus/ws/user_id_tracker_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698