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

Side by Side Diff: mojo/public/cpp/bindings/sync_handle_registry.h

Issue 2358133002: Turn //mojo/public/cpp/bindings and //mojo/public/cpp/system into components (Closed)
Patch Set: Fix wording Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
14 #include "mojo/public/cpp/bindings/bindings_export.h"
14 #include "mojo/public/cpp/system/core.h" 15 #include "mojo/public/cpp/system/core.h"
15 16
16 namespace mojo { 17 namespace mojo {
17 18
18 // SyncHandleRegistry is a thread-local storage to register handles that want to 19 // SyncHandleRegistry is a thread-local storage to register handles that want to
19 // be watched together. 20 // be watched together.
20 // 21 //
21 // This class is not thread safe. 22 // This class is not thread safe.
22 class SyncHandleRegistry : public base::RefCounted<SyncHandleRegistry> { 23 class MOJO_CPP_BINDINGS_EXPORT SyncHandleRegistry
24 : public base::RefCounted<SyncHandleRegistry> {
23 public: 25 public:
24 // Returns a thread-local object. 26 // Returns a thread-local object.
25 static scoped_refptr<SyncHandleRegistry> current(); 27 static scoped_refptr<SyncHandleRegistry> current();
26 28
27 using HandleCallback = base::Callback<void(MojoResult)>; 29 using HandleCallback = base::Callback<void(MojoResult)>;
28 bool RegisterHandle(const Handle& handle, 30 bool RegisterHandle(const Handle& handle,
29 MojoHandleSignals handle_signals, 31 MojoHandleSignals handle_signals,
30 const HandleCallback& callback); 32 const HandleCallback& callback);
31 33
32 void UnregisterHandle(const Handle& handle); 34 void UnregisterHandle(const Handle& handle);
(...skipping 23 matching lines...) Expand all
56 ScopedHandle wait_set_handle_; 58 ScopedHandle wait_set_handle_;
57 59
58 base::ThreadChecker thread_checker_; 60 base::ThreadChecker thread_checker_;
59 61
60 DISALLOW_COPY_AND_ASSIGN(SyncHandleRegistry); 62 DISALLOW_COPY_AND_ASSIGN(SyncHandleRegistry);
61 }; 63 };
62 64
63 } // namespace mojo 65 } // namespace mojo
64 66
65 #endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_ 67 #endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/sync_call_restrictions.h ('k') | mojo/public/cpp/bindings/sync_handle_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698