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

Unified Diff: third_party/WebKit/Source/core/mojo/MojoHandle.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/MojoHandle.h
diff --git a/third_party/WebKit/Source/core/mojo/MojoHandle.h b/third_party/WebKit/Source/core/mojo/MojoHandle.h
new file mode 100644
index 0000000000000000000000000000000000000000..efb2e111040b7de09cb47f8fd321adac04ff69ef
--- /dev/null
+++ b/third_party/WebKit/Source/core/mojo/MojoHandle.h
@@ -0,0 +1,58 @@
+// 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 MojoHandle_h
+#define MojoHandle_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "mojo/public/cpp/system/core.h"
+
+namespace blink {
+
+class MojoReadMessageOptions;
+class MojoReadMessageResult;
+class MojoWatchCallback;
+class MojoWatcher;
+class MojoWriteMessageOptions;
+class ScriptState;
+
+class MojoHandle final : public GarbageCollectedFinalized<MojoHandle>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ CORE_EXPORT static MojoHandle* create(mojo::ScopedHandle);
+
+ static const MojoHandleSignals kHandleSignalNone = MOJO_HANDLE_SIGNAL_NONE;
+ static const MojoHandleSignals kHandleSignalReadable =
+ MOJO_HANDLE_SIGNAL_READABLE;
+ static const MojoHandleSignals kHandleSignalWritable =
+ MOJO_HANDLE_SIGNAL_WRITABLE;
+ static const MojoHandleSignals kHandleSignalPeerClosed =
+ MOJO_HANDLE_SIGNAL_PEER_CLOSED;
+
+ static const MojoWriteMessageFlags kWriteMessageFlagNone =
+ MOJO_WRITE_MESSAGE_FLAG_NONE;
+
+ static const MojoReadMessageFlags kReadMessageFlagNone =
+ MOJO_READ_MESSAGE_FLAG_NONE;
+ static const MojoReadMessageFlags kReadMessageFlagMayDiscard =
+ MOJO_READ_MESSAGE_FLAG_MAY_DISCARD;
+
+ MojoResult close();
+ MojoWatcher* watch(ScriptState*, MojoHandleSignals, MojoWatchCallback*);
+ MojoResult writeMessage(const MojoWriteMessageOptions&);
+ void readMessage(const MojoReadMessageOptions&, MojoReadMessageResult&);
+
+ DEFINE_INLINE_TRACE() {}
+
+ private:
+ explicit MojoHandle(mojo::ScopedHandle);
+
+ mojo::ScopedHandle m_handle;
+};
+
+} // namespace blink
+
+#endif // MojoHandle_h

Powered by Google App Engine
This is Rietveld 408576698