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

Unified Diff: base/supports_user_data.h

Issue 2597773002: Make SupportsUserData sequence-affine instead of thread-affine. (Closed)
Patch Set: leave thread_checker.h include for now Created 4 years 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 a9f1c93204866761292625c41a5007ae4503e1f4..a4c7c9fc890bac0692e0d3771a97b9f9c1df401f 100644
--- a/base/supports_user_data.h
+++ b/base/supports_user_data.h
@@ -11,6 +11,10 @@
#include "base/base_export.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/sequence_checker.h"
+
+// TODO(gab): Removing this include causes IWYU failures in other headers,
+// remove it in a follow- up CL.
dcheng 2016/12/22 04:57:55 sob
#include "base/threading/thread_checker.h"
namespace base {
@@ -26,7 +30,7 @@ class BASE_EXPORT SupportsUserData {
// class to any class with a virtual destructor.
class BASE_EXPORT Data {
public:
- virtual ~Data() {}
+ virtual ~Data() = default;
};
// The user data allows the clients to associate data with this object.
@@ -38,10 +42,10 @@ class BASE_EXPORT SupportsUserData {
void RemoveUserData(const void* key);
// SupportsUserData is not thread-safe, and on debug build will assert it is
- // only used on one thread. Calling this method allows the caller to hand
- // the SupportsUserData instance across threads. Use only if you are taking
- // full control of the synchronization of that hand over.
- void DetachUserDataThread();
+ // only used on one execution sequence. Calling this method allows the caller
+ // to hand the SupportsUserData instance across execution sequences. Use only
+ // if you are taking full control of the synchronization of that hand over.
+ void DetachFromSequence();
protected:
virtual ~SupportsUserData();
@@ -52,7 +56,7 @@ class BASE_EXPORT SupportsUserData {
// Externally-defined data accessible by key.
DataMap user_data_;
// Guards usage of |user_data_|
- ThreadChecker thread_checker_;
+ SequenceChecker sequence_checker_;
DISALLOW_COPY_AND_ASSIGN(SupportsUserData);
};
« 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