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: mojo/public/go/bindings/interface.go

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « mojo/public/go/bindings/encoder.go ('k') | mojo/public/go/bindings/invalid_handle.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/go/bindings/interface.go
diff --git a/mojo/public/go/bindings/interface.go b/mojo/public/go/bindings/interface.go
deleted file mode 100644
index e95324b5de4aabd82f08fc81a1586698f2284af8..0000000000000000000000000000000000000000
--- a/mojo/public/go/bindings/interface.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015 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.
-
-package bindings
-
-import (
- "fmt"
- "mojo/public/go/system"
-)
-
-// MessagePipeHandleOwner owns a message pipe handle, it can only pass it
-// invalidating itself or close it.
-type MessagePipeHandleOwner struct {
- handle system.MessagePipeHandle
-}
-
-// PassMessagePipe passes ownership of the underlying message pipe handle to
-// the newly created handle object, invalidating the underlying handle object
-// in the process.
-func (o *MessagePipeHandleOwner) PassMessagePipe() system.MessagePipeHandle {
- if o.handle == nil {
- return &InvalidHandle{}
- }
- return o.handle.ToUntypedHandle().ToMessagePipeHandle()
-}
-
-// Close closes the underlying handle.
-func (o *MessagePipeHandleOwner) Close() {
- if o.handle != nil {
- o.handle.Close()
- }
-}
-
-// NewMessagePipeHandleOwner creates |MessagePipeHandleOwner| that owns the
-// provided message pipe handle.
-func NewMessagePipeHandleOwner(handle system.MessagePipeHandle) MessagePipeHandleOwner {
- return MessagePipeHandleOwner{handle}
-}
-
-// InterfaceRequest represents a request from a remote client for an
-// implementation of mojo interface over a specified message pipe. The
-// implementor of the interface should remove the message pipe by calling
-// PassMessagePipe() and attach it to the implementation.
-type InterfaceRequest struct {
- MessagePipeHandleOwner
-}
-
-// InterfacePointer owns a message pipe handle with an implementation of mojo
-// interface attached to the other end of the message pipe. The client of the
-// interface should remove the message pipe by calling PassMessagePipe() and
-// attach it to the proxy.
-type InterfacePointer struct {
- MessagePipeHandleOwner
-}
-
-// CreateMessagePipeForInterface creates a message pipe with interface request
-// on one end and interface pointer on the other end. The interface request
-// should be attached to appropriate mojo interface implementation and
-// the interface pointer should be attached to mojo interface proxy.
-func CreateMessagePipeForMojoInterface() (InterfaceRequest, InterfacePointer) {
- r, h0, h1 := system.GetCore().CreateMessagePipe(nil)
- if r != system.MOJO_RESULT_OK {
- panic(fmt.Sprintf("can't create a message pipe: %v", r))
- }
- return InterfaceRequest{MessagePipeHandleOwner{h0}}, InterfacePointer{MessagePipeHandleOwner{h1}}
-}
« no previous file with comments | « mojo/public/go/bindings/encoder.go ('k') | mojo/public/go/bindings/invalid_handle.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698