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

Side by Side Diff: mojo/public/js/new_bindings/buffer.js

Issue 2779533002: Revert of Mojo JS bindings: change module loading solution. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « mojo/public/js/new_bindings/bindings.js ('k') | mojo/public/js/new_bindings/codec.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function() { 5 define("mojo/public/js/buffer", function() {
6 var internal = mojoBindings.internal;
7 6
8 var kHostIsLittleEndian = (function () { 7 var kHostIsLittleEndian = (function () {
9 var endianArrayBuffer = new ArrayBuffer(2); 8 var endianArrayBuffer = new ArrayBuffer(2);
10 var endianUint8Array = new Uint8Array(endianArrayBuffer); 9 var endianUint8Array = new Uint8Array(endianArrayBuffer);
11 var endianUint16Array = new Uint16Array(endianArrayBuffer); 10 var endianUint16Array = new Uint16Array(endianArrayBuffer);
12 endianUint16Array[0] = 1; 11 endianUint16Array[0] = 1;
13 return endianUint8Array[0] == 1; 12 return endianUint8Array[0] == 1;
14 })(); 13 })();
15 14
16 var kHighWordMultiplier = 0x100000000; 15 var kHighWordMultiplier = 0x100000000;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 143 }
145 } 144 }
146 145
147 Buffer.prototype.setFloat32 = function(offset, value) { 146 Buffer.prototype.setFloat32 = function(offset, value) {
148 this.dataView.setFloat32(offset, value, kHostIsLittleEndian); 147 this.dataView.setFloat32(offset, value, kHostIsLittleEndian);
149 } 148 }
150 Buffer.prototype.setFloat64 = function(offset, value) { 149 Buffer.prototype.setFloat64 = function(offset, value) {
151 this.dataView.setFloat64(offset, value, kHostIsLittleEndian); 150 this.dataView.setFloat64(offset, value, kHostIsLittleEndian);
152 } 151 }
153 152
154 internal.Buffer = Buffer; 153 var exports = {};
155 })(); 154 exports.Buffer = Buffer;
155 return exports;
156 });
OLDNEW
« no previous file with comments | « mojo/public/js/new_bindings/bindings.js ('k') | mojo/public/js/new_bindings/codec.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698