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

Unified Diff: content/browser/indexed_db/indexed_db_class_factory.cc

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: comments & rebase 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
Index: content/browser/indexed_db/indexed_db_class_factory.cc
diff --git a/content/browser/indexed_db/indexed_db_class_factory.cc b/content/browser/indexed_db/indexed_db_class_factory.cc
index b1a7fce34e941f5f8c626c172b255073cfa5f14f..b655c6bb89980f570305b959776a83baabf04161 100644
--- a/content/browser/indexed_db/indexed_db_class_factory.cc
+++ b/content/browser/indexed_db/indexed_db_class_factory.cc
@@ -36,17 +36,15 @@ scoped_refptr<IndexedDBDatabase> IndexedDBClassFactory::CreateIndexedDBDatabase(
return new IndexedDBDatabase(name, backing_store, factory, unique_identifier);
}
-IndexedDBTransaction* IndexedDBClassFactory::CreateIndexedDBTransaction(
+std::unique_ptr<IndexedDBTransaction>
+IndexedDBClassFactory::CreateIndexedDBTransaction(
int64_t id,
- base::WeakPtr<IndexedDBConnection> connection,
+ IndexedDBConnection* connection,
const std::set<int64_t>& scope,
blink::WebIDBTransactionMode mode,
IndexedDBBackingStore::Transaction* backing_store_transaction) {
- // The transaction adds itself to |connection|'s database's transaction
- // coordinator, which owns the object.
- IndexedDBTransaction* transaction = new IndexedDBTransaction(
- id, std::move(connection), scope, mode, backing_store_transaction);
- return transaction;
+ return std::unique_ptr<IndexedDBTransaction>(new IndexedDBTransaction(
+ id, connection, scope, mode, backing_store_transaction));
}
scoped_refptr<LevelDBTransaction>

Powered by Google App Engine
This is Rietveld 408576698