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

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc

Issue 16998003: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
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/policy/device_cloud_policy_store_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h" 8 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h"
9 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" 9 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
10 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h" 10 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 void DeviceCloudPolicyStoreChromeOS::Store( 30 void DeviceCloudPolicyStoreChromeOS::Store(
31 const em::PolicyFetchResponse& policy) { 31 const em::PolicyFetchResponse& policy) {
32 // Cancel all pending requests. 32 // Cancel all pending requests.
33 weak_factory_.InvalidateWeakPtrs(); 33 weak_factory_.InvalidateWeakPtrs();
34 34
35 scoped_refptr<chromeos::OwnerKey> owner_key( 35 scoped_refptr<chromeos::OwnerKey> owner_key(
36 device_settings_service_->GetOwnerKey()); 36 device_settings_service_->GetOwnerKey());
37 if (!install_attributes_->IsEnterpriseDevice() || 37 if (!install_attributes_->IsEnterpriseDevice() ||
38 !device_settings_service_->policy_data() || 38 !device_settings_service_->policy_data() || !owner_key.get() ||
39 !owner_key || !owner_key->public_key()) { 39 !owner_key->public_key()) {
40 status_ = STATUS_BAD_STATE; 40 status_ = STATUS_BAD_STATE;
41 NotifyStoreError(); 41 NotifyStoreError();
42 return; 42 return;
43 } 43 }
44 44
45 scoped_ptr<DeviceCloudPolicyValidator> validator(CreateValidator(policy)); 45 scoped_ptr<DeviceCloudPolicyValidator> validator(CreateValidator(policy));
46 validator->ValidateSignature(*owner_key->public_key(), true); 46 validator->ValidateSignature(*owner_key->public_key(), true);
47 validator->ValidateAgainstCurrentPolicy( 47 validator->ValidateAgainstCurrentPolicy(
48 device_settings_service_->policy_data(), 48 device_settings_service_->policy_data(),
49 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED, 49 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: 154 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR:
155 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: 155 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR:
156 status_ = STATUS_LOAD_ERROR; 156 status_ = STATUS_LOAD_ERROR;
157 break; 157 break;
158 } 158 }
159 159
160 NotifyStoreError(); 160 NotifyStoreError();
161 } 161 }
162 162
163 } // namespace policy 163 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698