Chromium Code Reviews| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 db_updated_callback_.Reset(); | 132 db_updated_callback_.Reset(); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 void V4Database::UpdatedStoreReady(UpdateListIdentifier identifier, | 136 void V4Database::UpdatedStoreReady(UpdateListIdentifier identifier, |
| 137 std::unique_ptr<V4Store> new_store) { | 137 std::unique_ptr<V4Store> new_store) { |
| 138 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 138 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 139 DCHECK(pending_store_updates_); | 139 DCHECK(pending_store_updates_); |
| 140 if (new_store) { | 140 if (new_store) { |
| 141 (*store_map_)[identifier] = std::move(new_store); | 141 (*store_map_)[identifier] = std::move(new_store); |
| 142 } else { | |
| 143 DVLOG(1) << "Store update discarded: " << *(*store_map_)[identifier]; | |
|
Nathan Parker
2016/08/09 00:10:19
nit: I suspect this is redundant with the "ApplyUp
| |
| 142 } | 144 } |
| 143 | 145 |
| 144 pending_store_updates_--; | 146 pending_store_updates_--; |
| 145 if (!pending_store_updates_) { | 147 if (!pending_store_updates_) { |
| 146 db_updated_callback_.Run(); | 148 db_updated_callback_.Run(); |
| 147 db_updated_callback_.Reset(); | 149 db_updated_callback_.Reset(); |
| 148 } | 150 } |
| 149 } | 151 } |
| 150 | 152 |
| 151 bool V4Database::ResetDatabase() { | 153 bool V4Database::ResetDatabase() { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 177 DCHECK(store_pair != store_map_->end()); | 179 DCHECK(store_pair != store_map_->end()); |
| 178 const std::unique_ptr<V4Store>& store = store_pair->second; | 180 const std::unique_ptr<V4Store>& store = store_pair->second; |
| 179 HashPrefix hash_prefix = store->GetMatchingHashPrefix(full_hash); | 181 HashPrefix hash_prefix = store->GetMatchingHashPrefix(full_hash); |
| 180 if (!hash_prefix.empty()) { | 182 if (!hash_prefix.empty()) { |
| 181 (*matched_hash_prefix_map)[identifier] = hash_prefix; | 183 (*matched_hash_prefix_map)[identifier] = hash_prefix; |
| 182 } | 184 } |
| 183 } | 185 } |
| 184 } | 186 } |
| 185 | 187 |
| 186 } // namespace safe_browsing | 188 } // namespace safe_browsing |
| OLD | NEW |