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

Unified Diff: content/child/indexed_db/indexed_db_dispatcher.cc

Issue 2521773003: Revert of [IndexedDB] Delete callbacks state on worker thread exit. (Closed)
Patch Set: Created 4 years, 1 month 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 | « content/child/indexed_db/indexed_db_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/indexed_db/indexed_db_dispatcher.cc
diff --git a/content/child/indexed_db/indexed_db_dispatcher.cc b/content/child/indexed_db/indexed_db_dispatcher.cc
index a014c96391a6c6003abe8c12d10992e5d9dfbb43..aafd24419d65f749c47d08f81e01134920406d48 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -196,28 +196,24 @@
void IndexedDBDispatcher::RegisterMojoOwnedCallbacks(
IndexedDBCallbacksImpl::InternalState* callbacks) {
- mojo_owned_callback_state_[callbacks] = base::WrapUnique(callbacks);
+ mojo_owned_callback_state_.insert(callbacks);
}
void IndexedDBDispatcher::UnregisterMojoOwnedCallbacks(
IndexedDBCallbacksImpl::InternalState* callbacks) {
- auto it = mojo_owned_callback_state_.find(callbacks);
- DCHECK(it != mojo_owned_callback_state_.end());
- it->second.release();
- mojo_owned_callback_state_.erase(it);
+ DCHECK(base::ContainsValue(mojo_owned_callback_state_, callbacks));
+ mojo_owned_callback_state_.erase(callbacks);
}
void IndexedDBDispatcher::RegisterMojoOwnedDatabaseCallbacks(
blink::WebIDBDatabaseCallbacks* callbacks) {
- mojo_owned_database_callback_state_[callbacks] = base::WrapUnique(callbacks);
+ mojo_owned_database_callback_state_.insert(callbacks);
}
void IndexedDBDispatcher::UnregisterMojoOwnedDatabaseCallbacks(
blink::WebIDBDatabaseCallbacks* callbacks) {
- auto it = mojo_owned_database_callback_state_.find(callbacks);
- DCHECK(it != mojo_owned_database_callback_state_.end());
- it->second.release();
- mojo_owned_database_callback_state_.erase(it);
+ DCHECK(base::ContainsValue(mojo_owned_database_callback_state_, callbacks));
+ mojo_owned_database_callback_state_.erase(callbacks);
}
// Populate some WebIDBValue members (data & blob info) from the supplied
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698