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

Unified Diff: third_party/mojo/src/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Struct.java

Issue 1127293003: Update mojo sdk to rev f84766d3b6420b7cf6a113d9d65d73cb5fe18d90 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting 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/java/bindings/src/org/chromium/mojo/bindings/Struct.java
diff --git a/third_party/mojo/src/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Struct.java b/third_party/mojo/src/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Struct.java
index d7369fab2e79571c99cc32d1e03efe61f006c944..16ae80198dbc8b17459e41a8ae92e9326b575a0a 100644
--- a/third_party/mojo/src/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Struct.java
+++ b/third_party/mojo/src/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Struct.java
@@ -85,16 +85,25 @@ public abstract class Struct {
protected final int mEncodedBaseSize;
/**
+ * The version of the struct.
+ */
+ private final int mVersion;
+
+ /**
* Constructor.
*/
- protected Struct(int encodedBaseSize) {
- this.mEncodedBaseSize = encodedBaseSize;
+ protected Struct(int encodedBaseSize, int version) {
+ mEncodedBaseSize = encodedBaseSize;
+ mVersion = version;
}
/**
- * Use the given encoder to serialized this struct.
+ * Returns the version of the struct. It is the max version of the struct in the mojom if it has
+ * been created locally, and the version of the received struct if it has been deserialized.
*/
- protected abstract void encode(Encoder encoder);
+ public int getVersion() {
+ return mVersion;
+ }
/**
* Returns the serialization of the struct. This method can close Handles.
@@ -122,4 +131,8 @@ public abstract class Struct {
return new ServiceMessage(encoder.getMessage(), header);
}
+ /**
+ * Use the given encoder to serialize this struct.
+ */
+ protected abstract void encode(Encoder encoder);
}

Powered by Google App Engine
This is Rietveld 408576698