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

Side by Side 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: updated unittests 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/indexed_db/indexed_db_class_factory.h" 5 #include "content/browser/indexed_db/indexed_db_class_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/indexed_db/indexed_db_transaction.h" 10 #include "content/browser/indexed_db/indexed_db_transaction.h"
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 scoped_refptr<IndexedDBDatabase> IndexedDBClassFactory::CreateIndexedDBDatabase( 31 scoped_refptr<IndexedDBDatabase> IndexedDBClassFactory::CreateIndexedDBDatabase(
32 const base::string16& name, 32 const base::string16& name,
33 IndexedDBBackingStore* backing_store, 33 IndexedDBBackingStore* backing_store,
34 IndexedDBFactory* factory, 34 IndexedDBFactory* factory,
35 const IndexedDBDatabase::Identifier& unique_identifier) { 35 const IndexedDBDatabase::Identifier& unique_identifier) {
36 return new IndexedDBDatabase(name, backing_store, factory, unique_identifier); 36 return new IndexedDBDatabase(name, backing_store, factory, unique_identifier);
37 } 37 }
38 38
39 IndexedDBTransaction* IndexedDBClassFactory::CreateIndexedDBTransaction(
40 int64_t id,
41 base::WeakPtr<IndexedDBConnection> connection,
42 const std::set<int64_t>& scope,
43 blink::WebIDBTransactionMode mode,
44 IndexedDBBackingStore::Transaction* backing_store_transaction) {
45 // The transaction adds itself to |connection|'s database's transaction
46 // coordinator, which owns the object.
47 IndexedDBTransaction* transaction = new IndexedDBTransaction(
48 id, std::move(connection), scope, mode, backing_store_transaction);
49 return transaction;
50 }
51
52 scoped_refptr<LevelDBTransaction> 39 scoped_refptr<LevelDBTransaction>
53 IndexedDBClassFactory::CreateLevelDBTransaction(LevelDBDatabase* db) { 40 IndexedDBClassFactory::CreateLevelDBTransaction(LevelDBDatabase* db) {
54 return new LevelDBTransaction(db); 41 return new LevelDBTransaction(db);
55 } 42 }
56 43
57 std::unique_ptr<LevelDBIteratorImpl> IndexedDBClassFactory::CreateIteratorImpl( 44 std::unique_ptr<LevelDBIteratorImpl> IndexedDBClassFactory::CreateIteratorImpl(
58 std::unique_ptr<leveldb::Iterator> iterator) { 45 std::unique_ptr<leveldb::Iterator> iterator) {
59 return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator))); 46 return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator)));
60 } 47 }
61 48
62 } // namespace content 49 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698