Index: third_party/mojo/src/mojo/edk/system/endpoint_relayer.h |
diff --git a/third_party/mojo/src/mojo/edk/system/endpoint_relayer.h b/third_party/mojo/src/mojo/edk/system/endpoint_relayer.h |
index cfeda2405ea19d309aaf0b8609c51e25e0c16bad..8b17a50b78c85343051f338c8821dfe6429d135c 100644 |
--- a/third_party/mojo/src/mojo/edk/system/endpoint_relayer.h |
+++ b/third_party/mojo/src/mojo/edk/system/endpoint_relayer.h |
@@ -7,8 +7,8 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/synchronization/lock.h" |
#include "mojo/edk/system/channel_endpoint_client.h" |
-#include "mojo/edk/system/mutex.h" |
#include "mojo/edk/system/system_impl_export.h" |
#include "mojo/public/cpp/system/macros.h" |
@@ -68,8 +68,7 @@ |
static unsigned GetPeerPort(unsigned port); |
// Initialize this object. This must be called before any other method. |
- void Init(ChannelEndpoint* endpoint0, |
- ChannelEndpoint* endpoint1) MOJO_NOT_THREAD_SAFE; |
+ void Init(ChannelEndpoint* endpoint0, ChannelEndpoint* endpoint1); |
// Sets (or resets) the filter, which can (optionally) handle/filter |
// |Type::ENDPOINT_CLIENT| messages (see |Filter| above). |
@@ -82,9 +81,11 @@ |
private: |
~EndpointRelayer() override; |
- Mutex mutex_; |
- scoped_refptr<ChannelEndpoint> endpoints_[2] MOJO_GUARDED_BY(mutex_); |
- scoped_ptr<Filter> filter_ MOJO_GUARDED_BY(mutex_); |
+ // TODO(vtl): We could probably get away without the lock if we had a |
+ // thread-safe |scoped_refptr|. |
+ base::Lock lock_; // Protects the following members. |
+ scoped_refptr<ChannelEndpoint> endpoints_[2]; |
+ scoped_ptr<Filter> filter_; |
MOJO_DISALLOW_COPY_AND_ASSIGN(EndpointRelayer); |
}; |