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

Unified Diff: components/login/screens/screen_context.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 7 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: components/login/screens/screen_context.cc
diff --git a/components/login/screens/screen_context.cc b/components/login/screens/screen_context.cc
index 3473d9c3fcab7fc5f1445f9540f9d2a83f64a612..343570b87f8c1c768381f457e5a3188c1d30d497 100644
--- a/components/login/screens/screen_context.cc
+++ b/components/login/screens/screen_context.cc
@@ -5,8 +5,10 @@
#include "components/login/screens/screen_context.h"
#include <memory>
+#include <utility>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
namespace login {
@@ -177,8 +179,8 @@ bool ScreenContext::Set(const KeyType& key, base::Value* value) {
if (in_storage && new_value->Equals(current_value))
return false;
- changes_.Set(key, new_value->DeepCopy());
- storage_.Set(key, new_value.release());
+ changes_.Set(key, base::MakeUnique<base::Value>(*new_value));
+ storage_.Set(key, std::move(new_value));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698