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

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

Issue 2233153002: IndexedDB: WrapUnique(new T(args..)) -> MakeUnique<T>(args...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback Created 4 years, 4 months 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
« no previous file with comments | « content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
index ec3ef6d226681a4fffc7200414fb0a3a2f9d6a5c..4740a98bf6d9abdd6e976114513e6eba12439f5c 100644
--- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
+++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
@@ -9,6 +9,7 @@
#include <utility>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "content/browser/indexed_db/indexed_db_transaction.h"
#include "content/browser/indexed_db/leveldb/leveldb_iterator_impl.h"
#include "content/browser/indexed_db/leveldb/leveldb_transaction.h"
@@ -252,7 +253,7 @@ MockBrowserTestIndexedDBClassFactory::MockBrowserTestIndexedDBClassFactory()
MockBrowserTestIndexedDBClassFactory::~MockBrowserTestIndexedDBClassFactory() {
}
-IndexedDBDatabase*
+scoped_refptr<IndexedDBDatabase>
MockBrowserTestIndexedDBClassFactory::CreateIndexedDBDatabase(
const base::string16& name,
IndexedDBBackingStore* backing_store,
@@ -273,7 +274,7 @@ MockBrowserTestIndexedDBClassFactory::CreateIndexedDBTransaction(
backing_store_transaction);
}
-LevelDBTransaction*
+scoped_refptr<LevelDBTransaction>
MockBrowserTestIndexedDBClassFactory::CreateLevelDBTransaction(
LevelDBDatabase* db) {
instance_count_[FAIL_CLASS_LEVELDB_TRANSACTION] =
@@ -295,22 +296,23 @@ MockBrowserTestIndexedDBClassFactory::CreateLevelDBTransaction(
}
}
-LevelDBIteratorImpl* MockBrowserTestIndexedDBClassFactory::CreateIteratorImpl(
+std::unique_ptr<LevelDBIteratorImpl>
+MockBrowserTestIndexedDBClassFactory::CreateIteratorImpl(
std::unique_ptr<leveldb::Iterator> iterator) {
instance_count_[FAIL_CLASS_LEVELDB_ITERATOR] =
instance_count_[FAIL_CLASS_LEVELDB_ITERATOR] + 1;
if (only_trace_calls_) {
- return new LevelDBTraceIteratorImpl(
+ return base::MakeUnique<LevelDBTraceIteratorImpl>(
std::move(iterator), instance_count_[FAIL_CLASS_LEVELDB_ITERATOR]);
} else {
if (failure_class_ == FAIL_CLASS_LEVELDB_ITERATOR &&
instance_count_[FAIL_CLASS_LEVELDB_ITERATOR] ==
fail_on_instance_num_[FAIL_CLASS_LEVELDB_ITERATOR]) {
- return new LevelDBTestIteratorImpl(
+ return base::MakeUnique<LevelDBTestIteratorImpl>(
std::move(iterator), failure_method_,
fail_on_call_num_[FAIL_CLASS_LEVELDB_ITERATOR]);
} else {
- return new LevelDBIteratorImpl(std::move(iterator));
+ return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator)));
}
}
}
« no previous file with comments | « content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698