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

Side by Side Diff: extensions/browser/value_store/leveldb_scoped_database.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef EXTENSIONS_BROWSER_VALUE_STORE_LEVELDB_SCOPED_DATABASE_H_ 5 #ifndef EXTENSIONS_BROWSER_VALUE_STORE_LEVELDB_SCOPED_DATABASE_H_
6 #define EXTENSIONS_BROWSER_VALUE_STORE_LEVELDB_SCOPED_DATABASE_H_ 6 #define EXTENSIONS_BROWSER_VALUE_STORE_LEVELDB_SCOPED_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 28 matching lines...) Expand all
39 static bool CreateKey(const std::string& scope, 39 static bool CreateKey(const std::string& scope,
40 const std::string& key, 40 const std::string& key,
41 std::string* scoped_key); 41 std::string* scoped_key);
42 42
43 LeveldbScopedDatabase(const std::string& uma_client_name, 43 LeveldbScopedDatabase(const std::string& uma_client_name,
44 const base::FilePath& path); 44 const base::FilePath& path);
45 45
46 // Reads a single |value| from the database for the specified |key|. 46 // Reads a single |value| from the database for the specified |key|.
47 ValueStore::Status Read(const std::string& scope, 47 ValueStore::Status Read(const std::string& scope,
48 const std::string& key, 48 const std::string& key,
49 scoped_ptr<base::Value>* value); 49 std::unique_ptr<base::Value>* value);
50 50
51 // Reads all |values| from the database stored within the specified |scope|. 51 // Reads all |values| from the database stored within the specified |scope|.
52 ValueStore::Status Read(const std::string& scope, 52 ValueStore::Status Read(const std::string& scope,
53 base::DictionaryValue* values); 53 base::DictionaryValue* values);
54 54
55 // Writes a single |key| => |value| to the database. 55 // Writes a single |key| => |value| to the database.
56 ValueStore::Status Write(const std::string& scope, 56 ValueStore::Status Write(const std::string& scope,
57 const std::string& key, 57 const std::string& key,
58 const base::Value& value); 58 const base::Value& value);
59 59
(...skipping 12 matching lines...) Expand all
72 static ValueStore::Status AddToWriteBatch(leveldb::WriteBatch* batch, 72 static ValueStore::Status AddToWriteBatch(leveldb::WriteBatch* batch,
73 const std::string& scope, 73 const std::string& scope,
74 const std::string& key, 74 const std::string& key,
75 const base::Value& value); 75 const base::Value& value);
76 76
77 private: 77 private:
78 DISALLOW_COPY_AND_ASSIGN(LeveldbScopedDatabase); 78 DISALLOW_COPY_AND_ASSIGN(LeveldbScopedDatabase);
79 }; 79 };
80 80
81 #endif // EXTENSIONS_BROWSER_VALUE_STORE_LEVELDB_SCOPED_DATABASE_H_ 81 #endif // EXTENSIONS_BROWSER_VALUE_STORE_LEVELDB_SCOPED_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698