OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/policy/core/common/policy_map.h" | 5 #include "components/policy/core/common/policy_map.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 | 11 |
12 namespace policy { | 12 namespace policy { |
13 | 13 |
| 14 PolicyMap::Entry::Entry() |
| 15 : level(POLICY_LEVEL_RECOMMENDED), |
| 16 scope(POLICY_SCOPE_USER), |
| 17 value(NULL), |
| 18 external_data_fetcher(NULL) {} |
| 19 |
14 void PolicyMap::Entry::DeleteOwnedMembers() { | 20 void PolicyMap::Entry::DeleteOwnedMembers() { |
15 delete value; | 21 delete value; |
16 value = NULL; | 22 value = NULL; |
17 delete external_data_fetcher; | 23 delete external_data_fetcher; |
18 external_data_fetcher = NULL; | 24 external_data_fetcher = NULL; |
19 } | 25 } |
20 | 26 |
21 scoped_ptr<PolicyMap::Entry> PolicyMap::Entry::DeepCopy() const { | 27 scoped_ptr<PolicyMap::Entry> PolicyMap::Entry::DeepCopy() const { |
22 scoped_ptr<Entry> copy(new Entry); | 28 scoped_ptr<Entry> copy(new Entry); |
23 copy->level = level; | 29 copy->level = level; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 map_.clear(); | 198 map_.clear(); |
193 } | 199 } |
194 | 200 |
195 // static | 201 // static |
196 bool PolicyMap::MapEntryEquals(const PolicyMap::PolicyMapType::value_type& a, | 202 bool PolicyMap::MapEntryEquals(const PolicyMap::PolicyMapType::value_type& a, |
197 const PolicyMap::PolicyMapType::value_type& b) { | 203 const PolicyMap::PolicyMapType::value_type& b) { |
198 return a.first == b.first && a.second.Equals(b.second); | 204 return a.first == b.first && a.second.Equals(b.second); |
199 } | 205 } |
200 | 206 |
201 } // namespace policy | 207 } // namespace policy |
OLD | NEW |