OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 part of core; | 5 part of core; |
6 | 6 |
7 | 7 |
8 class _MojoMessagePipeNatives { | 8 class _MojoMessagePipeNatives { |
9 static List MojoCreateMessagePipe(int flags) | 9 static List MojoCreateMessagePipe(int flags) |
10 native "MojoMessagePipe_Create"; | 10 native "MojoMessagePipe_Create"; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 status = MojoResult.INVALID_ARGUMENT; | 106 status = MojoResult.INVALID_ARGUMENT; |
107 return null; | 107 return null; |
108 } | 108 } |
109 | 109 |
110 assert((result is List) && (result.length == 3)); | 110 assert((result is List) && (result.length == 3)); |
111 var readResult = new MojoMessagePipeReadResult.fromList(result); | 111 var readResult = new MojoMessagePipeReadResult.fromList(result); |
112 | 112 |
113 // Copy out the handles that were read. | 113 // Copy out the handles that were read. |
114 if (handles != null) { | 114 if (handles != null) { |
115 for (var i = 0; i < readResult.handlesRead; i++) { | 115 for (var i = 0; i < readResult.handlesRead; i++) { |
116 handles[i].h = mojoHandles[i]; | 116 handles[i] = new RawMojoHandle(mojoHandles[i]); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 status = readResult.status; | 120 status = readResult.status; |
121 return readResult; | 121 return readResult; |
122 } | 122 } |
123 | 123 |
124 MojoMessagePipeReadResult query() => read(null); | 124 MojoMessagePipeReadResult query() => read(null); |
125 } | 125 } |
126 | 126 |
(...skipping 19 matching lines...) Expand all Loading... |
146 RawMojoHandle end1 = new RawMojoHandle(result[1]); | 146 RawMojoHandle end1 = new RawMojoHandle(result[1]); |
147 RawMojoHandle end2 = new RawMojoHandle(result[2]); | 147 RawMojoHandle end2 = new RawMojoHandle(result[2]); |
148 MojoMessagePipe pipe = new MojoMessagePipe._(); | 148 MojoMessagePipe pipe = new MojoMessagePipe._(); |
149 pipe.endpoints = new List(2); | 149 pipe.endpoints = new List(2); |
150 pipe.endpoints[0] = new MojoMessagePipeEndpoint(end1); | 150 pipe.endpoints[0] = new MojoMessagePipeEndpoint(end1); |
151 pipe.endpoints[1] = new MojoMessagePipeEndpoint(end2); | 151 pipe.endpoints[1] = new MojoMessagePipeEndpoint(end2); |
152 pipe.status = new MojoResult(result[0]); | 152 pipe.status = new MojoResult(result[0]); |
153 return pipe; | 153 return pipe; |
154 } | 154 } |
155 } | 155 } |
OLD | NEW |