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

Unified Diff: chrome/browser/policy/cloud_policy_controller.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 | « no previous file | chrome/browser/policy/device_policy_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud_policy_controller.cc
diff --git a/chrome/browser/policy/cloud_policy_controller.cc b/chrome/browser/policy/cloud_policy_controller.cc
index 346f593f5f1ca2ba64d1a5cb1e19820ae1aaeb56..93f450ec618201cf093e4a7f18ce9899fc34f5ce 100644
--- a/chrome/browser/policy/cloud_policy_controller.cc
+++ b/chrome/browser/policy/cloud_policy_controller.cc
@@ -139,19 +139,19 @@ void CloudPolicyController::OnError(DeviceManagementBackend::ErrorCode code) {
<< "device manager, re-registering device.";
// Will retry fetching a token but gracefully backing off.
SetState(STATE_TOKEN_ERROR);
- break;
+ return;
}
case DeviceManagementBackend::kErrorServiceInvalidSerialNumber: {
VLOG(1) << "The device is no longer enlisted for the domain.";
token_fetcher_->SetSerialNumberInvalidState();
SetState(STATE_TOKEN_ERROR);
- break;
+ return;
}
case DeviceManagementBackend::kErrorServiceManagementNotSupported: {
VLOG(1) << "The device is no longer managed.";
token_fetcher_->SetUnmanagedState();
SetState(STATE_TOKEN_UNMANAGED);
- break;
+ return;
}
case DeviceManagementBackend::kErrorServicePolicyNotFound:
case DeviceManagementBackend::kErrorRequestInvalid:
@@ -161,17 +161,20 @@ void CloudPolicyController::OnError(DeviceManagementBackend::ErrorCode code) {
VLOG(1) << "An error in the communication with the policy server occurred"
<< ", will retry in a few hours.";
SetState(STATE_POLICY_UNAVAILABLE);
- break;
+ return;
}
case DeviceManagementBackend::kErrorRequestFailed:
case DeviceManagementBackend::kErrorTemporaryUnavailable: {
VLOG(1) << "A temporary error in the communication with the policy server"
<< " occurred.";
- }
- default:
// Will retry last operation but gracefully backing off.
SetState(STATE_POLICY_ERROR);
+ return;
+ }
}
+
+ NOTREACHED();
+ SetState(STATE_POLICY_ERROR);
}
void CloudPolicyController::OnDeviceTokenChanged() {
« no previous file with comments | « no previous file | chrome/browser/policy/device_policy_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698