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

Unified Diff: mojo/public/js/bindings/codec.js

Issue 231743004: Mojo's JS codec missing 16-bit read/write operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/bindings/codec.js
diff --git a/mojo/public/js/bindings/codec.js b/mojo/public/js/bindings/codec.js
index 243488b37a2db28a914d6567d6cfecff59e11a9d..f3d4b68ae5f9c447b150ea659cba6a0c0a062d9e 100644
--- a/mojo/public/js/bindings/codec.js
+++ b/mojo/public/js/bindings/codec.js
@@ -111,6 +111,12 @@ define("mojo/public/js/bindings/codec", function() {
return result;
};
+ Decoder.prototype.read16 = function() {
+ var result = load16(this.memory, this.next);
+ this.next += 2;
+ return result;
+ };
+
Decoder.prototype.read32 = function() {
var result = this.viewU32[this.next / this.viewU32.BYTES_PER_ELEMENT];
this.next += this.viewU32.BYTES_PER_ELEMENT;
@@ -203,6 +209,11 @@ define("mojo/public/js/bindings/codec", function() {
this.next += 1;
};
+ Encoder.prototype.write16 = function(val) {
+ store16(this.buffer.memory, this.next, val);
+ this.next += 2;
+ };
+
Encoder.prototype.write32 = function(val) {
store32(this.buffer.memory, this.next, val);
this.next += 4;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698