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

Unified Diff: extensions/browser/value_store/value_store_change.h

Issue 1940133002: Use std::unique_ptr to transfer base::Value ownership in extensions::ValueStoreChange (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/value_store_change.h
diff --git a/extensions/browser/value_store/value_store_change.h b/extensions/browser/value_store/value_store_change.h
index 28dc3accd994eafcf7c39d3bc57b30ff9df7b3b5..8645b574566a9d249528f29767c726c5523ab090 100644
--- a/extensions/browser/value_store/value_store_change.h
+++ b/extensions/browser/value_store/value_store_change.h
@@ -22,9 +22,9 @@ class ValueStoreChange {
// { "foo": { "key": "foo", "oldValue": "bar", "newValue": "baz" } }
static std::string ToJson(const ValueStoreChangeList& changes);
- // Ownership of |old_value| and |new_value| taken.
- ValueStoreChange(
- const std::string& key, base::Value* old_value, base::Value* new_value);
+ ValueStoreChange(const std::string& key,
+ std::unique_ptr<base::Value> old_value,
+ std::unique_ptr<base::Value> new_value);
ValueStoreChange(const ValueStoreChange& other);
@@ -44,8 +44,9 @@ class ValueStoreChange {
private:
class Inner : public base::RefCountedThreadSafe<Inner> {
public:
- Inner(
- const std::string& key, base::Value* old_value, base::Value* new_value);
+ Inner(const std::string& key,
+ std::unique_ptr<base::Value> old_value,
+ std::unique_ptr<base::Value> new_value);
const std::string key_;
const std::unique_ptr<base::Value> old_value_;
« no previous file with comments | « extensions/browser/value_store/testing_value_store.cc ('k') | extensions/browser/value_store/value_store_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698