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

Unified Diff: third_party/libaddressinput/chromium/chrome_storage_impl.cc

Issue 2516363005: Inline StringValue into base::Value (Closed)
Patch Set: Rebase and Nits. Created 3 years, 11 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 | « skia/ext/benchmarking_canvas.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libaddressinput/chromium/chrome_storage_impl.cc
diff --git a/third_party/libaddressinput/chromium/chrome_storage_impl.cc b/third_party/libaddressinput/chromium/chrome_storage_impl.cc
index e901c2fdfe5c0f43c8844baa830adfa3c78c8af3..4daab334fea40407d775fb39472348e116180c17 100644
--- a/third_party/libaddressinput/chromium/chrome_storage_impl.cc
+++ b/third_party/libaddressinput/chromium/chrome_storage_impl.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "components/prefs/writeable_pref_store.h"
#include "third_party/libaddressinput/chromium/fallback_data_store.h"
@@ -24,11 +25,9 @@ ChromeStorageImpl::~ChromeStorageImpl() {}
void ChromeStorageImpl::Put(const std::string& key, std::string* data) {
DCHECK(data);
std::unique_ptr<std::string> owned_data(data);
- std::unique_ptr<base::StringValue> string_value(
- new base::StringValue(std::string()));
- string_value->GetString()->swap(*owned_data);
- backing_store_->SetValue(key, std::move(string_value),
- WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
+ backing_store_->SetValue(
+ key, base::MakeUnique<base::StringValue>(std::move(*owned_data)),
+ WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
}
void ChromeStorageImpl::Get(const std::string& key,
« no previous file with comments | « skia/ext/benchmarking_canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698