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

Issue 290483003: Tame the proliferation of UserContext constructors (Closed)

Created:
6 years, 7 months ago by bartfab (slow)
Modified:
6 years, 7 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, pam+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Tame the proliferation of UserContext constructors UserContext offered a number of constructors aimed at specific use cases. One of these ended up being used as a poor man's copy constructor that took separate arguments to populate the various UserContext members. It had already gotten out of sync with the full UserContext state (there are 8 members but this constructor copied only 6). The problem would likely have become only worse in the future. This CL replaces the existing constructors with a more well-defined set: * A default constructor * An actual copy constructor that copies all members * A constructor that takes a |user_id|, which is required in almost all cases The copy constructor also replaces the ad-hoc CopyFrom() method. AuthAttemptState also offered several constructors, two of which took credentials in the form of a |user_context| while one took |username| and |password| separately. The CL combines these into a single constructor that always takes credentials as a |user_context|. BUG=367847 TEST=Updated unit and browser tests TBR=pamg (chrome/browser/managed_mode/chromeos/manager_password_service.cc) Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271258

Patch Set 1 #

Patch Set 2 : Rebased. #

Patch Set 3 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -368 lines) Patch
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/extensions/screenlock_private_apitest.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/chromeos/login/auth/auth_attempt_state.h View 1 1 chunk +5 lines, -13 lines 0 comments Download
M chrome/browser/chromeos/login/auth/auth_attempt_state.cc View 1 2 chunks +8 lines, -39 lines 0 comments Download
M chrome/browser/chromeos/login/auth/extended_authenticator.cc View 1 3 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/login/auth/login_performer.cc View 1 3 chunks +2 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/login/auth/mock_authenticator.cc View 1 2 chunks +19 lines, -24 lines 0 comments Download
M chrome/browser/chromeos/login/auth/online_attempt_host.cc View 1 2 chunks +6 lines, -12 lines 0 comments Download
M chrome/browser/chromeos/login/auth/online_attempt_unittest.cc View 1 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/login/auth/parallel_authenticator.cc View 1 9 chunks +39 lines, -57 lines 0 comments Download
M chrome/browser/chromeos/login/auth/parallel_authenticator_unittest.cc View 1 6 chunks +19 lines, -39 lines 0 comments Download
M chrome/browser/chromeos/login/auth/test_attempt_state.h View 1 1 chunk +3 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/login/auth/test_attempt_state.cc View 1 1 chunk +4 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/login/existing_user_controller.cc View 1 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/chromeos/login/existing_user_controller_browsertest.cc View 1 8 chunks +23 lines, -20 lines 0 comments Download
M chrome/browser/chromeos/login/lock/screen_locker.cc View 1 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/chromeos/login/login_manager_test.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/login_manager_test.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/login_utils_browsertest.cc View 1 1 chunk +10 lines, -13 lines 0 comments Download
M chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.cc View 1 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/login/managed/managed_user_creation_controller_new.cc View 1 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/login/managed/supervised_user_authentication.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/chromeos/login/managed/supervised_user_login_flow.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/signin/oauth2_browsertest.cc View 1 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/users/user.h View 1 2 chunks +6 lines, -15 lines 0 comments Download
M chrome/browser/chromeos/login/users/user.cc View 1 2 5 chunks +25 lines, -45 lines 0 comments Download
M chrome/browser/chromeos/login/users/user_manager_impl.cc View 1 2 1 chunk +8 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/login/wizard_controller_browsertest.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/managed_mode/chromeos/manager_password_service.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc View 1 2 chunks +14 lines, -14 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
bartfab (slow)
Hi Denis, Could you take a look please?
6 years, 7 months ago (2014-05-15 12:44:19 UTC) #1
Denis Kuznetsov (DE-MUC)
lgtm
6 years, 7 months ago (2014-05-15 14:23:57 UTC) #2
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 7 months ago (2014-05-16 08:05:49 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/290483003/20001
6 years, 7 months ago (2014-05-16 08:05:57 UTC) #4
Nikita (slow)
lgtm
6 years, 7 months ago (2014-05-16 08:08:19 UTC) #5
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-16 09:58:07 UTC) #6
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-16 11:03:36 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_chromeos_rel/builds/27765)
6 years, 7 months ago (2014-05-16 11:03:36 UTC) #8
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 7 months ago (2014-05-17 07:44:19 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/290483003/40001
6 years, 7 months ago (2014-05-17 07:44:43 UTC) #10
commit-bot: I haz the power
6 years, 7 months ago (2014-05-17 19:23:48 UTC) #11
Message was sent while issue was closed.
Change committed as 271258

Powered by Google App Engine
This is Rietveld 408576698