Chromium Code Reviews| Index: mojo/edk/system/waiter.h |
| diff --git a/mojo/edk/system/waiter.h b/mojo/edk/system/waiter.h |
| index 03ada1664302e406c9b226c22b39d628f6b72cb3..50a613b6f84614228931fe048c65ed14e7551ddc 100644 |
| --- a/mojo/edk/system/waiter.h |
| +++ b/mojo/edk/system/waiter.h |
| @@ -10,6 +10,7 @@ |
| #include "base/macros.h" |
| #include "base/synchronization/condition_variable.h" |
| #include "base/synchronization/lock.h" |
| +#include "mojo/edk/system/awakable.h" |
| #include "mojo/edk/system/system_impl_export.h" |
| #include "mojo/public/c/system/types.h" |
| @@ -20,7 +21,7 @@ namespace system { |
| // under other locks, in particular, |Dispatcher::lock_|s, so |Waiter| methods |
| // must never call out to other objects (in particular, |Dispatcher|s). This |
| // class is thread-safe. |
| -class MOJO_SYSTEM_IMPL_EXPORT Waiter { |
| +class MOJO_SYSTEM_IMPL_EXPORT Waiter : public Awakable { |
| public: |
| Waiter(); |
| ~Waiter(); |
|
viettrungluu
2014/12/03 22:31:27
Maybe this should be declared virtual.
(It's not
Hajime Morrita
2014/12/03 22:47:11
Added protected ~Awakable() to make it clear that
|
| @@ -57,7 +58,7 @@ class MOJO_SYSTEM_IMPL_EXPORT Waiter { |
| // Wake the waiter up with the given result and context (or no-op if it's been |
| // woken up already). |
| - void Awake(MojoResult result, uint32_t context); |
| + void Awake(MojoResult result, uintptr_t context) override; |
| private: |
| base::ConditionVariable cv_; // Associated to |lock_|. |
| @@ -70,7 +71,7 @@ class MOJO_SYSTEM_IMPL_EXPORT Waiter { |
| // This is a |uint32_t| because we really only need to store an index (for |
|
viettrungluu
2014/12/03 22:31:27
Remove this comment.
|
| // |MojoWaitMany()|). But in tests, it's convenient to use this for other |
| // purposes (e.g., to distinguish between different wake-up reasons). |
| - uint32_t awake_context_; |
| + uintptr_t awake_context_; |
| DISALLOW_COPY_AND_ASSIGN(Waiter); |
| }; |