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

Side by Side Diff: chrome/renderer/resources/extensions/web_request_custom_bindings.js

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom bindings for the webRequest API. 5 // Custom bindings for the webRequest API.
6 6
7 (function() { 7 var GetChromeHidden = natives.GetChromeHidden;
8 8 var GetUniqueSubEventName = natives.GetUniqueSubEventName;
9 native function GetChromeHidden();
10 native function GetUniqueSubEventName(eventName);
11 9
12 var chromeHidden = GetChromeHidden(); 10 var chromeHidden = GetChromeHidden();
13 11
14 // WebRequestEvent object. This is used for special webRequest events with 12 // WebRequestEvent object. This is used for special webRequest events with
15 // extra parameters. Each invocation of addListener creates a new named 13 // extra parameters. Each invocation of addListener creates a new named
16 // sub-event. That sub-event is associated with the extra parameters in the 14 // sub-event. That sub-event is associated with the extra parameters in the
17 // browser process, so that only it is dispatched when the main event occurs 15 // browser process, so that only it is dispatched when the main event occurs
18 // matching the extra parameters. 16 // matching the extra parameters.
19 // 17 //
20 // Example: 18 // Example:
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 {forIOThread: true}); 133 {forIOThread: true});
136 }); 134 });
137 135
138 apiFunctions.setHandleRequest("webRequest.handlerBehaviorChanged", 136 apiFunctions.setHandleRequest("webRequest.handlerBehaviorChanged",
139 function() { 137 function() {
140 var args = Array.prototype.slice.call(arguments); 138 var args = Array.prototype.slice.call(arguments);
141 sendRequest(this.name, args, this.definition.parameters, 139 sendRequest(this.name, args, this.definition.parameters,
142 {forIOThread: true}); 140 {forIOThread: true});
143 }); 141 });
144 }); 142 });
145
146 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698