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

Unified Diff: third_party/mojo/src/mojo/public/dart/lib/src/codec.dart

Issue 1142043005: Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix type conversion errors on win64 for some msvs Created 5 years, 7 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/lib/src/codec.dart
diff --git a/third_party/mojo/src/mojo/public/dart/src/codec.dart b/third_party/mojo/src/mojo/public/dart/lib/src/codec.dart
similarity index 98%
rename from third_party/mojo/src/mojo/public/dart/src/codec.dart
rename to third_party/mojo/src/mojo/public/dart/lib/src/codec.dart
index 89e32c279ba75e4d2ec7b6eabcfd715c4a181821..07bad358bbff0ad229c4f4a464f3b970cbd5dafd 100644
--- a/third_party/mojo/src/mojo/public/dart/src/codec.dart
+++ b/third_party/mojo/src/mojo/public/dart/lib/src/codec.dart
@@ -201,11 +201,10 @@ class Encoder {
void encodeInterface(
core.MojoEventStreamListener interface, int offset, bool nullable) {
- // Set the version field to 0 for now.
- encodeUint32(0, offset + kSerializedHandleSize);
-
if (interface == null) {
encodeInvalideHandle(offset, nullable);
+ // Set the version field to 0.
+ encodeUint32(0, offset + kSerializedHandleSize);
return;
}
if (interface is Stub) {
@@ -214,6 +213,8 @@ class Encoder {
interface.bind(pipe.endpoints[0]);
interface.listen();
encodeMessagePipeHandle(pipe.endpoints[1], offset, nullable);
+ // Set the version to the version in the stub.
+ encodeUint32(interface.version, offset + kSerializedHandleSize);
} else if (interface is Proxy) {
assert(interface.isBound);
if (!interface.isOpen) {
@@ -222,6 +223,8 @@ class Encoder {
interface.listen();
}
encodeMessagePipeHandle(interface.endpoint, offset, nullable);
+ // Set the version to the current version of the proxy.
+ encodeUint32(interface.version, offset + kSerializedHandleSize);
} else {
throw new MojoCodecError(
'Trying to encode an unknown MojoEventStreamListener');
@@ -594,9 +597,14 @@ class Decoder {
ProxyBase decodeServiceInterface(
int offset, bool nullable, Function clientFactory) {
- // Ignore the version field for now.
var endpoint = decodeMessagePipeHandle(offset, nullable);
- return endpoint.handle.isValid ? clientFactory(endpoint) : null;
+ var version = decodeUint32(offset + kSerializedHandleSize);
+ if (!endpoint.handle.isValid) {
+ return null;
+ }
+ ProxyBase client = clientFactory(endpoint);
+ client.impl._version = version;
+ return client;
}
Stub decodeInterfaceRequest(

Powered by Google App Engine
This is Rietveld 408576698