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

Unified Diff: chrome/renderer/resources/extensions/event.js

Issue 10535030: Allow updateArgumentsPostValidate to support callbacks and added / removed arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Proper syntax 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/extensions/event.js
diff --git a/chrome/renderer/resources/extensions/event.js b/chrome/renderer/resources/extensions/event.js
index 8961ce56fc112758d971b496ccaa842b070af33b..72cc7bb19b6982fd4caa8d94c848a1990ac48758 100644
--- a/chrome/renderer/resources/extensions/event.js
+++ b/chrome/renderer/resources/extensions/event.js
@@ -7,6 +7,7 @@
var DetachEvent = eventBindingsNatives.DetachEvent;
var sendRequest = require('sendRequest').sendRequest;
var utils = require('utils');
+ var validate = require('schemaUtils').validate;
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
var GetExtensionAPIDefinition =
@@ -99,12 +100,11 @@
// Validate event arguments (the data that is passed to the callbacks)
// if we are in debug.
if (opt_argSchemas &&
- chromeHidden.validateCallbacks &&
- chromeHidden.validate) {
+ chromeHidden.validateCallbacks) {
this.validateEventArgs_ = function(args) {
try {
- chromeHidden.validate(args, opt_argSchemas);
+ validate(args, opt_argSchemas);
} catch (exception) {
return "Event validation error during " + opt_eventName + " -- " +
exception;
@@ -306,8 +306,8 @@
var conditionsSchema = buildArrayOfChoicesSchema(conditions);
var actionsSchema = buildArrayOfChoicesSchema(actions);
rules.forEach(function(rule) {
- chromeHidden.validate([rule.conditions], [conditionsSchema]);
- chromeHidden.validate([rule.actions], [actionsSchema]);
+ validate([rule.conditions], [conditionsSchema]);
+ validate([rule.actions], [actionsSchema]);
})
};

Powered by Google App Engine
This is Rietveld 408576698