| OLD | NEW |
| 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 binding for the webRequest API. | 5 // Custom binding for the webRequest API. |
| 6 | 6 |
| 7 var binding = require('binding').Binding.create('webRequest'); | 7 var binding = require('binding').Binding.create('webRequest'); |
| 8 | 8 |
| 9 var webRequestNatives = requireNative('web_request'); | 9 var webRequestNatives = requireNative('web_request'); |
| 10 var GetUniqueSubEventName = webRequestNatives.GetUniqueSubEventName; | 10 var GetUniqueSubEventName = webRequestNatives.GetUniqueSubEventName; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 binding.registerCustomEvent(WebRequestEvent); | 155 binding.registerCustomEvent(WebRequestEvent); |
| 156 | 156 |
| 157 binding.registerCustomHook(function(api) { | 157 binding.registerCustomHook(function(api) { |
| 158 var apiFunctions = api.apiFunctions; | 158 var apiFunctions = api.apiFunctions; |
| 159 | 159 |
| 160 apiFunctions.setHandleRequest('handlerBehaviorChanged', function() { | 160 apiFunctions.setHandleRequest('handlerBehaviorChanged', function() { |
| 161 var args = Array.prototype.slice.call(arguments); | 161 var args = Array.prototype.slice.call(arguments); |
| 162 sendRequest(this.name, args, this.definition.parameters, | 162 sendRequest(this.name, args, this.definition.parameters, |
| 163 {forIOThread: true}); | 163 {forIOThread: true}); |
| 164 }); | 164 }, true); |
| 165 }); | 165 }); |
| 166 | 166 |
| 167 exports.binding = binding.generate(); | 167 exports.binding = binding.generate(); |
| OLD | NEW |