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

Issue 9404011: Explicitly wait for user policy before completing login. (Closed)

Created:
8 years, 10 months ago by Joao da Silva
Modified:
8 years, 7 months ago
CC:
chromium-reviews, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Explicitly wait for user policy before completing login. This enables a further simplification of the underlying policy PrefStore, and makes the waiting path more clear. BUG=chromium-os:17698, 108999 TEST=All policy tests pass, in particular browser_tests:LoginUtils*

Patch Set 1 #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -36 lines) Patch
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/login_utils.cc View 7 chunks +39 lines, -4 lines 6 comments Download
M chrome/browser/policy/browser_policy_connector.h View 2 chunks +4 lines, -1 line 1 comment Download
M chrome/browser/policy/browser_policy_connector.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/policy/cloud_policy_controller_unittest.cc View 12 chunks +24 lines, -3 lines 1 comment Download
M chrome/browser/policy/cloud_policy_subsystem_unittest.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/policy/device_token_fetcher_unittest.cc View 9 chunks +20 lines, -3 lines 1 comment Download
M chrome/browser/policy/user_policy_cache.h View 3 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/policy/user_policy_cache.cc View 2 chunks +10 lines, -3 lines 1 comment Download
M chrome/browser/policy/user_policy_cache_unittest.cc View 15 chunks +38 lines, -15 lines 1 comment Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Joao da Silva
Please review. @mnissler: main review @nkostylev: owner review for the changes to login_utils.cc
8 years, 10 months ago (2012-02-15 16:29:07 UTC) #1
Mattias Nissler (ping if slow)
http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/login_utils.cc#newcode679 chrome/browser/chromeos/login/login_utils.cc:679: // profile creation and user policy readiness notifications come ...
8 years, 10 months ago (2012-02-16 10:24:11 UTC) #2
Nikita (slow)
http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/login_utils.cc#newcode772 chrome/browser/chromeos/login/login_utils.cc:772: connector->InitializeUserPolicy( What's the cost (and what happens behind the ...
8 years, 10 months ago (2012-02-20 16:10:23 UTC) #3
Joao da Silva
8 years, 10 months ago (2012-02-20 16:23:15 UTC) #4
Hi Nikita,

 thanks for having a look! Please see the comments inline.

http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/l...
File chrome/browser/chromeos/login/login_utils.cc (right):

http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/l...
chrome/browser/chromeos/login/login_utils.cc:772:
connector->InitializeUserPolicy(
On 2012/02/20 16:10:24, Nikita Kostylev wrote:
> What's the cost (and what happens behind the scenes) on any subsequent login
> (i.e. when policy has been already fetched)?
> 

The cost is always the same. A couple of objects are created and plugged into
places, a URL fetch is started asynchronously, and an asynchronous load of
cached policy is started too. This call won't do any IO itself, and returns
quickly.

|wait_for_policy_fetch| is required precisely because this call can return while
the cache is still being loaded.

> Does this also involve policy update as well (it shouldn't) or policy update
is
> postponed?

An update is triggered by this call but is delayed by 5 seconds, unless
|wait_for_policy_fetch| is true (in that case the fetch starts immediately).

http://codereview.chromium.org/9404011/diff/1/chrome/browser/chromeos/login/l...
chrome/browser/chromeos/login/login_utils.cc:789:
base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr()));
On 2012/02/20 16:10:24, Nikita Kostylev wrote:
> On 2012/02/16 10:24:11, Mattias Nissler wrote:
> > Since user policy is not initialized at this point, I'm worrying that
running
> > ProfileImpl::OnPrefsLoaded will actually start up lots of pref-consuming
code
> > without policy in place. I think we need to split profile initialization to
> not
> > automatically call ProfileImpl::OnPrefsLoaded, s.t. we can create the
profile
> > and its PrefService and wait for user policy. Once all that has finished we
> > should kick off what's now happening in OnPrefsLoaded.
> 
> I think this part could be done in a separate CL prior to that one?

Yes. This turned out to be a larger issue and we've been debating how to design
a nicer fix that plugs more clearly into the Profile initialization code. This
CL is now likely to be closed; I'll chime you in again if any changes are
required in LoginUtils.

Powered by Google App Engine
This is Rietveld 408576698