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

Side by Side Diff: extensions/renderer/resources/binding.js

Issue 1960903002: [Extensions] Clean and update runtime bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
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
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698