| 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( | 39 std::unique_ptr<IndexedDBTransaction> |
| 40 IndexedDBClassFactory::CreateIndexedDBTransaction( |
| 40 int64_t id, | 41 int64_t id, |
| 41 base::WeakPtr<IndexedDBConnection> connection, | 42 IndexedDBConnection* connection, |
| 42 const std::set<int64_t>& scope, | 43 const std::set<int64_t>& scope, |
| 43 blink::WebIDBTransactionMode mode, | 44 blink::WebIDBTransactionMode mode, |
| 44 IndexedDBBackingStore::Transaction* backing_store_transaction) { | 45 IndexedDBBackingStore::Transaction* backing_store_transaction) { |
| 45 // The transaction adds itself to |connection|'s database's transaction | 46 return std::unique_ptr<IndexedDBTransaction>(new IndexedDBTransaction( |
| 46 // coordinator, which owns the object. | 47 id, connection, scope, mode, backing_store_transaction)); |
| 47 IndexedDBTransaction* transaction = new IndexedDBTransaction( | |
| 48 id, std::move(connection), scope, mode, backing_store_transaction); | |
| 49 return transaction; | |
| 50 } | 48 } |
| 51 | 49 |
| 52 scoped_refptr<LevelDBTransaction> | 50 scoped_refptr<LevelDBTransaction> |
| 53 IndexedDBClassFactory::CreateLevelDBTransaction(LevelDBDatabase* db) { | 51 IndexedDBClassFactory::CreateLevelDBTransaction(LevelDBDatabase* db) { |
| 54 return new LevelDBTransaction(db); | 52 return new LevelDBTransaction(db); |
| 55 } | 53 } |
| 56 | 54 |
| 57 std::unique_ptr<LevelDBIteratorImpl> IndexedDBClassFactory::CreateIteratorImpl( | 55 std::unique_ptr<LevelDBIteratorImpl> IndexedDBClassFactory::CreateIteratorImpl( |
| 58 std::unique_ptr<leveldb::Iterator> iterator) { | 56 std::unique_ptr<leveldb::Iterator> iterator) { |
| 59 return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator))); | 57 return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator))); |
| 60 } | 58 } |
| 61 | 59 |
| 62 } // namespace content | 60 } // namespace content |
| OLD | NEW |