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

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

Issue 2400563002: Adds Mojo IDL. (Closed)
Patch Set: uses WebTaskRunner 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: 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..fe6e193d1a500872e08a14d49aeb186f3813b5a2
--- /dev/null
+++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
@@ -0,0 +1,64 @@
+// Copyright 2017 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/ActiveScriptWrappable.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/core/v8/TraceWrapperMember.h"
+#include "core/dom/ContextLifecycleObserver.h"
+#include "mojo/public/cpp/system/handle.h"
+
+namespace blink {
+
+class ExecutionContext;
+class MojoHandleSignals;
+class MojoWatchCallback;
+
+class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>,
+ public ActiveScriptWrappable<MojoWatcher>,
+ public ScriptWrappable,
+ public ContextLifecycleObserver {
+ DEFINE_WRAPPERTYPEINFO();
+ USING_GARBAGE_COLLECTED_MIXIN(MojoWatcher);
+
+ public:
+ static MojoWatcher* create(mojo::Handle,
+ const MojoHandleSignals&,
+ MojoWatchCallback*,
+ ExecutionContext*);
+ ~MojoWatcher();
+
+ MojoResult cancel();
+
+ DECLARE_TRACE();
+ DECLARE_TRACE_WRAPPERS();
+
+ // ActiveScriptWrappable
+ bool hasPendingActivity() const final;
+
+ // ContextLifecycleObserver
+ void contextDestroyed(ExecutionContext*) final;
+
+ private:
+ friend class V8MojoWatcher;
+
+ MojoWatcher(ExecutionContext*, MojoWatchCallback*);
+ MojoResult watch(mojo::Handle, const MojoHandleSignals&);
+
+ static void onHandleReady(uintptr_t context,
+ MojoResult,
+ MojoHandleSignalsState,
+ MojoWatchNotificationFlags);
+ void runReadyCallback(MojoResult);
+
+ RefPtr<WebTaskRunner> m_taskRunner;
+ TraceWrapperMember<MojoWatchCallback> m_callback;
+ mojo::Handle m_handle;
+};
+
+} // namespace blink
+
+#endif // MojoWatcher_h
« no previous file with comments | « third_party/WebKit/Source/core/mojo/MojoReadMessageResult.idl ('k') | third_party/WebKit/Source/core/mojo/MojoWatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698