| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |