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

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

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: cleanup 2 Created 4 years, 2 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..695a09fd3cb82723e78cc4cb12f604e0949b84c6
--- /dev/null
+++ b/third_party/WebKit/Source/core/mojo/MojoHandle.h
@@ -0,0 +1,36 @@
+// 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/handle.h"
+
+namespace blink {
+
+class MojoHandle final : public GarbageCollectedFinalized<MojoHandle>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ CORE_EXPORT static MojoHandle* create(mojo::ScopedHandle);
+ virtual ~MojoHandle();
+
+ ::MojoHandle value() const { return m_handle.get().value(); }
+ mojo::Handle get() const { return m_handle.get(); }
+ mojo::Handle release() { return m_handle.release(); }
+ MojoResult close() { return mojo::CloseRaw(m_handle.release()); }
+
+ 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