| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 var Event = require('event_bindings').Event; | 5 var Event = require('event_bindings').Event; |
| 6 var forEach = require('utils').forEach; | 6 var forEach = require('utils').forEach; |
| 7 // Note: Beware sneaky getters/setters when using GetAvailbility(). Use safe/raw | 7 // Note: Beware sneaky getters/setters when using GetAvailbility(). Use safe/raw |
| 8 // variables as arguments. | 8 // variables as arguments. |
| 9 var GetAvailability = requireNative('v8_context').GetAvailability; | 9 var GetAvailability = requireNative('v8_context').GetAvailability; |
| 10 var exceptionHandler = require('uncaught_exception_handler'); | 10 var exceptionHandler = require('uncaught_exception_handler'); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // TODO(kalman/cduvall): Refactor this so |runHooks_| is not needed. | 228 // TODO(kalman/cduvall): Refactor this so |runHooks_| is not needed. |
| 229 runHooks_: function(api, schema) { | 229 runHooks_: function(api, schema) { |
| 230 $Array.forEach(this.customHooks_, function(hook) { | 230 $Array.forEach(this.customHooks_, function(hook) { |
| 231 if (!isSchemaNodeSupported(schema, platform, manifestVersion)) | 231 if (!isSchemaNodeSupported(schema, platform, manifestVersion)) |
| 232 return; | 232 return; |
| 233 | 233 |
| 234 if (!hook) | 234 if (!hook) |
| 235 return; | 235 return; |
| 236 | 236 |
| 237 hook({ | 237 hook({ |
| 238 __proto__: null, |
| 238 apiFunctions: this.apiFunctions_, | 239 apiFunctions: this.apiFunctions_, |
| 239 schema: schema, | 240 schema: schema, |
| 240 compiledApi: api | 241 compiledApi: api |
| 241 }, extensionId, contextType); | 242 }, extensionId, contextType); |
| 242 }, this); | 243 }, this); |
| 243 }, | 244 }, |
| 244 | 245 |
| 245 // Generates the bindings from the schema for |this.apiName_| and integrates | 246 // Generates the bindings from the schema for |this.apiName_| and integrates |
| 246 // any custom bindings that might be present. | 247 // any custom bindings that might be present. |
| 247 generate: function() { | 248 generate: function() { |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 availability.message); | 568 availability.message); |
| 568 return; | 569 return; |
| 569 } | 570 } |
| 570 | 571 |
| 571 this.runHooks_(mod, schema); | 572 this.runHooks_(mod, schema); |
| 572 return mod; | 573 return mod; |
| 573 } | 574 } |
| 574 }; | 575 }; |
| 575 | 576 |
| 576 exports.$set('Binding', Binding); | 577 exports.$set('Binding', Binding); |
| OLD | NEW |