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

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

Issue 728043002: Revert of Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
index 75cddc97a463bdb639b06d6fafbf07adf8f9487d..ef04f6dd413c56466f1e293d4a081035a74d3c04 100644
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
@@ -59,7 +59,7 @@
this.core = core;
byteBuffer = ByteBuffer.allocateDirect(
bufferSize > 0 ? bufferSize : INITIAL_BUFFER_SIZE);
- byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
+ byteBuffer.order(ByteOrder.nativeOrder());
dataEnd = 0;
}
@@ -226,8 +226,8 @@
encodeNullPointer(offset, nullable);
return;
}
- final int arrayNullability = nullable
- ? BindingsHelper.ARRAY_NULLABLE : BindingsHelper.NOTHING_NULLABLE;
+ final int arrayNullability = nullable ?
+ BindingsHelper.ARRAY_NULLABLE : BindingsHelper.NOTHING_NULLABLE;
encode(v.getBytes(Charset.forName("utf8")), offset, arrayNullability,
BindingsHelper.UNSPECIFIED_ARRAY_LENGTH);
}
@@ -303,8 +303,8 @@
encodeNullPointer(offset, BindingsHelper.isArrayNullable(arrayNullability));
return;
}
- if (expectedLength != BindingsHelper.UNSPECIFIED_ARRAY_LENGTH
- && expectedLength != v.length) {
+ if (expectedLength != BindingsHelper.UNSPECIFIED_ARRAY_LENGTH &&
+ expectedLength != v.length) {
throw new SerializationException("Trying to encode a fixed array of incorrect length.");
}
byte[] bytes = new byte[(v.length + 7) / BindingsHelper.ALIGNMENT];
@@ -327,8 +327,8 @@
encodeNullPointer(offset, BindingsHelper.isArrayNullable(arrayNullability));
return;
}
- if (expectedLength != BindingsHelper.UNSPECIFIED_ARRAY_LENGTH
- && expectedLength != v.length) {
+ if (expectedLength != BindingsHelper.UNSPECIFIED_ARRAY_LENGTH &&
+ expectedLength != v.length) {
throw new SerializationException("Trying to encode a fixed array of incorrect length.");
}
encodeByteArray(v, v.length, offset);
@@ -473,8 +473,8 @@
private Encoder encoderForArray(
int elementSizeInByte, int length, int offset, int expectedLength) {
- if (expectedLength != BindingsHelper.UNSPECIFIED_ARRAY_LENGTH
- && expectedLength != length) {
+ if (expectedLength != BindingsHelper.UNSPECIFIED_ARRAY_LENGTH &&
+ expectedLength != length) {
throw new SerializationException("Trying to encode a fixed array of incorrect length.");
}
return encoderForArrayByTotalSize(length * elementSizeInByte, length, offset);

Powered by Google App Engine
This is Rietveld 408576698