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

Unified Diff: chrome/browser/chromeos/settings/session_manager_operation.cc

Issue 2922453002: Remove validation retry logic from DeviceSettingsService (Closed)
Patch Set: Adding back IsInitialized() Created 3 years, 7 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
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/settings/session_manager_operation.cc
diff --git a/chrome/browser/chromeos/settings/session_manager_operation.cc b/chrome/browser/chromeos/settings/session_manager_operation.cc
index 47d600774f9bbcc54b27a8a60e45f9e828575027..c3e2659d9936de9396122f793f94bef418614e5d 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation.cc
+++ b/chrome/browser/chromeos/settings/session_manager_operation.cc
@@ -151,13 +151,13 @@ void SessionManagerOperation::BlockingRetrieveDeviceSettings() {
void SessionManagerOperation::ValidateDeviceSettings(
const std::string& policy_blob,
RetrievePolicyResponseType response_type) {
- std::unique_ptr<em::PolicyFetchResponse> policy(
- new em::PolicyFetchResponse());
if (policy_blob.empty()) {
ReportResult(DeviceSettingsService::STORE_NO_POLICY);
return;
}
+ std::unique_ptr<em::PolicyFetchResponse> policy =
+ base::MakeUnique<em::PolicyFetchResponse>();
if (!policy->ParseFromString(policy_blob) || !policy->IsInitialized()) {
ReportResult(DeviceSettingsService::STORE_INVALID_POLICY);
return;
@@ -210,23 +210,14 @@ void SessionManagerOperation::ValidateDeviceSettings(
void SessionManagerOperation::ReportValidatorStatus(
policy::DeviceCloudPolicyValidator* validator) {
- DeviceSettingsService::Status status =
- DeviceSettingsService::STORE_VALIDATION_ERROR;
if (validator->success()) {
- status = DeviceSettingsService::STORE_SUCCESS;
policy_data_ = std::move(validator->policy_data());
device_settings_ = std::move(validator->payload());
+ ReportResult(DeviceSettingsService::STORE_SUCCESS);
} else {
LOG(ERROR) << "Policy validation failed: " << validator->status();
-
- // Those are mostly caused by RTC loss and are recoverable.
- if (validator->status() ==
- policy::DeviceCloudPolicyValidator::VALIDATION_BAD_TIMESTAMP) {
- status = DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR;
- }
+ ReportResult(DeviceSettingsService::STORE_VALIDATION_ERROR);
}
-
- ReportResult(status);
}
LoadSettingsOperation::LoadSettingsOperation(bool force_key_load,
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698