Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: components/safe_browsing_db/v4_database.cc

Issue 2425703004: Destroy store on task runner. That's where all store operations happen. (Closed)
Patch Set: shess@feedback. WaitForTasksOnTaskRunner at the end of the test that calls ApplyUpdate and expects … Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_database.cc
diff --git a/components/safe_browsing_db/v4_database.cc b/components/safe_browsing_db/v4_database.cc
index 30a3b0f538d5756e5314329a88cdfb9a5f0191dd..4b43498c5abf4bd2139d42ca51ef8528738694ef 100644
--- a/components/safe_browsing_db/v4_database.cc
+++ b/components/safe_browsing_db/v4_database.cc
@@ -142,7 +142,9 @@ void V4Database::UpdatedStoreReady(ListIdentifier identifier,
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(pending_store_updates_);
if (new_store) {
- (*store_map_)[identifier] = std::move(new_store);
+ (*store_map_)[identifier].swap(new_store);
+ // |new_store| now is the store that needs to be destroyed on task runner.
+ V4Store::Destroy(std::move(new_store));
}
pending_store_updates_--;
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698