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

Unified Diff: mojo/public/cpp/bindings/sync_handle_registry.h

Issue 2664483002: Support sync mojo IPCs to and from bindings running on a sequence.
Patch Set: Created 3 years, 11 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 | « mojo/public/cpp/bindings/lib/sync_handle_watcher.cc ('k') | mojo/public/cpp/bindings/sync_handle_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/sync_handle_registry.h
diff --git a/mojo/public/cpp/bindings/sync_handle_registry.h b/mojo/public/cpp/bindings/sync_handle_registry.h
index b5415af80dfb64fa20b453b14262e1cc40264a7f..881082ece30a04f31e71cf3a7a38bee7ebc82c4b 100644
--- a/mojo/public/cpp/bindings/sync_handle_registry.h
+++ b/mojo/public/cpp/bindings/sync_handle_registry.h
@@ -10,20 +10,20 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/threading/thread_checker.h"
+#include "base/sequence_checker.h"
#include "mojo/public/cpp/bindings/bindings_export.h"
#include "mojo/public/cpp/system/core.h"
namespace mojo {
-// SyncHandleRegistry is a thread-local storage to register handles that want to
-// be watched together.
+// SyncHandleRegistry is a sequence-local storage to register handles that want
+// to be watched together.
//
// This class is not thread safe.
class MOJO_CPP_BINDINGS_EXPORT SyncHandleRegistry
- : public base::RefCounted<SyncHandleRegistry> {
+ : public base::RefCountedThreadSafe<SyncHandleRegistry> {
public:
- // Returns a thread-local object.
+ // Returns a sequence-local object.
static scoped_refptr<SyncHandleRegistry> current();
using HandleCallback = base::Callback<void(MojoResult)>;
@@ -41,7 +41,7 @@ class MOJO_CPP_BINDINGS_EXPORT SyncHandleRegistry
bool WatchAllHandles(const bool* should_stop[], size_t count);
private:
- friend class base::RefCounted<SyncHandleRegistry>;
+ friend class base::RefCountedThreadSafe<SyncHandleRegistry>;
struct HandleHasher {
size_t operator()(const Handle& handle) const {
@@ -57,7 +57,7 @@ class MOJO_CPP_BINDINGS_EXPORT SyncHandleRegistry
ScopedHandle wait_set_handle_;
- base::ThreadChecker thread_checker_;
+ base::SequenceChecker sequence_checker_;
DISALLOW_COPY_AND_ASSIGN(SyncHandleRegistry);
};
« no previous file with comments | « mojo/public/cpp/bindings/lib/sync_handle_watcher.cc ('k') | mojo/public/cpp/bindings/sync_handle_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698