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

Unified Diff: extensions/renderer/resources/utils.js

Issue 2953073004: [Extensions Bindings] Move loadTypeSchema from utils to json_schema (Closed)
Patch Set: remove unnecessary require Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/resources/json_schema.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/utils.js
diff --git a/extensions/renderer/resources/utils.js b/extensions/renderer/resources/utils.js
index 2cefb15144a16c4c20ca5aeb22402bb460d66c32..3b5a68d6145b1d258f325772ca2f919140e5f37c 100644
--- a/extensions/renderer/resources/utils.js
+++ b/extensions/renderer/resources/utils.js
@@ -3,10 +3,7 @@
// found in the LICENSE file.
var nativeDeepCopy = requireNative('utils').deepCopy;
-var schemaRegistry = requireNative('schema_registry');
-var CHECK = requireNative('logging').CHECK;
var DCHECK = requireNative('logging').DCHECK;
-var WARNING = requireNative('logging').WARNING;
/**
* An object forEach. Calls |f| with each (key, value) pair of |obj|, using
@@ -43,26 +40,6 @@ function lookup(array_of_dictionaries, field, value) {
}
}
-function loadTypeSchema(typeName, defaultSchema) {
- var parts = $String.split(typeName, '.');
- if (parts.length == 1) {
- if (defaultSchema == null) {
- WARNING('Trying to reference "' + typeName + '" ' +
- 'with neither namespace nor default schema.');
- return null;
- }
- var types = defaultSchema.types;
- } else {
- var schemaName = $Array.join($Array.slice(parts, 0, parts.length - 1), '.');
- var types = schemaRegistry.GetSchema(schemaName).types;
- }
- for (var i = 0; i < types.length; ++i) {
- if (types[i].id == typeName)
- return types[i];
- }
- return null;
-}
-
/**
* Sets a property |value| on |obj| with property name |key|. Like
*
@@ -230,7 +207,6 @@ function promise(func) {
}
exports.$set('forEach', forEach);
-exports.$set('loadTypeSchema', loadTypeSchema);
exports.$set('lookup', lookup);
exports.$set('defineProperty', defineProperty);
exports.$set('expose', expose);
« no previous file with comments | « extensions/renderer/resources/json_schema.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698