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

Unified Diff: base/supports_user_data.cc

Issue 2680403004: Update SupportsUserData API to accept std::unique_ptr<>. (Closed)
Patch Set: Add TODO. Created 3 years, 10 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 | « base/supports_user_data.h ('k') | base/supports_user_data_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/supports_user_data.cc
diff --git a/base/supports_user_data.cc b/base/supports_user_data.cc
index d5110555333a0a00ec2c2c93f696524f01ebc591..7065917a50519c29a73be3ac2cdad1685e2ac732 100644
--- a/base/supports_user_data.cc
+++ b/base/supports_user_data.cc
@@ -23,8 +23,13 @@ SupportsUserData::Data* SupportsUserData::GetUserData(const void* key) const {
}
void SupportsUserData::SetUserData(const void* key, Data* data) {
+ SetUserData(key, WrapUnique(data));
+}
+
+void SupportsUserData::SetUserData(const void* key,
+ std::unique_ptr<Data> data) {
DCHECK(sequence_checker_.CalledOnValidSequence());
- user_data_[key] = WrapUnique(data);
+ user_data_[key] = std::move(data);
}
void SupportsUserData::RemoveUserData(const void* key) {
« no previous file with comments | « base/supports_user_data.h ('k') | base/supports_user_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698