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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 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 | Annotate | Revision Log
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 // Routines used to validate and normalize arguments. 5 // Routines used to validate and normalize arguments.
6 6
7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
8 var chrome = requireNative('chrome').GetChrome();
8 9
9 // TODO(benwells): unit test this file. 10 // TODO(benwells): unit test this file.
10 // JSONSchemaValidator is not loaded in unit tests. 11 // JSONSchemaValidator is not loaded in unit tests.
11 var validate; 12 var validate;
12 if (chromeHidden.JSONSchemaValidator) { 13 if (chromeHidden.JSONSchemaValidator) {
13 var schemaValidator = new chromeHidden.JSONSchemaValidator(); 14 var schemaValidator = new chromeHidden.JSONSchemaValidator();
14 15
15 // Validate arguments. 16 // Validate arguments.
16 validate = function(args, parameterSchemas) { 17 validate = function(args, parameterSchemas) {
17 if (args.length > parameterSchemas.length) 18 if (args.length > parameterSchemas.length)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return true; 154 return true;
154 } 155 }
155 } 156 }
156 return false; 157 return false;
157 }; 158 };
158 159
159 exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous; 160 exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous;
160 exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate; 161 exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate;
161 exports.schemaValidator = schemaValidator; 162 exports.schemaValidator = schemaValidator;
162 exports.validate = validate; 163 exports.validate = validate;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698