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

Unified Diff: mojo/edk/system/awakable_list.h

Issue 1748503002: [mojo-edk] Add MojoWatch and MojoCancelWatch APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert RequestContext usage, nits Created 4 years, 10 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/edk/system/BUILD.gn ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/awakable_list.h
diff --git a/mojo/edk/system/awakable_list.h b/mojo/edk/system/awakable_list.h
index 4e788eeb34178b7aa8f69c34663b6ce9bbcd44a3..a80f5d6f8f7c81abd301c1351053c42abf2a95c5 100644
--- a/mojo/edk/system/awakable_list.h
+++ b/mojo/edk/system/awakable_list.h
@@ -5,11 +5,14 @@
#ifndef MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
#define MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
+#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "mojo/edk/system/system_impl_export.h"
+#include "mojo/edk/system/watcher.h"
+#include "mojo/edk/system/watcher_set.h"
#include "mojo/public/c/system/types.h"
#include "mojo/public/cpp/system/macros.h"
@@ -36,6 +39,13 @@ class MOJO_SYSTEM_IMPL_EXPORT AwakableList {
void Add(Awakable* awakable, MojoHandleSignals signals, uintptr_t context);
void Remove(Awakable* awakable);
+ // Add and remove Watchers to this AwakableList.
+ MojoResult AddWatcher(MojoHandleSignals signals,
+ const Watcher::WatchCallback& callback,
+ uintptr_t context,
+ const HandleSignalsState& current_state);
+ MojoResult RemoveWatcher(uintptr_t context);
+
private:
struct AwakeInfo {
AwakeInfo(Awakable* awakable, MojoHandleSignals signals, uintptr_t context)
@@ -49,6 +59,10 @@ class MOJO_SYSTEM_IMPL_EXPORT AwakableList {
AwakeInfoList awakables_;
+ // TODO: Remove AwakableList and instead use WatcherSet directly in
+ // dispatchers.
+ WatcherSet watchers_;
+
MOJO_DISALLOW_COPY_AND_ASSIGN(AwakableList);
};
« no previous file with comments | « mojo/edk/system/BUILD.gn ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698