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

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

Issue 8773034: Clean up error handling and timestamp initialization for cloud policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« no previous file with comments | « chrome/browser/policy/device_policy_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e96b4fb424be0da391b2a7d808ba1bb8cd42401d..540c4df0c4990b6f10ab310ede62771db2d624b4 100644
--- a/chrome/browser/policy/device_token_fetcher.cc
+++ b/chrome/browser/policy/device_token_fetcher.cc
@@ -119,24 +119,31 @@ void DeviceTokenFetcher::OnError(DeviceManagementBackend::ErrorCode code) {
switch (code) {
case DeviceManagementBackend::kErrorServiceManagementNotSupported:
SetUnmanagedState();
- break;
+ return;
case DeviceManagementBackend::kErrorRequestFailed:
case DeviceManagementBackend::kErrorTemporaryUnavailable:
case DeviceManagementBackend::kErrorServiceDeviceNotFound:
case DeviceManagementBackend::kErrorServiceDeviceIdConflict:
SetState(STATE_TEMPORARY_ERROR);
- break;
+ return;
case DeviceManagementBackend::kErrorServiceManagementTokenInvalid:
// Most probably the GAIA auth cookie has expired. We can not do anything
// until the user logs-in again.
SetState(STATE_BAD_AUTH);
- break;
+ return;
case DeviceManagementBackend::kErrorServiceInvalidSerialNumber:
SetSerialNumberInvalidState();
- break;
- default:
+ return;
+ case DeviceManagementBackend::kErrorRequestInvalid:
+ case DeviceManagementBackend::kErrorHttpStatus:
+ case DeviceManagementBackend::kErrorResponseDecoding:
+ case DeviceManagementBackend::kErrorServiceActivationPending:
+ case DeviceManagementBackend::kErrorServicePolicyNotFound:
SetState(STATE_ERROR);
+ return;
}
+ NOTREACHED();
+ SetState(STATE_ERROR);
}
void DeviceTokenFetcher::Initialize(DeviceManagementService* service,
« no previous file with comments | « chrome/browser/policy/device_policy_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698