Skip to content

Commit 066cd3f

Browse files
smilesa-maurice
authored andcommitted
Added copy constructor and assignment operator to UserView.
PiperOrigin-RevId: 264679967
1 parent 0bf48f9 commit 066cd3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

auth/src/desktop/user_view.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class UserView {
102102
Mutex* mutex_;
103103
};
104104

105+
// Construct a user view from an existing set of user data.
106+
explicit UserView(const UserData& user_data) : user_data_(user_data) {}
107+
108+
// Exposed for testing.
109+
const UserData& user_data() const { return user_data_; }
110+
105111
// Resets the currently signed-in user with the given user_data and returns
106112
// a writeable view of the user for additional reads or modifications (e.g.,
107113
// to update UserInfos). Optionally, provide out_previous_user to save the
@@ -156,8 +162,6 @@ class UserView {
156162
static Writer GetWriter(AuthData* auth_data);
157163

158164
private:
159-
explicit UserView(const UserData& user_data) : user_data_(user_data) {}
160-
161165
static UserView* CastToUser(AuthData* auth_data);
162166

163167
UserData user_data_;

0 commit comments

Comments
 (0)