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

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

Issue 2114523002: Move more Mojo bindings helpers out of internal namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@group-controller
Patch Set: rebase Created 4 years, 5 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_LIB_SYNC_HANDLE_WATCHER_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_WATCHER_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_HANDLE_WATCHER_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_WATCHER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/threading/thread_checker.h" 10 #include "base/threading/thread_checker.h"
11 #include "mojo/public/cpp/bindings/sync_handle_registry.h" 11 #include "mojo/public/cpp/bindings/sync_handle_registry.h"
12 #include "mojo/public/cpp/system/core.h" 12 #include "mojo/public/cpp/system/core.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace internal {
16 15
17 // SyncHandleWatcher supports watching a handle synchronously. It also supports 16 // SyncHandleWatcher supports watching a handle synchronously. It also supports
18 // registering the handle with a thread-local storage (SyncHandleRegistry), so 17 // registering the handle with a thread-local storage (SyncHandleRegistry), so
19 // that when other SyncHandleWatcher instances on the same thread perform sync 18 // that when other SyncHandleWatcher instances on the same thread perform sync
20 // handle watching, this handle will be watched together. 19 // handle watching, this handle will be watched together.
21 // 20 //
22 // SyncHandleWatcher is used for sync methods. While a sync call is waiting for 21 // SyncHandleWatcher is used for sync methods. While a sync call is waiting for
23 // response, we would like to block the thread. On the other hand, we need 22 // response, we would like to block the thread. On the other hand, we need
24 // incoming sync method requests on the same thread to be able to reenter. We 23 // incoming sync method requests on the same thread to be able to reenter. We
25 // also need master interface endpoints to continue dispatching messages for 24 // also need master interface endpoints to continue dispatching messages for
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 62
64 scoped_refptr<SyncHandleRegistry> registry_; 63 scoped_refptr<SyncHandleRegistry> registry_;
65 64
66 scoped_refptr<base::RefCountedData<bool>> destroyed_; 65 scoped_refptr<base::RefCountedData<bool>> destroyed_;
67 66
68 base::ThreadChecker thread_checker_; 67 base::ThreadChecker thread_checker_;
69 68
70 DISALLOW_COPY_AND_ASSIGN(SyncHandleWatcher); 69 DISALLOW_COPY_AND_ASSIGN(SyncHandleWatcher);
71 }; 70 };
72 71
73 } // namespace internal
74 } // namespace mojo 72 } // namespace mojo
75 73
76 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_HANDLE_WATCHER_H_ 74 #endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_WATCHER_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/public/cpp/bindings/tests/connector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698