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

Unified Diff: base/supports_user_data.h

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 | « no previous file | base/supports_user_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/supports_user_data.h
diff --git a/base/supports_user_data.h b/base/supports_user_data.h
index a4c7c9fc890bac0692e0d3771a97b9f9c1df401f..233ce38ce2d952430f3f0b0fb3984323c0d00e3e 100644
--- a/base/supports_user_data.h
+++ b/base/supports_user_data.h
@@ -37,8 +37,11 @@ class BASE_EXPORT SupportsUserData {
// Multiple user data values can be stored under different keys.
// This object will TAKE OWNERSHIP of the given data pointer, and will
// delete the object if it is changed or the object is destroyed.
+ // TODO: remove the raw ptr version of SetUserData once everything uses
+ // the unique_ptr version, see crbug.com/690937.
Data* GetUserData(const void* key) const;
void SetUserData(const void* key, Data* data);
+ void SetUserData(const void* key, std::unique_ptr<Data> data);
void RemoveUserData(const void* key);
// SupportsUserData is not thread-safe, and on debug build will assert it is
« no previous file with comments | « no previous file | base/supports_user_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698