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

Side by Side Diff: mojo/public/dart/src/interface.dart

Issue 782693004: Update mojo sdk to rev f6c8ec07c01deebc13178d516225fd12695c3dc2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hack mojo_system_impl gypi for android :| Created 6 years 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
OLDNEW
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 bindings; 5 part of bindings;
6 6
7 abstract class Interface { 7 abstract class Interface {
8 core.MojoMessagePipeEndpoint _endpoint; 8 core.MojoMessagePipeEndpoint _endpoint;
9 core.MojoHandle _handle; 9 core.MojoHandle _handle;
10 List _sendQueue; 10 List _sendQueue;
(...skipping 12 matching lines...) Expand all
23 var result = _endpoint.query(); 23 var result = _endpoint.query();
24 if (!result.status.isOk && !result.status.isResourceExhausted) { 24 if (!result.status.isOk && !result.status.isResourceExhausted) {
25 // If something else happens, it means the handle wasn't really ready 25 // If something else happens, it means the handle wasn't really ready
26 // for reading, which indicates a bug in MojoHandle or the 26 // for reading, which indicates a bug in MojoHandle or the
27 // event listener. 27 // event listener.
28 throw new Exception("message pipe query failed: ${result.status}"); 28 throw new Exception("message pipe query failed: ${result.status}");
29 } 29 }
30 30
31 // Read the data and view as a message. 31 // Read the data and view as a message.
32 var bytes = new ByteData(result.bytesRead); 32 var bytes = new ByteData(result.bytesRead);
33 var handles = new List<RawMojoHandle>(result.handlesRead); 33 var handles = new List<core.RawMojoHandle>(result.handlesRead);
34 result = _endpoint.read(bytes, result.bytesRead, handles); 34 result = _endpoint.read(bytes, result.bytesRead, handles);
35 if (!result.status.isOk && !result.status.isResourceExhausted) { 35 if (!result.status.isOk && !result.status.isResourceExhausted) {
36 // If something else happens, it means the handle wasn't really ready 36 // If something else happens, it means the handle wasn't really ready
37 // for reading, which indicates a bug in MojoHandle or the 37 // for reading, which indicates a bug in MojoHandle or the
38 // event listener. 38 // event listener.
39 throw new Exception("message pipe read failed: ${result.status}"); 39 throw new Exception("message pipe read failed: ${result.status}");
40 } 40 }
41 var message = new Message(bytes, handles); 41 var message = new Message(bytes, handles);
42 var reader = new MessageReader(message); 42 var reader = new MessageReader(message);
43 43
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return builder.finish(); 77 return builder.finish();
78 } 78 }
79 79
80 Message buildResponseWithID(Type t, int name, int id, Object response) { 80 Message buildResponseWithID(Type t, int name, int id, Object response) {
81 var builder = new MessageWithRequestIDBuilder( 81 var builder = new MessageWithRequestIDBuilder(
82 name, align(getEncodedSize(t)), id); 82 name, align(getEncodedSize(t)), id);
83 builder.encodeStruct(t, response); 83 builder.encodeStruct(t, response);
84 return builder.finish(); 84 return builder.finish();
85 } 85 }
86 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698