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

Unified Diff: third_party/mojo/src/mojo/public/dart/src/message_pipe.dart

Issue 1019173002: Update mojo sdk to rev 7214b7ec7d27563b2666afad86cf1c5895c56c18 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep permission service alive if embedder drops requests Created 5 years, 9 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
Index: third_party/mojo/src/mojo/public/dart/src/message_pipe.dart
diff --git a/third_party/mojo/src/mojo/public/dart/src/message_pipe.dart b/third_party/mojo/src/mojo/public/dart/src/message_pipe.dart
index f1d1a4b0aa6e91867a2d1ef435fabf7cb16d77ad..5021c78315d1616ca714fc56636b1db33d6cef76 100644
--- a/third_party/mojo/src/mojo/public/dart/src/message_pipe.dart
+++ b/third_party/mojo/src/mojo/public/dart/src/message_pipe.dart
@@ -4,21 +4,16 @@
part of core;
-
class _MojoMessagePipeNatives {
- static List MojoCreateMessagePipe(int flags)
- native "MojoMessagePipe_Create";
+ static List MojoCreateMessagePipe(int flags) native "MojoMessagePipe_Create";
- static int MojoWriteMessage(
- int handle, ByteData data, int numBytes, List<int> handles, int flags)
- native "MojoMessagePipe_Write";
+ static int MojoWriteMessage(int handle, ByteData data, int numBytes,
+ List<int> handles, int flags) native "MojoMessagePipe_Write";
- static List MojoReadMessage(
- int handle, ByteData data, int numBytes, List<int> handles, int flags)
- native "MojoMessagePipe_Read";
+ static List MojoReadMessage(int handle, ByteData data, int numBytes,
+ List<int> handles, int flags) native "MojoMessagePipe_Read";
}
-
class MojoMessagePipeReadResult {
final MojoResult status;
final int bytesRead;
@@ -27,8 +22,12 @@ class MojoMessagePipeReadResult {
MojoMessagePipeReadResult(this.status, this.bytesRead, this.handlesRead);
MojoMessagePipeReadResult.fromList(List<int> resultList)
: this(new MojoResult(resultList[0]), resultList[1], resultList[2]);
-}
+ String toString() {
+ return "MojoMessagePipeReadResult("
+ "status: $status, bytesRead: $bytesRead, handlesRead: $handlesRead)";
+ }
+}
class MojoMessagePipeEndpoint {
static const int WRITE_FLAG_NONE = 0;
@@ -41,9 +40,7 @@ class MojoMessagePipeEndpoint {
MojoMessagePipeEndpoint(this.handle);
MojoResult write(ByteData data,
- [int numBytes = -1,
- List<MojoHandle> handles = null,
- int flags = 0]) {
+ [int numBytes = -1, List<MojoHandle> handles = null, int flags = 0]) {
if (handle == null) {
status = MojoResult.INVALID_ARGUMENT;
return status;
@@ -70,11 +67,8 @@ class MojoMessagePipeEndpoint {
return status;
}
-
MojoMessagePipeReadResult read(ByteData data,
- [int numBytes = -1,
- List<MojoHandle> handles = null,
- int flags = 0]) {
+ [int numBytes = -1, List<MojoHandle> handles = null, int flags = 0]) {
if (handle == null) {
status = MojoResult.INVALID_ARGUMENT;
return null;
@@ -88,7 +82,7 @@ class MojoMessagePipeEndpoint {
dataNumBytes = (numBytes == -1) ? data.lengthInBytes : numBytes;
if (dataNumBytes > data.lengthInBytes) {
status = MojoResult.INVALID_ARGUMENT;
- return status;
+ return null;
}
}
@@ -124,8 +118,15 @@ class MojoMessagePipeEndpoint {
}
MojoMessagePipeReadResult query() => read(null);
-}
+ void close() {
+ handle.close();
+ handle = null;
+ }
+
+ String toString() =>
+ "MojoMessagePipeEndpoint(handle: $handle, status: $status)";
+}
class MojoMessagePipe {
static const int FLAG_NONE = 0;
« no previous file with comments | « third_party/mojo/src/mojo/public/dart/src/message.dart ('k') | third_party/mojo/src/mojo/public/dart/src/proxy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698