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..2a76cff557ed0cb02919f63339cce3a6f92b03a2 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h |
@@ -0,0 +1,53 @@ |
+// 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 "mojo/public/cpp/system/handle.h" |
+ |
+namespace blink { |
+ |
+class MojoWatchCallback; |
+class ScriptState; |
+class WebTaskRunner; |
+ |
+class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>, |
+ public ScriptWrappable { |
+ DEFINE_WRAPPERTYPEINFO(); |
+ |
+ public: |
+ static MojoWatcher* create(mojo::Handle, |
+ MojoHandleSignals, |
+ ScriptState*, |
+ MojoWatchCallback*); |
+ virtual ~MojoWatcher(); |
+ |
+ MojoResult cancel(); |
+ |
+ DECLARE_TRACE(); |
+ |
+ private: |
+ class RunReadyCallbackTask; |
+ |
+ MojoWatcher(mojo::Handle, |
+ ScriptState*, |
+ MojoWatchCallback*, |
+ std::unique_ptr<WebTaskRunner>); |
+ static void onHandleReady(uintptr_t, |
+ MojoResult, |
+ MojoHandleSignalsState, |
+ MojoWatchNotificationFlags); |
+ void runReadyCallback(MojoResult); |
+ |
+ mojo::Handle m_handle; |
+ RefPtr<ScriptState> m_scriptState; |
+ Member<MojoWatchCallback> m_callback; |
+ std::unique_ptr<WebTaskRunner> m_taskRunner; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // MojoWatcher_h |