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

Side by Side Diff: chrome/browser/policy/device_management_policy_cache.cc

Issue 6324004: Made return types of various Value::DeepCopy() implementations more specific (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test for covariant return types Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/policy/device_management_policy_cache.h" 5 #include "chrome/browser/policy/device_management_policy_cache.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 policy_copy->CopyFrom(policy); 128 policy_copy->CopyFrom(policy);
129 BrowserThread::PostTask( 129 BrowserThread::PostTask(
130 BrowserThread::FILE, 130 BrowserThread::FILE,
131 FROM_HERE, 131 FROM_HERE,
132 new PersistPolicyTask(backing_file_path_, policy_copy, now, false)); 132 new PersistPolicyTask(backing_file_path_, policy_copy, now, false));
133 return new_policy_differs; 133 return new_policy_differs;
134 } 134 }
135 135
136 DictionaryValue* DeviceManagementPolicyCache::GetPolicy() { 136 DictionaryValue* DeviceManagementPolicyCache::GetPolicy() {
137 AutoLock lock(lock_); 137 AutoLock lock(lock_);
138 return static_cast<DictionaryValue*>(policy_->DeepCopy()); 138 return policy_->DeepCopy();
139 } 139 }
140 140
141 void DeviceManagementPolicyCache::SetDeviceUnmanaged(bool is_device_unmanaged) { 141 void DeviceManagementPolicyCache::SetDeviceUnmanaged(bool is_device_unmanaged) {
142 if (is_device_unmanaged_ == is_device_unmanaged) 142 if (is_device_unmanaged_ == is_device_unmanaged)
143 return; 143 return;
144 144
145 is_device_unmanaged_ = is_device_unmanaged; 145 is_device_unmanaged_ = is_device_unmanaged;
146 base::Time now(base::Time::NowFromSystemTime()); 146 base::Time now(base::Time::NowFromSystemTime());
147 DictionaryValue* empty = new DictionaryValue(); 147 DictionaryValue* empty = new DictionaryValue();
148 { 148 {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 DeviceManagementPolicyCache::DecodeValue(named_value->value()); 269 DeviceManagementPolicyCache::DecodeValue(named_value->value());
270 if (decoded_value) 270 if (decoded_value)
271 result->Set(named_value->name(), decoded_value); 271 result->Set(named_value->name(), decoded_value);
272 } 272 }
273 } 273 }
274 } 274 }
275 return result; 275 return result;
276 } 276 }
277 277
278 } // namespace policy 278 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/importer/importer_bridge.cc ('k') | chrome/browser/sync/glue/preference_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698