OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/debug/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 147 |
148 pending_store_updates_--; | 148 pending_store_updates_--; |
149 if (!pending_store_updates_) { | 149 if (!pending_store_updates_) { |
150 db_updated_callback_.Run(); | 150 db_updated_callback_.Run(); |
151 db_updated_callback_.Reset(); | 151 db_updated_callback_.Reset(); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 bool V4Database::ResetDatabase() { | 155 bool V4Database::ResetDatabase() { |
156 DCHECK(db_task_runner_->RunsTasksOnCurrentThread()); | 156 DCHECK(db_task_runner_->RunsTasksOnCurrentThread()); |
157 bool reset_success = true; | |
158 for (const auto& store_map_iter : *store_map_) { | 157 for (const auto& store_map_iter : *store_map_) { |
159 if (!store_map_iter.second->Reset()) { | 158 store_map_iter.second->Reset(); |
160 reset_success = false; | |
161 } | |
162 } | 159 } |
163 return reset_success; | 160 return true; |
Scott Hess - ex-Googler
2016/10/05 04:42:13
Does this leave any implementations which can retu
vakh (use Gerrit instead)
2016/10/05 23:49:32
Done.
| |
164 } | 161 } |
165 | 162 |
166 std::unique_ptr<StoreStateMap> V4Database::GetStoreStateMap() { | 163 std::unique_ptr<StoreStateMap> V4Database::GetStoreStateMap() { |
167 std::unique_ptr<StoreStateMap> store_state_map = | 164 std::unique_ptr<StoreStateMap> store_state_map = |
168 base::MakeUnique<StoreStateMap>(); | 165 base::MakeUnique<StoreStateMap>(); |
169 for (const auto& store_map_iter : *store_map_) { | 166 for (const auto& store_map_iter : *store_map_) { |
170 (*store_state_map)[store_map_iter.first] = store_map_iter.second->state(); | 167 (*store_state_map)[store_map_iter.first] = store_map_iter.second->state(); |
171 } | 168 } |
172 return store_state_map; | 169 return store_state_map; |
173 } | 170 } |
(...skipping 23 matching lines...) Expand all Loading... | |
197 filename_(filename), | 194 filename_(filename), |
198 list_id_(list_id), | 195 list_id_(list_id), |
199 sb_threat_type_(sb_threat_type) { | 196 sb_threat_type_(sb_threat_type) { |
200 DCHECK(!fetch_updates_ || !filename_.empty()); | 197 DCHECK(!fetch_updates_ || !filename_.empty()); |
201 DCHECK_NE(SB_THREAT_TYPE_SAFE, sb_threat_type_); | 198 DCHECK_NE(SB_THREAT_TYPE_SAFE, sb_threat_type_); |
202 } | 199 } |
203 | 200 |
204 ListInfo::~ListInfo() {} | 201 ListInfo::~ListInfo() {} |
205 | 202 |
206 } // namespace safe_browsing | 203 } // namespace safe_browsing |
OLD | NEW |