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

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

Issue 5341004: Chrome should re-register device when DMServer doesn't recognize token (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 80 col Created 10 years, 1 month 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_management_policy_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/device_management_policy_provider.cc
diff --git a/chrome/browser/policy/device_management_policy_provider.cc b/chrome/browser/policy/device_management_policy_provider.cc
index f19156441e51dd1690269ed6149dae4f892b88f6..5f41fb097c3019c88d1de32147fd2b74dc360102 100644
--- a/chrome/browser/policy/device_management_policy_provider.cc
+++ b/chrome/browser/policy/device_management_policy_provider.cc
@@ -108,14 +108,20 @@ void DeviceManagementPolicyProvider::HandlePolicyResponse(
void DeviceManagementPolicyProvider::OnError(
DeviceManagementBackend::ErrorCode code) {
policy_request_pending_ = false;
- LOG(WARNING) << "Could not provide policy from the device manager (error = "
- << code << "), will retry in "
- << (policy_refresh_error_delay_ms_/1000) << " seconds.";
- ScheduleRefreshTask(policy_refresh_error_delay_ms_);
- policy_refresh_error_delay_ms_ *= 2;
- if (policy_refresh_rate_ms_ &&
- policy_refresh_rate_ms_ < policy_refresh_error_delay_ms_) {
- policy_refresh_error_delay_ms_ = policy_refresh_rate_ms_;
+ if (code == DeviceManagementBackend::kErrorServiceDeviceNotFound) {
Mattias Nissler (ping if slow) 2010/11/25 09:03:28 please also add kErrorDeviceManagementTokenInvalid
+ LOG(WARNING) << "The device token was not recognized by the device manager,"
+ << " re-registering device.";
+ token_fetcher_->Restart();
+ } else {
+ LOG(WARNING) << "Could not provide policy from the device manager (error = "
+ << code << "), will retry in "
+ << (policy_refresh_error_delay_ms_/1000) << " seconds.";
+ ScheduleRefreshTask(policy_refresh_error_delay_ms_);
+ policy_refresh_error_delay_ms_ *= 2;
+ if (policy_refresh_rate_ms_ &&
+ policy_refresh_rate_ms_ < policy_refresh_error_delay_ms_) {
+ policy_refresh_error_delay_ms_ = policy_refresh_rate_ms_;
+ }
}
}
« no previous file with comments | « no previous file | chrome/browser/policy/device_management_policy_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698