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

Unified Diff: third_party/mojo/src/mojo/edk/system/endpoint_relayer.h

Issue 1311043003: Update mojo sdk to rev c02a28868825edfa57ab77947b8cb15e741c5598 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
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 8b17a50b78c85343051f338c8821dfe6429d135c..cfeda2405ea19d309aaf0b8609c51e25e0c16bad 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,7 +68,8 @@ class MOJO_SYSTEM_IMPL_EXPORT EndpointRelayer final
static unsigned GetPeerPort(unsigned port);
// Initialize this object. This must be called before any other method.
- void Init(ChannelEndpoint* endpoint0, ChannelEndpoint* endpoint1);
+ void Init(ChannelEndpoint* endpoint0,
+ ChannelEndpoint* endpoint1) MOJO_NOT_THREAD_SAFE;
// Sets (or resets) the filter, which can (optionally) handle/filter
// |Type::ENDPOINT_CLIENT| messages (see |Filter| above).
@@ -81,11 +82,9 @@ class MOJO_SYSTEM_IMPL_EXPORT EndpointRelayer final
private:
~EndpointRelayer() override;
- // 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_;
+ Mutex mutex_;
+ scoped_refptr<ChannelEndpoint> endpoints_[2] MOJO_GUARDED_BY(mutex_);
+ scoped_ptr<Filter> filter_ MOJO_GUARDED_BY(mutex_);
MOJO_DISALLOW_COPY_AND_ASSIGN(EndpointRelayer);
};

Powered by Google App Engine
This is Rietveld 408576698