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

Unified Diff: third_party/WebKit/Source/core/mojo/MojoWatcher.h

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: rebase Created 3 years, 9 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: third_party/WebKit/Source/core/mojo/MojoWatcher.h
diff --git a/third_party/WebKit/Source/core/mojo/MojoWatcher.h b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
index fe6e193d1a500872e08a14d49aeb186f3813b5a2..ece74d5ccac5c23632123e719a2e2402566d24c4 100644
--- a/third_party/WebKit/Source/core/mojo/MojoWatcher.h
+++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
@@ -10,6 +10,7 @@
#include "bindings/core/v8/TraceWrapperMember.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "mojo/public/cpp/system/handle.h"
+#include "mojo/public/cpp/system/watcher.h"
namespace blink {
@@ -47,16 +48,21 @@ class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>,
MojoWatcher(ExecutionContext*, MojoWatchCallback*);
MojoResult watch(mojo::Handle, const MojoHandleSignals&);
+ MojoResult arm(MojoResult* readyResult);
static void onHandleReady(uintptr_t context,
MojoResult,
MojoHandleSignalsState,
- MojoWatchNotificationFlags);
+ MojoWatcherNotificationFlags);
void runReadyCallback(MojoResult);
RefPtr<WebTaskRunner> m_taskRunner;
TraceWrapperMember<MojoWatchCallback> m_callback;
+ mojo::ScopedWatcherHandle m_watcherHandle;
mojo::Handle m_handle;
+
+ // Cross-thread reference to self, used as the watch context.
+ std::unique_ptr<CrossThreadPersistent<MojoWatcher>> m_context;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698