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

Unified Diff: chrome/renderer/resources/extensions/json_schema.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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/extensions/json_schema.js
diff --git a/chrome/renderer/resources/extensions/json_schema.js b/chrome/renderer/resources/extensions/json_schema.js
index 414356c88fc7e91f30eabc263b3efd2bd6c399cf..44ea2a06c9c2ad877dcc2133c4162badf8b06e73 100644
--- a/chrome/renderer/resources/extensions/json_schema.js
+++ b/chrome/renderer/resources/extensions/json_schema.js
@@ -38,7 +38,9 @@
// additional properties will be validated.
//==============================================================================
+// TODO(cduvall): Make this file not depend on chromeHidden.
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
+var loadRefDependency = require('utils').loadRefDependency;
function isInstanceOfClass(instance, className) {
if (!instance)
@@ -240,6 +242,7 @@ chromeHidden.JSONSchemaValidator.prototype.validate =
// If the schema has a $ref property, the instance must validate against
// that schema too. It must be present in this.types to be referenced.
if (schema["$ref"]) {
+ loadRefDependency(schema["$ref"]);
if (!this.types[schema["$ref"]])
this.addError(path, "unknownSchemaReference", [ schema["$ref"] ]);
else
« no previous file with comments | « chrome/renderer/resources/extensions/input.ime_custom_bindings.js ('k') | chrome/renderer/resources/extensions/last_error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698