| Index: chrome/renderer/resources/extensions/web_request_internal_custom_bindings.js
|
| diff --git a/chrome/renderer/resources/extensions/web_request_internal_custom_bindings.js b/chrome/renderer/resources/extensions/web_request_internal_custom_bindings.js
|
| index 45ebec2df98527a1fd6b8eb6a1b99a0cc3acf59e..7d168050da79485dd6797137b6d69b9d9210cd2e 100644
|
| --- a/chrome/renderer/resources/extensions/web_request_internal_custom_bindings.js
|
| +++ b/chrome/renderer/resources/extensions/web_request_internal_custom_bindings.js
|
| @@ -67,7 +67,7 @@ WebRequestEvent.prototype.addListener =
|
| var subEventName = webRequestNatives.GetUniqueSubEventName(this.eventName_);
|
| // Note: this could fail to validate, in which case we would not add the
|
| // subEvent listener.
|
| - validate(Array.prototype.slice.call(arguments, 1), this.extraArgSchemas_);
|
| + validate($Array.slice(arguments, 1), this.extraArgSchemas_);
|
| webRequestInternal.addEventListener(
|
| cb, opt_filter, opt_extraInfo, this.eventName_, subEventName,
|
| this.webViewInstanceId_);
|
| @@ -79,7 +79,7 @@ WebRequestEvent.prototype.addListener =
|
| subEventCallback = function() {
|
| var requestId = arguments[0].requestId;
|
| try {
|
| - var result = cb.apply(null, arguments);
|
| + var result = $Function.apply(cb, null, arguments);
|
| webRequestInternal.eventHandled(
|
| eventName, subEventName, requestId, result);
|
| } catch (e) {
|
| @@ -97,10 +97,10 @@ WebRequestEvent.prototype.addListener =
|
| webRequestInternal.eventHandled(
|
| eventName, subEventName, requestId, response);
|
| };
|
| - cb.apply(null, [details, handledCallback]);
|
| + $Function.apply(cb, null, [details, handledCallback]);
|
| };
|
| }
|
| - this.subEvents_.push(
|
| + $Array.push(this.subEvents_,
|
| {subEvent: subEvent, callback: cb, subEventCallback: subEventCallback});
|
| subEvent.addListener(subEventCallback);
|
| };
|
| @@ -117,7 +117,7 @@ WebRequestEvent.prototype.removeListener = function(cb) {
|
| console.error(
|
| 'Internal error: webRequest subEvent has orphaned listeners.');
|
| }
|
| - this.subEvents_.splice(idx, 1);
|
| + $Array.splice(this.subEvents_, idx, 1);
|
| }
|
| };
|
|
|
| @@ -156,13 +156,13 @@ binding.registerCustomHook(function(api) {
|
| var apiFunctions = api.apiFunctions;
|
|
|
| apiFunctions.setHandleRequest('addEventListener', function() {
|
| - var args = Array.prototype.slice.call(arguments);
|
| + var args = $Array.slice(arguments);
|
| sendRequest(this.name, args, this.definition.parameters,
|
| {forIOThread: true});
|
| });
|
|
|
| apiFunctions.setHandleRequest('eventHandled', function() {
|
| - var args = Array.prototype.slice.call(arguments);
|
| + var args = $Array.slice(arguments);
|
| sendRequest(this.name, args, this.definition.parameters,
|
| {forIOThread: true});
|
| });
|
|
|