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

Issue 1880923003: GetAccountIdFromProfile() should not return an empty account id if a valid profile is provided. (Closed)

Created:
4 years, 8 months ago by xdai1
Modified:
4 years, 7 months ago
CC:
chromium-reviews, kalyank, sadrul
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

GetAccountIdFromProfile() should not return an empty account id if a valid profile is provided. On Chrome OS, we don't end the session immediately if a refresh token is revoked in the session. Thus it's possible that we get an empty account id for a profile from Profile::GetProfileUserName(). We should avoid this scenario on Chrome OS. BUG=602807, 532535 Committed: https://crrev.com/d2a0bb5307f8d0d09aff9d5d531dd9704fe85841 Cr-Commit-Position: refs/heads/master@{#392133}

Patch Set 1 #

Patch Set 2 : Fix the failed trybots. #

Total comments: 1

Patch Set 3 : Address skuhne@'s comment. #

Patch Set 4 : Add unittest. Rebase #

Patch Set 5 : Rebase #

Patch Set 6 : Replace scoped_ptr with std::unique_ptr #

Total comments: 4

Patch Set 7 : Address rogerta@'s comments. Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -14 lines) Patch
M chrome/browser/chromeos/profiles/profile_helper.h View 1 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/signin/signin_error_notifier_ash_unittest.cc View 1 2 3 4 5 3 chunks +15 lines, -0 lines 0 comments Download
M chrome/browser/sync/sync_error_notifier_ash_unittest.cc View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/chrome_screenshot_grabber_unittest.cc View 1 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/multi_user/multi_user_util.cc View 1 2 3 4 5 6 2 chunks +13 lines, -13 lines 0 comments Download
A chrome/browser/ui/ash/multi_user/multi_user_util_chromeos_unittest.cc View 1 2 3 4 5 1 chunk +141 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser_finder_chromeos_unittest.cc View 1 2 4 chunks +13 lines, -1 line 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/signin/core/browser/fake_signin_manager.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/signin/core/browser/fake_signin_manager.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (12 generated)
xdai1
skuhne@, could you help review this CL please? Thanks! In my previous CL https://codereview.chromium.org/1704623002 I ...
4 years, 8 months ago (2016-04-12 23:25:29 UTC) #2
xdai1
On 2016/04/12 23:25:29, xdai1 wrote: > skuhne@, could you help review this CL please? Thanks! ...
4 years, 8 months ago (2016-04-14 16:23:52 UTC) #4
Mr4D (OOO till 08-26)
lgtm! https://codereview.chromium.org/1880923003/diff/40001/chrome/browser/signin/signin_error_notifier_ash_unittest.cc File chrome/browser/signin/signin_error_notifier_ash_unittest.cc (right): https://codereview.chromium.org/1880923003/diff/40001/chrome/browser/signin/signin_error_notifier_ash_unittest.cc#newcode117 chrome/browser/signin/signin_error_notifier_ash_unittest.cc:117: chromeos::MockUserManager* mock_user_manager_; You might want to add a ...
4 years, 8 months ago (2016-04-14 17:44:25 UTC) #5
xdai1
thakis@, could you help review this CL please? Thanks!
4 years, 8 months ago (2016-04-14 18:18:26 UTC) #7
xdai1
On 2016/04/14 18:18:26, xdai1 wrote: > thakis@, could you help review this CL please? Thanks! ...
4 years, 8 months ago (2016-04-15 21:19:01 UTC) #8
xdai1
ping again? Thanks!
4 years, 8 months ago (2016-04-18 16:46:06 UTC) #9
Nico
Is there a test for the new behavior? (There were a few test changes, but ...
4 years, 8 months ago (2016-04-18 19:49:08 UTC) #10
xdai1
On 2016/04/18 19:49:08, Nico wrote: > Is there a test for the new behavior? (There ...
4 years, 8 months ago (2016-04-18 20:11:35 UTC) #11
xdai1
Nico, please take another look, Thanks! I added the test file: multi_user_util_chromeos_unittest.cc
4 years, 8 months ago (2016-04-21 23:42:05 UTC) #12
xdai1
On 2016/04/21 23:42:05, xdai1 wrote: > Nico, please take another look, Thanks! I added the ...
4 years, 8 months ago (2016-04-25 16:16:00 UTC) #13
xdai1
On 2016/04/25 16:16:00, xdai1 wrote: > On 2016/04/21 23:42:05, xdai1 wrote: > > Nico, please ...
4 years, 8 months ago (2016-04-26 23:23:06 UTC) #14
Nico
lgtm
4 years, 7 months ago (2016-05-02 23:11:07 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1880923003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1880923003/80001
4 years, 7 months ago (2016-05-04 17:05:20 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/177531)
4 years, 7 months ago (2016-05-04 17:12:14 UTC) #20
xdai1
rogerta@, could you help do an owner review of the following files please? Thanks! components/signin/core/browser/fake_signin_manager.cc ...
4 years, 7 months ago (2016-05-04 17:17:17 UTC) #22
Roger Tawa OOO till Jul 10th
Hi Xiaoqian, Can you explain the root cause of the problem? The linked bugs describes ...
4 years, 7 months ago (2016-05-05 14:27:21 UTC) #23
xdai1
rogerta@, please take another look, thanks for your review! Actually the account id of a ...
4 years, 7 months ago (2016-05-05 18:08:47 UTC) #24
Alexander Alekseev
On 2016/05/05 18:08:47, xdai1 wrote: > rogerta@, please take another look, thanks for your review! ...
4 years, 7 months ago (2016-05-05 21:33:49 UTC) #26
Roger Tawa OOO till Jul 10th
lgtm Thanks for the explanation guys. One last question: this change is to fix some ...
4 years, 7 months ago (2016-05-06 13:44:59 UTC) #27
xdai1
On 2016/05/06 13:44:59, Roger Tawa wrote: > lgtm > > Thanks for the explanation guys. ...
4 years, 7 months ago (2016-05-06 18:20:34 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1880923003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1880923003/160001
4 years, 7 months ago (2016-05-06 20:02:18 UTC) #31
commit-bot: I haz the power
Committed patchset #7 (id:160001)
4 years, 7 months ago (2016-05-06 20:07:34 UTC) #32
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/d2a0bb5307f8d0d09aff9d5d531dd9704fe85841 Cr-Commit-Position: refs/heads/master@{#392133}
4 years, 7 months ago (2016-05-06 20:08:34 UTC) #34
Nico
A revert of this CL (patchset #7 id:160001) has been created in https://codereview.chromium.org/1962463002/ by thakis@chromium.org. ...
4 years, 7 months ago (2016-05-07 14:12:54 UTC) #35
Roger Tawa OOO till Jul 10th
On 2016/05/06 18:20:34, xdai1 wrote: > On 2016/05/06 13:44:59, Roger Tawa wrote: > > lgtm ...
4 years, 7 months ago (2016-05-09 14:14:15 UTC) #36
xdai1
On 2016/05/09 14:14:15, Roger Tawa wrote: > > Hi Xiaoqian, > > Note that changing ...
4 years, 7 months ago (2016-05-09 22:25:58 UTC) #37
Roger Tawa OOO till Jul 10th
4 years, 7 months ago (2016-05-11 12:50:50 UTC) #39
Message was sent while issue was closed.
On 2016/05/09 22:25:58, xdai1 wrote:
> On 2016/05/09 14:14:15, Roger Tawa wrote:
> > 
> > Hi Xiaoqian,
> > 
> > Note that changing a password on another device is "normal circumstances",
so
> > this fix could be hiding a real bug somewhere else.  This causes the refresh
> > token to become invalid, which is different from saying that the token is
> > revoked.  The token should never be revoked. For my own info, can you point
me
> > to the code that would revoke a token when chrome detects that it has become
> > invalid?
> > 
> > Similarly with 602807: if the refresh token becomes invalid, then chrome
can't
> > refresh the account<-->email mapping which is cached on the device. 
However,
> > this is only a problem if the user changes the email address associated with
> > their gaia account, which does not seem to be the case.
> 
> Hi Rogar,
> 
> Thanks for your info. I guess you're right. I originally thought the revoked
> refresh token and invalid refresh token were the same thing... I clicked
around
> and could not find the code path that revokes a token when the token has
become
> invalid. However, from the bug reports (Issue 532553, Issue 602807 (related to
> AU), Issue 602159 (related to AU), especially Issue 601525 (maybe related to
> password changing?)), this CL is the best guess I can give... But maybe I was
> wrong. Do you have any thoughts?

Sorry Xiaoqian, I don't know the specifics of cros, only the more general sign
in related code.  Maybe you could fix the memory leak and re-land this CL as it
fixes a crash happening in the wild.  If you do, please open a bug for yourself
to investigate the true nature of why valid profiles don't have an associated
account id.

Powered by Google App Engine
This is Rietveld 408576698