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

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

Issue 2067233002: Revert of Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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.h ('k') | mojo/public/cpp/system/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
deleted file mode 100644
index 6c0701ef6f49cc5754089ba845cf9fd94c17f1fa..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/sync_handle_registry.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_
-
-#include <unordered_map>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/threading/thread_checker.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.
-//
-// This class is not thread safe.
-class SyncHandleRegistry : public base::RefCounted<SyncHandleRegistry> {
- public:
- // Returns a thread-local object.
- static scoped_refptr<SyncHandleRegistry> current();
-
- using HandleCallback = base::Callback<void(MojoResult)>;
- bool RegisterHandle(const Handle& handle,
- MojoHandleSignals handle_signals,
- const HandleCallback& callback);
-
- void UnregisterHandle(const Handle& handle);
-
- // Waits on all the registered handles and runs callbacks synchronously for
- // those ready handles.
- // The method:
- // - returns true when any element of |should_stop| is set to true;
- // - returns false when any error occurs.
- bool WatchAllHandles(const bool* should_stop[], size_t count);
-
- private:
- friend class base::RefCounted<SyncHandleRegistry>;
-
- struct HandleHasher {
- size_t operator()(const Handle& handle) const {
- return std::hash<uint32_t>()(static_cast<uint32_t>(handle.value()));
- }
- };
- using HandleMap = std::unordered_map<Handle, HandleCallback, HandleHasher>;
-
- SyncHandleRegistry();
- ~SyncHandleRegistry();
-
- HandleMap handles_;
-
- ScopedHandle wait_set_handle_;
-
- base::ThreadChecker thread_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(SyncHandleRegistry);
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_HANDLE_REGISTRY_H_
« no previous file with comments | « mojo/public/cpp/bindings/lib/sync_handle_watcher.h ('k') | mojo/public/cpp/system/watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698