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

Side by Side Diff: mojo/public/interfaces/bindings/tests/sample_factory.mojom

Issue 376383002: Mojo: Add support for InterfacePtr as a struct member (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retry Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import "sample_import.mojom" 5 import "sample_import.mojom"
6 6
7 [JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] 7 [JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"]
8 module sample { 8 module sample {
9 9
10 // This sample shows how handles to MessagePipes can be sent as both parameters 10 // This sample shows how handles to MessagePipes can be sent as both parameters
11 // to methods as well as fields on structs. 11 // to methods as well as fields on structs.
12 12
13 struct Request { 13 struct Request {
14 int32 x; 14 int32 x;
15 handle<message_pipe> pipe; 15 handle<message_pipe> pipe;
16 handle<message_pipe>[] more_pipes; 16 handle<message_pipe>[] more_pipes;
17
18 // Interfaces can be used as members.
19 imported.ImportedInterface obj;
17 }; 20 };
18 21
19 struct Response { 22 struct Response {
20 int32 x; 23 int32 x;
21 handle<message_pipe> pipe; 24 handle<message_pipe> pipe;
22 }; 25 };
23 26
24 interface NamedObject { 27 interface NamedObject {
25 SetName(string name); 28 SetName(string name);
26 GetName() => (string name); 29 GetName() => (string name);
27 }; 30 };
28 31
29 [Client=FactoryClient] 32 [Client=FactoryClient]
30 interface Factory { 33 interface Factory {
31 DoStuff(Request request, handle<message_pipe> pipe); 34 DoStuff(Request request, handle<message_pipe> pipe);
32 DoStuff2(handle<data_pipe_consumer> pipe); 35 DoStuff2(handle<data_pipe_consumer> pipe);
33 CreateNamedObject(NamedObject& obj); 36 CreateNamedObject(NamedObject& obj);
34 RequestImportedInterface( 37 RequestImportedInterface(
35 imported.ImportedInterface& obj) => (imported.ImportedInterface& obj); 38 imported.ImportedInterface& obj) => (imported.ImportedInterface& obj);
36 TakeImportedInterface( 39 TakeImportedInterface(
37 imported.ImportedInterface obj) => (imported.ImportedInterface obj); 40 imported.ImportedInterface obj) => (imported.ImportedInterface obj);
38 }; 41 };
39 42
40 interface FactoryClient { 43 interface FactoryClient {
41 DidStuff(Response response, string text); 44 DidStuff(Response response, string text);
42 DidStuff2(string text); 45 DidStuff2(string text);
43 }; 46 };
44 47
45 } // module sample 48 } // module sample
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/handle_passing_unittest.cc ('k') | mojo/public/interfaces/bindings/tests/sample_import.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698