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

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

Issue 2400563002: Adds Mojo IDL. (Closed)
Patch Set: addressed comments Created 3 years, 11 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
new file mode 100644
index 0000000000000000000000000000000000000000..c422549425ece6b313b49c44d3a4dbc711071f2c
--- /dev/null
+++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
@@ -0,0 +1,50 @@
+// 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 MojoWatcher_h
+#define MojoWatcher_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/core/v8/TraceWrapperMember.h"
+#include "mojo/public/cpp/system/handle.h"
+
+namespace blink {
+
+class ExecutionContext;
+class MojoWatchCallback;
+
+class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ static MojoWatcher* create(mojo::Handle,
+ MojoHandleSignals,
+ MojoWatchCallback*,
+ ExecutionContext*);
+ ~MojoWatcher();
+
+ MojoResult cancel();
+
+ DEFINE_INLINE_TRACE() {}
+ DECLARE_TRACE_WRAPPERS();
+
+ private:
+ friend class V8MojoWatcher;
+
+ MojoWatcher(mojo::Handle, MojoWatchCallback*, ExecutionContext*);
+ static void onHandleReady(uintptr_t context,
+ MojoResult,
+ MojoHandleSignalsState,
+ MojoWatchNotificationFlags);
+ void runReadyCallback(MojoResult);
+
+ mojo::Handle m_handle;
+ TraceWrapperMember<MojoWatchCallback> m_callback;
+ CrossThreadWeakPersistent<ExecutionContext> m_taskRunner;
+};
+
+} // namespace blink
+
+#endif // MojoWatcher_h

Powered by Google App Engine
This is Rietveld 408576698