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

Side by Side Diff: chrome/renderer/resources/extensions/json_schema.js

Issue 10560027: Improve handling of ArrayBuffers in composite objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing tests. Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/json_schema_compiler/cc_generator.py » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // ----------------------------------------------------------------------------- 5 // -----------------------------------------------------------------------------
6 // NOTE: If you change this file you need to touch renderer_resources.grd to 6 // NOTE: If you change this file you need to touch renderer_resources.grd to
7 // have your change take effect. 7 // have your change take effect.
8 // ----------------------------------------------------------------------------- 8 // -----------------------------------------------------------------------------
9 9
10 //============================================================================== 10 //==============================================================================
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 * the input values. 117 * the input values.
118 */ 118 */
119 chromeHidden.JSONSchemaValidator.getType = function(value) { 119 chromeHidden.JSONSchemaValidator.getType = function(value) {
120 var s = typeof value; 120 var s = typeof value;
121 121
122 if (s == "object") { 122 if (s == "object") {
123 if (value === null) { 123 if (value === null) {
124 return "null"; 124 return "null";
125 } else if (Object.prototype.toString.call(value) == "[object Array]") { 125 } else if (Object.prototype.toString.call(value) == "[object Array]") {
126 return "array"; 126 return "array";
127 } else if (typeof(ArrayBuffer) != "undefined" &&
128 value.constructor == ArrayBuffer) {
129 return "binary";
127 } 130 }
128 } else if (s == "number") { 131 } else if (s == "number") {
129 if (value % 1 == 0) { 132 if (value % 1 == 0) {
130 return "integer"; 133 return "integer";
131 } 134 }
132 } 135 }
133 136
134 return s; 137 return s;
135 }; 138 };
136 139
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 message: chromeHidden.JSONSchemaValidator.formatError(key, replacements) 501 message: chromeHidden.JSONSchemaValidator.formatError(key, replacements)
499 }); 502 });
500 }; 503 };
501 504
502 /** 505 /**
503 * Resets errors to an empty list so you can call 'validate' again. 506 * Resets errors to an empty list so you can call 'validate' again.
504 */ 507 */
505 chromeHidden.JSONSchemaValidator.prototype.resetErrors = function() { 508 chromeHidden.JSONSchemaValidator.prototype.resetErrors = function() {
506 this.errors = []; 509 this.errors = [];
507 }; 510 };
OLDNEW
« no previous file with comments | « no previous file | tools/json_schema_compiler/cc_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698