| 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_factory.h" | 10 #include "content/browser/indexed_db/indexed_db_factory.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 scoped_refptr<IndexedDBDatabase> IndexedDBClassFactory::CreateIndexedDBDatabase( | 32 scoped_refptr<IndexedDBDatabase> IndexedDBClassFactory::CreateIndexedDBDatabase( |
| 33 const base::string16& name, | 33 const base::string16& name, |
| 34 scoped_refptr<IndexedDBBackingStore> backing_store, | 34 scoped_refptr<IndexedDBBackingStore> backing_store, |
| 35 scoped_refptr<IndexedDBFactory> factory, | 35 scoped_refptr<IndexedDBFactory> factory, |
| 36 const IndexedDBDatabase::Identifier& unique_identifier) { | 36 const IndexedDBDatabase::Identifier& unique_identifier) { |
| 37 return new IndexedDBDatabase(name, backing_store, factory, unique_identifier); | 37 return new IndexedDBDatabase(name, backing_store, factory, unique_identifier); |
| 38 } | 38 } |
| 39 | 39 |
| 40 IndexedDBTransaction* IndexedDBClassFactory::CreateIndexedDBTransaction( | 40 std::unique_ptr<IndexedDBTransaction> |
| 41 IndexedDBClassFactory::CreateIndexedDBTransaction( |
| 41 int64_t id, | 42 int64_t id, |
| 42 base::WeakPtr<IndexedDBConnection> connection, | 43 IndexedDBConnection* connection, |
| 43 const std::set<int64_t>& scope, | 44 const std::set<int64_t>& scope, |
| 44 blink::WebIDBTransactionMode mode, | 45 blink::WebIDBTransactionMode mode, |
| 45 IndexedDBBackingStore::Transaction* backing_store_transaction) { | 46 IndexedDBBackingStore::Transaction* backing_store_transaction) { |
| 46 // The transaction adds itself to |connection|'s database's transaction | 47 return std::unique_ptr<IndexedDBTransaction>(new IndexedDBTransaction( |
| 47 // coordinator, which owns the object. | 48 id, connection, scope, mode, backing_store_transaction)); |
| 48 IndexedDBTransaction* transaction = new IndexedDBTransaction( | |
| 49 id, std::move(connection), scope, mode, backing_store_transaction); | |
| 50 return transaction; | |
| 51 } | 49 } |
| 52 | 50 |
| 53 scoped_refptr<LevelDBTransaction> | 51 scoped_refptr<LevelDBTransaction> |
| 54 IndexedDBClassFactory::CreateLevelDBTransaction(LevelDBDatabase* db) { | 52 IndexedDBClassFactory::CreateLevelDBTransaction(LevelDBDatabase* db) { |
| 55 return new LevelDBTransaction(db); | 53 return new LevelDBTransaction(db); |
| 56 } | 54 } |
| 57 | 55 |
| 58 std::unique_ptr<LevelDBIteratorImpl> IndexedDBClassFactory::CreateIteratorImpl( | 56 std::unique_ptr<LevelDBIteratorImpl> IndexedDBClassFactory::CreateIteratorImpl( |
| 59 std::unique_ptr<leveldb::Iterator> iterator) { | 57 std::unique_ptr<leveldb::Iterator> iterator) { |
| 60 return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator))); | 58 return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator))); |
| 61 } | 59 } |
| 62 | 60 |
| 63 } // namespace content | 61 } // namespace content |
| OLD | NEW |