OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/invalidation/impl/invalidator_storage.h" | 5 #include "components/invalidation/impl/invalidator_storage.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 } | 38 } |
39 return true; | 39 return true; |
40 } | 40 } |
41 | 41 |
42 std::unique_ptr<base::ListValue> UnackedInvalidationStorageMapToValue( | 42 std::unique_ptr<base::ListValue> UnackedInvalidationStorageMapToValue( |
43 const syncer::UnackedInvalidationsMap& map) { | 43 const syncer::UnackedInvalidationsMap& map) { |
44 std::unique_ptr<base::ListValue> value(new base::ListValue); | 44 std::unique_ptr<base::ListValue> value(new base::ListValue); |
45 for (syncer::UnackedInvalidationsMap::const_iterator it = map.begin(); | 45 for (syncer::UnackedInvalidationsMap::const_iterator it = map.begin(); |
46 it != map.end(); ++it) { | 46 it != map.end(); ++it) { |
47 value->Append(it->second.ToValue().release()); | 47 value->Append(it->second.ToValue()); |
48 } | 48 } |
49 return value; | 49 return value; |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 namespace invalidation { | 54 namespace invalidation { |
55 | 55 |
56 // static | 56 // static |
57 void InvalidatorStorage::RegisterProfilePrefs( | 57 void InvalidatorStorage::RegisterProfilePrefs( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 void InvalidatorStorage::Clear() { | 132 void InvalidatorStorage::Clear() { |
133 DCHECK(thread_checker_.CalledOnValidThread()); | 133 DCHECK(thread_checker_.CalledOnValidThread()); |
134 pref_service_->ClearPref(prefs::kInvalidatorSavedInvalidations); | 134 pref_service_->ClearPref(prefs::kInvalidatorSavedInvalidations); |
135 pref_service_->ClearPref(prefs::kInvalidatorClientId); | 135 pref_service_->ClearPref(prefs::kInvalidatorClientId); |
136 pref_service_->ClearPref(prefs::kInvalidatorInvalidationState); | 136 pref_service_->ClearPref(prefs::kInvalidatorInvalidationState); |
137 } | 137 } |
138 | 138 |
139 } // namespace invalidation | 139 } // namespace invalidation |
OLD | NEW |