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

Unified Diff: content/browser/indexed_db/database_impl.h

Issue 2727733004: [IndexedDB] Closing mojo connections when renderer quits (Closed)
Patch Set: comments Created 3 years, 8 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 | « content/browser/indexed_db/cursor_impl.cc ('k') | content/browser/indexed_db/database_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/database_impl.h
diff --git a/content/browser/indexed_db/database_impl.h b/content/browser/indexed_db/database_impl.h
index bb5e9f0fb7183d1af51906332899f9e3760188be..e0bb02978bc66ecd1b4bd16a571e610898a9aefd 100644
--- a/content/browser/indexed_db/database_impl.h
+++ b/content/browser/indexed_db/database_impl.h
@@ -9,16 +9,22 @@
#include "base/memory/ref_counted.h"
#include "content/common/indexed_db/indexed_db.mojom.h"
+namespace base {
+class SequencedTaskRunner;
+}
+
namespace content {
class IndexedDBConnection;
class IndexedDBDispatcherHost;
+// Expected to be constructed, called, and destructed on the IO thread.
class DatabaseImpl : public ::indexed_db::mojom::Database {
public:
explicit DatabaseImpl(std::unique_ptr<IndexedDBConnection> connection,
const url::Origin& origin,
- scoped_refptr<IndexedDBDispatcherHost> dispatcher_host);
+ IndexedDBDispatcherHost* dispatcher_host,
+ scoped_refptr<base::SequencedTaskRunner> idb_runner);
~DatabaseImpl() override;
// ::indexed_db::mojom::Database implementation
@@ -60,7 +66,7 @@ class DatabaseImpl : public ::indexed_db::mojom::Database {
::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override;
void Put(int64_t transaction_id,
int64_t object_store_id,
- indexed_db::mojom::ValuePtr value,
+ ::indexed_db::mojom::ValuePtr value,
const IndexedDBKey& key,
blink::WebIDBPutMode mode,
const std::vector<IndexedDBIndexKeys>& index_keys,
@@ -118,9 +124,11 @@ class DatabaseImpl : public ::indexed_db::mojom::Database {
class IDBThreadHelper;
IDBThreadHelper* helper_;
- scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
+ // This raw pointer is safe because all DatabaseImpl instances are owned by
+ // an IndexedDBDispatcherHost.
+ IndexedDBDispatcherHost* dispatcher_host_;
const url::Origin origin_;
- scoped_refptr<base::SingleThreadTaskRunner> idb_runner_;
+ scoped_refptr<base::SequencedTaskRunner> idb_runner_;
DISALLOW_COPY_AND_ASSIGN(DatabaseImpl);
};
« no previous file with comments | « content/browser/indexed_db/cursor_impl.cc ('k') | content/browser/indexed_db/database_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698