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

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

Issue 2759563004: Mojo JS bindings: change module loading solution. (Closed)
Patch Set: Make sure mojo_bindings.js is packaged in build result for running layout tests. Created 3 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 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 define("mojo/public/js/buffer", function() { 5 (function() {
6 var internal = mojo.internal;
6 7
7 var kHostIsLittleEndian = (function () { 8 var kHostIsLittleEndian = (function () {
8 var endianArrayBuffer = new ArrayBuffer(2); 9 var endianArrayBuffer = new ArrayBuffer(2);
9 var endianUint8Array = new Uint8Array(endianArrayBuffer); 10 var endianUint8Array = new Uint8Array(endianArrayBuffer);
10 var endianUint16Array = new Uint16Array(endianArrayBuffer); 11 var endianUint16Array = new Uint16Array(endianArrayBuffer);
11 endianUint16Array[0] = 1; 12 endianUint16Array[0] = 1;
12 return endianUint8Array[0] == 1; 13 return endianUint8Array[0] == 1;
13 })(); 14 })();
14 15
15 var kHighWordMultiplier = 0x100000000; 16 var kHighWordMultiplier = 0x100000000;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 144 }
144 } 145 }
145 146
146 Buffer.prototype.setFloat32 = function(offset, value) { 147 Buffer.prototype.setFloat32 = function(offset, value) {
147 this.dataView.setFloat32(offset, value, kHostIsLittleEndian); 148 this.dataView.setFloat32(offset, value, kHostIsLittleEndian);
148 } 149 }
149 Buffer.prototype.setFloat64 = function(offset, value) { 150 Buffer.prototype.setFloat64 = function(offset, value) {
150 this.dataView.setFloat64(offset, value, kHostIsLittleEndian); 151 this.dataView.setFloat64(offset, value, kHostIsLittleEndian);
151 } 152 }
152 153
153 var exports = {}; 154 internal.Buffer = Buffer;
154 exports.Buffer = Buffer; 155 })();
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