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

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: Diff from latest patch Created 7 years, 10 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 8699cbff664b6b488355836f0831625a713b01a1..4f6f4be44aa3de80a30eed2d5f7125dd9aa2cce3 100644
--- a/chrome/renderer/resources/extensions/web_request_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/web_request_custom_bindings.js
@@ -22,13 +22,14 @@ var validate = require('schemaUtils').validate;
// 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, opt_routeId) {
Matt Perry 2013/02/06 22:40:24 remove opt_routeId
Fady Samuel 2013/05/15 21:58:53 Done.
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) {
@@ -64,7 +65,8 @@ WebRequestEvent.prototype.addListener =
// subEvent listener.
validate(Array.prototype.slice.call(arguments, 1), this.extraArgSchemas_);
chromeHidden.internalAPIs.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;
@@ -157,3 +159,5 @@ chromeHidden.registerCustomHook('webRequest', function(api) {
{forIOThread: true});
});
});
+
+exports.webRequestEvent = WebRequestEvent;

Powered by Google App Engine
This is Rietveld 408576698