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

Unified Diff: mojo/edk/system/core.cc

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: . Created 3 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
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index a5e432b8a749f3a2ddc937bcf5a86f392db1baa6..4240bc81d340756c155ccc65ed4e912c90a21157 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -427,24 +427,32 @@ MojoResult Core::WaitMany(const MojoHandle* handles,
return rv;
}
-MojoResult Core::Watch(MojoHandle handle,
- MojoHandleSignals signals,
- MojoWatchCallback callback,
- uintptr_t context) {
+MojoResult Core::RegisterWatcher(MojoHandle handle,
+ MojoHandleSignals signals,
+ MojoWatchCallback callback,
+ uintptr_t context) {
RequestContext request_context;
scoped_refptr<Dispatcher> dispatcher = GetDispatcher(handle);
if (!dispatcher)
return MOJO_RESULT_INVALID_ARGUMENT;
- return dispatcher->Watch(
+ return dispatcher->RegisterWatcher(
signals, base::Bind(&CallWatchCallback, callback, context), context);
}
-MojoResult Core::CancelWatch(MojoHandle handle, uintptr_t context) {
+MojoResult Core::ArmWatcher(MojoHandle handle, uintptr_t context) {
RequestContext request_context;
scoped_refptr<Dispatcher> dispatcher = GetDispatcher(handle);
if (!dispatcher)
return MOJO_RESULT_INVALID_ARGUMENT;
- return dispatcher->CancelWatch(context);
+ return dispatcher->ArmWatcher(context);
+}
+
+MojoResult Core::UnregisterWatcher(MojoHandle handle, uintptr_t context) {
+ RequestContext request_context;
+ scoped_refptr<Dispatcher> dispatcher = GetDispatcher(handle);
+ if (!dispatcher)
+ return MOJO_RESULT_INVALID_ARGUMENT;
+ return dispatcher->UnregisterWatcher(context);
}
MojoResult Core::AllocMessage(uint32_t num_bytes,

Powered by Google App Engine
This is Rietveld 408576698