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

Unified Diff: extensions/browser/value_store/leveldb_scoped_database.cc

Issue 1909773002: Convert //extensions/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
Index: extensions/browser/value_store/leveldb_scoped_database.cc
diff --git a/extensions/browser/value_store/leveldb_scoped_database.cc b/extensions/browser/value_store/leveldb_scoped_database.cc
index 2fb8a9b77eaf8660c56b31371f8b6e2a57f9fd4f..a66e53aa3d26276fc28bb299437fb38a29be0ef6 100644
--- a/extensions/browser/value_store/leveldb_scoped_database.cc
+++ b/extensions/browser/value_store/leveldb_scoped_database.cc
@@ -49,9 +49,10 @@ LeveldbScopedDatabase::LeveldbScopedDatabase(const std::string& uma_client_name,
LeveldbScopedDatabase::~LeveldbScopedDatabase() {}
-ValueStore::Status LeveldbScopedDatabase::Read(const std::string& scope,
- const std::string& key,
- scoped_ptr<base::Value>* value) {
+ValueStore::Status LeveldbScopedDatabase::Read(
+ const std::string& scope,
+ const std::string& key,
+ std::unique_ptr<base::Value>* value) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
ValueStore::Status status = EnsureDbIsOpen();
@@ -76,16 +77,16 @@ ValueStore::Status LeveldbScopedDatabase::Read(const std::string& scope,
if (!CreateKey(scope, "", &prefix))
return ValueStore::Status(ValueStore::OTHER_ERROR, kInvalidScope);
- scoped_ptr<leveldb::Iterator> it(db()->NewIterator(read_options()));
+ std::unique_ptr<leveldb::Iterator> it(db()->NewIterator(read_options()));
base::JSONReader json_reader;
- scoped_ptr<base::DictionaryValue> settings(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> settings(new base::DictionaryValue());
for (it->Seek(prefix); it->Valid() && it->key().starts_with(prefix);
it->Next()) {
leveldb::Slice descoped_key(it->key());
descoped_key.remove_prefix(prefix.size());
- scoped_ptr<base::Value> value = json_reader.Read(
+ std::unique_ptr<base::Value> value = json_reader.Read(
base::StringPiece(it->value().data(), it->value().size()));
if (!value) {
return ValueStore::Status(ValueStore::CORRUPTION,

Powered by Google App Engine
This is Rietveld 408576698