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

Issue 8499021: UserPolicyCache only becomes ready after policy has been fetched. (Closed)

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

Description

UserPolicyCache only becomes ready after policy has been fetched. This behavior is only forced on enterprise devices, and for logged in users whose username matches the enrollment domain. This requires waiting for a couple of things: - oauth token fetching - dm server register token fetching - user policy fetching The cache resumes initialization too if any of these steps fails. Fetching of OAuth tokens usually happens after Profile creation, but in this case it will be done earlier so that the policy fetching can proceed before the Profile is fully created. This fixes the races between policy and sync, startup pages, etc. BUG=chromium-os:17698 TEST=Logins of enterprise users on enrolled ChromeOS devices waits for a policy fetch before proceeding. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110108

Patch Set 1 #

Patch Set 2 : Actually waits now, rebased #

Total comments: 10

Patch Set 3 : Make waiting decision in login_utils; added unit tests; rebased #

Patch Set 4 : Fixed build-breaking typo #

Total comments: 6

Patch Set 5 : Added login_utils_unittest.cc, rebased #

Patch Set 6 : Nits from Mattias #

Total comments: 7

Patch Set 7 : Renamed to login_utils_browsertest.cc #

Patch Set 8 : Fetch policy token again if previous fetch failed #

Patch Set 9 : Fix pointer typo #

Total comments: 3

Patch Set 10 : Avoid resetting policy fetcher when there are pending fetches #

