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

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

Issue 12189018: <webview>: Implement WebRequest API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile* => void* Created 7 years, 7 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/web_request_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/web_request_custom_bindings.js b/chrome/renderer/resources/extensions/web_request_custom_bindings.js
index 135da99d43cf58c047dd8782f2cbc775ff757918..b2b0953b0f477f8701a6bd51d0d9d410fa3de32d 100644
--- a/chrome/renderer/resources/extensions/web_request_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/web_request_custom_bindings.js
@@ -25,20 +25,21 @@ var webRequestInternal = require('webRequestInternal').binding;
// callback, {urls: 'http://*.google.com/*'});
// ^ callback will only be called for onBeforeRequests matching the filter.
function WebRequestEvent(eventName, opt_argSchemas, opt_extraArgSchemas,
- opt_eventOptions) {
+ opt_eventOptions, opt_webViewInstanceId) {
if (typeof eventName != 'string')
throw new Error('chrome.WebRequestEvent requires an event name.');
this.eventName_ = eventName;
this.argSchemas_ = opt_argSchemas;
this.extraArgSchemas_ = opt_extraArgSchemas;
+ this.webViewInstanceId_ = opt_webViewInstanceId ? opt_webViewInstanceId : 0;
this.subEvents_ = [];
this.eventOptions_ = chromeHidden.parseEventOptions(opt_eventOptions);
if (this.eventOptions_.supportsRules) {
this.eventForRules_ =
new chrome.Event(eventName, opt_argSchemas, opt_eventOptions);
}
-};
+}
// Test if the given callback is registered for this event.
WebRequestEvent.prototype.hasListener = function(cb) {
@@ -70,7 +71,8 @@ WebRequestEvent.prototype.addListener =
// subEvent listener.
validate(Array.prototype.slice.call(arguments, 1), this.extraArgSchemas_);
webRequestInternal.addEventListener(
- cb, opt_filter, opt_extraInfo, this.eventName_, subEventName);
+ cb, opt_filter, opt_extraInfo, this.eventName_, subEventName,
+ this.webViewInstanceId_);
var subEvent = new chrome.Event(subEventName, this.argSchemas_);
var subEventCallback = cb;
@@ -165,3 +167,4 @@ binding.registerCustomHook(function(api) {
});
exports.binding = binding.generate();
+exports.WebRequestEvent = WebRequestEvent;
« no previous file with comments | « chrome/common/extensions/permissions/permission_set.cc ('k') | chrome/renderer/resources/extensions/web_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698