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

Unified Diff: chrome/browser/policy/device_token_fetcher.cc

Issue 6079012: Allow policy refresh rate to be configured through policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows build. Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/device_token_fetcher.cc
diff --git a/chrome/browser/policy/device_token_fetcher.cc b/chrome/browser/policy/device_token_fetcher.cc
index 2d514b603aae312e454ad2f1e5247e9f01e418c7..3f977c1a25ccfdbc754e1f8d841cda5ccd9bb9fc 100644
--- a/chrome/browser/policy/device_token_fetcher.cc
+++ b/chrome/browser/policy/device_token_fetcher.cc
@@ -65,6 +65,7 @@ DeviceTokenFetcher::ObserverRegistrar::~ObserverRegistrar() {
void DeviceTokenFetcher::ObserverRegistrar::Init(
DeviceTokenFetcher* token_fetcher) {
+ RemoveAll();
danno 2011/01/06 19:19:49 It's not obvious to me why this has been added but
Jakob Kummerow 2011/01/07 09:48:51 It's been added so that Init() can be called multi
Mattias Nissler (ping if slow) 2011/01/07 11:15:33 This is actually a left-over from an experiment an
token_fetcher_ = token_fetcher;
}
@@ -192,7 +193,11 @@ void DeviceTokenFetcher::OnError(DeviceManagementBackend::ErrorCode code) {
}
void DeviceTokenFetcher::Restart() {
- DCHECK(!IsTokenPending());
+ // Complain if there's currently an asynchronous operation going on.
+ DCHECK(state_ == kStateNotStarted ||
+ state_ == kStateHasDeviceToken ||
+ state_ == kStateFailure ||
+ state_ == kStateNotManaged);
danno 2011/01/06 19:19:49 Similar to above: if you are fixing a particular b
Mattias Nissler (ping if slow) 2011/01/07 11:15:33 This allows us to Restart() the fetcher even befor
device_token_.clear();
device_token_load_complete_event_.Reset();
MakeReadyToRequestDeviceToken();

Powered by Google App Engine
This is Rietveld 408576698