| Index: content/child/indexed_db/indexed_db_dispatcher.h
|
| diff --git a/content/child/indexed_db/indexed_db_dispatcher.h b/content/child/indexed_db/indexed_db_dispatcher.h
|
| index f42f4ac8990dabbd6ee9a6ae3384b0c1972f374f..d93efd67d61e861b5cceef283ef4179ebebd4352 100644
|
| --- a/content/child/indexed_db/indexed_db_dispatcher.h
|
| +++ b/content/child/indexed_db/indexed_db_dispatcher.h
|
| @@ -85,6 +85,16 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorReset);
|
| FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId);
|
|
|
| + // Looking up move-only entries in an std::unordered_set and removing them
|
| + // with out freeing them seems to be impossible so use a map instead so that
|
| + // the key type can remain a raw pointer.
|
| + using CallbackStateSet = std::unordered_map<
|
| + IndexedDBCallbacksImpl::InternalState*,
|
| + std::unique_ptr<IndexedDBCallbacksImpl::InternalState>>;
|
| + using DatabaseCallbackStateSet =
|
| + std::unordered_map<blink::WebIDBDatabaseCallbacks*,
|
| + std::unique_ptr<blink::WebIDBDatabaseCallbacks>>;
|
| +
|
| static int32_t CurrentWorkerId() { return WorkerThread::GetCurrentId(); }
|
|
|
| // IDBCallback message handlers.
|
| @@ -99,10 +109,9 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| // destroyed on thread exit if the Mojo pipe is not yet closed. Otherwise the
|
| // object will leak because the thread's task runner is no longer executing
|
| // tasks.
|
| - std::unordered_set<IndexedDBCallbacksImpl::InternalState*>
|
| - mojo_owned_callback_state_;
|
| - std::unordered_set<blink::WebIDBDatabaseCallbacks*>
|
| - mojo_owned_database_callback_state_;
|
| + CallbackStateSet mojo_owned_callback_state_;
|
| + DatabaseCallbackStateSet mojo_owned_database_callback_state_;
|
| + bool in_destructor_ = false;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher);
|
| };
|
|
|