Chromium Code Reviews| Index: chrome/renderer/resources/extensions/event.js |
| diff --git a/chrome/renderer/resources/extensions/event.js b/chrome/renderer/resources/extensions/event.js |
| index c6c5a0fc0151355d542192d2237caf3f213a3859..936c458b8cdc00502653c3643bd69fcaa6ea8d0b 100644 |
| --- a/chrome/renderer/resources/extensions/event.js |
| +++ b/chrome/renderer/resources/extensions/event.js |
| @@ -187,11 +187,13 @@ |
| // |
| // If opt_eventOptions exists, it is a dictionary that contains the boolean |
| // entries "supportsListeners" and "supportsRules". |
| - var Event = function(opt_eventName, opt_argSchemas, opt_eventOptions) { |
| + var Event = function(opt_eventName, opt_argSchemas, opt_eventOptions, |
| + opt_webViewInstanceId) { |
|
Jeffrey Yasskin
2013/11/09 02:47:22
Add a comment for this parameter.
Fady Samuel
2013/11/10 03:39:56
Done.
|
| this.eventName_ = opt_eventName; |
| this.argSchemas_ = opt_argSchemas; |
| this.listeners_ = []; |
| this.eventOptions_ = parseEventOptions(opt_eventOptions); |
| + this.webViewInstanceId_ = opt_webViewInstanceId || 0; |
| if (!this.eventName_) { |
| if (this.eventOptions_.supportsRules) |
| @@ -447,10 +449,11 @@ |
| ensureRuleSchemasLoaded(); |
| // We remove the first parameter from the validation to give the user more |
| // meaningful error messages. |
| - validate([rules, opt_cb], |
| + validate([this.webViewInstanceId_, rules, opt_cb], |
| $Array.splice( |
| $Array.slice(ruleFunctionSchemas.addRules.parameters), 1)); |
| - sendRequest("events.addRules", [this.eventName_, rules, opt_cb], |
| + sendRequest("events.addRules", |
| + [this.eventName_, this.webViewInstanceId_, rules, opt_cb], |
| ruleFunctionSchemas.addRules.parameters); |
| } |
| @@ -460,11 +463,14 @@ |
| ensureRuleSchemasLoaded(); |
| // We remove the first parameter from the validation to give the user more |
| // meaningful error messages. |
| - validate([ruleIdentifiers, opt_cb], |
| + validate([this.webViewInstanceId_, ruleIdentifiers, opt_cb], |
| $Array.splice( |
| $Array.slice(ruleFunctionSchemas.removeRules.parameters), 1)); |
| sendRequest("events.removeRules", |
| - [this.eventName_, ruleIdentifiers, opt_cb], |
| + [this.eventName_, |
| + this.webViewInstanceId_, |
| + ruleIdentifiers, |
| + opt_cb], |
| ruleFunctionSchemas.removeRules.parameters); |
| } |
| @@ -474,12 +480,12 @@ |
| ensureRuleSchemasLoaded(); |
| // We remove the first parameter from the validation to give the user more |
| // meaningful error messages. |
| - validate([ruleIdentifiers, cb], |
| + validate([this.webViewInstanceId_, ruleIdentifiers, cb], |
| $Array.splice( |
| $Array.slice(ruleFunctionSchemas.getRules.parameters), 1)); |
| sendRequest("events.getRules", |
| - [this.eventName_, ruleIdentifiers, cb], |
| + [this.eventName_, this.webViewInstanceId_, ruleIdentifiers, cb], |
| ruleFunctionSchemas.getRules.parameters); |
| } |