Patch Set 11 : Rebased #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+897 lines, -112 lines) Patch
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/login_browsertest.cc View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/login/login_utils.cc View 1 2 3 4 5 6 7 8 9 10 19 chunks +142 lines, -49 lines 0 comments Download
A chrome/browser/chromeos/login/login_utils_browsertest.cc View 1 2 3 4 5 6 1 chunk +457 lines, -0 lines 0 comments Download
M chrome/browser/net/gaia/gaia_oauth_fetcher.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/net/gaia/gaia_oauth_fetcher.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/policy/browser_policy_connector.h View 1 2 3 chunks +13 lines, -7 lines 0 comments Download
M chrome/browser/policy/browser_policy_connector.cc View 1 2 3 4 5 6 chunks +35 lines, -20 lines 0 comments Download
M chrome/browser/policy/cloud_policy_cache_base.h View 1 2 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/policy/cloud_policy_controller.cc View 1 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/policy/cloud_policy_controller_unittest.cc View 1 2 3 4 5 3 chunks +71 lines, -1 line 0 comments Download
M chrome/browser/policy/cloud_policy_provider_unittest.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/policy/cloud_policy_subsystem_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/policy/device_policy_cache.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/policy/device_policy_cache.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/policy/device_token_fetcher.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/policy/device_token_fetcher_unittest.cc View 1 2 3 4 5 3 chunks +57 lines, -1 line 0 comments Download
M chrome/browser/policy/enterprise_metrics_browsertest.cc View 1 6 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/policy/user_policy_cache.h View 1 3 chunks +16 lines, -1 line 0 comments Download
M chrome/browser/policy/user_policy_cache.cc View 1 2 4 chunks +19 lines, -3 lines 0 comments Download
M chrome/browser/policy/user_policy_cache_unittest.cc View 1 2 13 chunks +40 lines, -12 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 1 comment Download
M chrome/test/base/testing_browser_process.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/testing_browser_process.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Joao da Silva
Hi all, please have a look. @mnissler: policy/ changes, overall thing @zelidrag: your name is ...
9 years, 1 month ago (2011-11-10 14:03:12 UTC) #1
Mattias Nissler (ping if slow)
http://codereview.chromium.org/8499021/diff/2001/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): http://codereview.chromium.org/8499021/diff/2001/chrome/browser/chromeos/login/login_utils.cc#newcode582 chrome/browser/chromeos/login/login_utils.cc:582: scoped_ptr<PolicyOAuthFetcher> policy_oauth_early_fetcher_; I don't see why we need two ...
9 years, 1 month ago (2011-11-11 11:41:23 UTC) #2
Joao da Silva
@mnissler: PTAL http://codereview.chromium.org/8499021/diff/2001/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): http://codereview.chromium.org/8499021/diff/2001/chrome/browser/chromeos/login/login_utils.cc#newcode582 chrome/browser/chromeos/login/login_utils.cc:582: scoped_ptr<PolicyOAuthFetcher> policy_oauth_early_fetcher_; On 2011/11/11 11:41:23, Mattias Nissler ...
9 years, 1 month ago (2011-11-11 12:55:14 UTC) #3
Mattias Nissler (ping if slow)
LGTM from the policy side if you address my nits. Zel, can you please take ...
9 years, 1 month ago (2011-11-11 14:38:50 UTC) #4
Joao da Silva
Added login_utils_unittest.cc. @mnissler: fixed nits; mind to have a look at the new test too? ...
9 years, 1 month ago (2011-11-14 15:59:48 UTC) #5
Nikita (slow)
On 2011/11/14 15:59:48, Joao da Silva wrote: > Added login_utils_unittest.cc. This should be called login_utils_browsertest.cc
9 years, 1 month ago (2011-11-14 16:02:08 UTC) #6
Nikita (slow)
We're thinking of resurrecting ClientLogin code path for some of the enterprise users. How would ...
9 years, 1 month ago (2011-11-14 16:21:28 UTC) #7
Joao da Silva
@nkostylev: The ClientLogin path won't block with these changes, but if it is introduced again ...
9 years, 1 month ago (2011-11-14 17:19:08 UTC) #8
Nikita (slow)
Please run linux_chromeos_clang trybot.
9 years, 1 month ago (2011-11-15 09:32:16 UTC) #9
Joao da Silva
On 2011/11/15 09:32:16, Nikita Kostylev wrote: > Please run linux_chromeos_clang trybot. Done.
9 years, 1 month ago (2011-11-15 11:55:17 UTC) #10
Nikita (slow)
Zel, please take a quick look if I have overlooked something. http://codereview.chromium.org/8499021/diff/19007/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): ...
9 years, 1 month ago (2011-11-15 12:09:23 UTC) #11
Nikita (slow)
http://codereview.chromium.org/8499021/diff/17009/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): http://codereview.chromium.org/8499021/diff/17009/chrome/browser/chromeos/login/login_utils.cc#newcode1236 chrome/browser/chromeos/login/login_utils.cc:1236: policy_oauth_fetcher_->policy_token().empty()) { On 2011/11/15 12:09:23, Nikita Kostylev wrote: > ...
9 years, 1 month ago (2011-11-15 12:16:19 UTC) #12
Joao da Silva
@Nikita: changed to prevent new fetches when there are pending fetches. http://codereview.chromium.org/8499021/diff/17009/chrome/browser/chromeos/login/login_utils.cc File chrome/browser/chromeos/login/login_utils.cc (right): ...
9 years, 1 month ago (2011-11-15 14:35:56 UTC) #13
Nikita (slow)
lgtm
9 years, 1 month ago (2011-11-15 15:31:20 UTC) #14
zel
lgtm
9 years, 1 month ago (2011-11-15 15:43:02 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joaodasilva@chromium.org/8499021/31001
9 years, 1 month ago (2011-11-15 16:20:44 UTC) #16
commit-bot: I haz the power
Change committed as 110108
9 years, 1 month ago (2011-11-15 17:29:31 UTC) #17
jochen (gone - plz use gerrit)
https://codereview.chromium.org/8499021/diff/31001/chrome/chrome_tests.gypi File chrome/chrome_tests.gypi (right): https://codereview.chromium.org/8499021/diff/31001/chrome/chrome_tests.gypi#newcode2430 chrome/chrome_tests.gypi:2430: 'browser/chromeos/login/login_utils_browsertest.cc', why was the file missing?
8 years, 1 month ago (2012-11-13 13:25:03 UTC) #18
jochen (gone - plz use gerrit)
8 years, 1 month ago (2012-11-13 13:25:30 UTC) #19
disregard my comment, wrong CL :(

Powered by Google App Engine
This is Rietveld 408576698