OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/prefs/pref_value_map.h" | 5 #include "base/prefs/pref_value_map.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 delete entry->second; | 60 delete entry->second; |
61 prefs_.erase(entry); | 61 prefs_.erase(entry); |
62 return true; | 62 return true; |
63 } | 63 } |
64 | 64 |
65 return false; | 65 return false; |
66 } | 66 } |
67 | 67 |
68 void PrefValueMap::Clear() { | 68 void PrefValueMap::Clear() { |
69 STLDeleteValues(&prefs_); | 69 STLDeleteValues(&prefs_); |
70 prefs_.clear(); | |
71 } | 70 } |
72 | 71 |
73 void PrefValueMap::Swap(PrefValueMap* other) { | 72 void PrefValueMap::Swap(PrefValueMap* other) { |
74 prefs_.swap(other->prefs_); | 73 prefs_.swap(other->prefs_); |
75 } | 74 } |
76 | 75 |
77 PrefValueMap::iterator PrefValueMap::begin() { | 76 PrefValueMap::iterator PrefValueMap::begin() { |
78 return prefs_.begin(); | 77 return prefs_.begin(); |
79 } | 78 } |
80 | 79 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ++other_pref; | 146 ++other_pref; |
148 } | 147 } |
149 } | 148 } |
150 | 149 |
151 // Add the remaining entries. | 150 // Add the remaining entries. |
152 for ( ; this_pref != prefs_.end(); ++this_pref) | 151 for ( ; this_pref != prefs_.end(); ++this_pref) |
153 differing_keys->push_back(this_pref->first); | 152 differing_keys->push_back(this_pref->first); |
154 for ( ; other_pref != other->prefs_.end(); ++other_pref) | 153 for ( ; other_pref != other->prefs_.end(); ++other_pref) |
155 differing_keys->push_back(other_pref->first); | 154 differing_keys->push_back(other_pref->first); |
156 } | 155 } |
OLD | NEW |