1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 module sample { 6 7 // This sample shows how handles to MessagePipes can be sent as both parameters 8 // to methods as well as fields on structs. 9 10 struct Request { 11 int32 x; 12 handle<message_pipe> pipe; 13 }; 14 15 struct Response { 16 int32 x; 17 handle<message_pipe> pipe; 18 }; 19 20 [Peer=FactoryClient] 21 interface Factory { 22 void DoStuff(Request request, handle<message_pipe> pipe); 23 }; 24 25 [Peer=Factory] 26 interface FactoryClient { 27 void DidStuff(Response response, string text); 28 }; 29 30 } // module sample 31