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

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_provider.cc

Issue 2922453002: Remove validation retry logic from DeviceSettingsService (Closed)
Patch Set: Adding back IsInitialized() Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/settings/device_settings_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
6 6
7 #include <memory.h> 7 #include <memory.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 break; 883 break;
884 } 884 }
885 case DeviceSettingsService::STORE_NO_POLICY: 885 case DeviceSettingsService::STORE_NO_POLICY:
886 if (MitigateMissingPolicy()) 886 if (MitigateMissingPolicy())
887 break; 887 break;
888 // fall through. 888 // fall through.
889 case DeviceSettingsService::STORE_KEY_UNAVAILABLE: 889 case DeviceSettingsService::STORE_KEY_UNAVAILABLE:
890 VLOG(1) << "No policies present yet, will use the temp storage."; 890 VLOG(1) << "No policies present yet, will use the temp storage.";
891 trusted_status_ = PERMANENTLY_UNTRUSTED; 891 trusted_status_ = PERMANENTLY_UNTRUSTED;
892 break; 892 break;
893 case DeviceSettingsService::STORE_POLICY_ERROR:
894 case DeviceSettingsService::STORE_VALIDATION_ERROR: 893 case DeviceSettingsService::STORE_VALIDATION_ERROR:
895 case DeviceSettingsService::STORE_INVALID_POLICY: 894 case DeviceSettingsService::STORE_INVALID_POLICY:
896 case DeviceSettingsService::STORE_OPERATION_FAILED: 895 case DeviceSettingsService::STORE_OPERATION_FAILED:
897 LOG(ERROR) << "Failed to retrieve cros policies. Reason: " 896 LOG(ERROR) << "Failed to retrieve cros policies. Reason: "
898 << device_settings_service_->status(); 897 << device_settings_service_->status();
899 trusted_status_ = PERMANENTLY_UNTRUSTED; 898 trusted_status_ = PERMANENTLY_UNTRUSTED;
900 break; 899 break;
901 case DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR:
902 // The policy has failed to validate due to temporary error but it might
903 // take a long time until we recover so behave as it is a permanent error.
904 LOG(ERROR) << "Failed to retrieve cros policies because a temporary "
905 << "validation error has occurred. Retrying might succeed.";
906 trusted_status_ = PERMANENTLY_UNTRUSTED;
907 break;
908 } 900 }
909 901
910 // Notify the observers we are done. 902 // Notify the observers we are done.
911 std::vector<base::Closure> callbacks; 903 std::vector<base::Closure> callbacks;
912 callbacks.swap(callbacks_); 904 callbacks.swap(callbacks_);
913 for (size_t i = 0; i < callbacks.size(); ++i) 905 for (size_t i = 0; i < callbacks.size(); ++i)
914 callbacks[i].Run(); 906 callbacks[i].Run();
915 907
916 return settings_loaded; 908 return settings_loaded;
917 } 909 }
918 910
919 } // namespace chromeos 911 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698