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

Unified Diff: extensions/renderer/resources/app_runtime_custom_bindings.js

Issue 2912883004: [Extensions Bindings] Don't allow `event` module with native bindings (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/resources/app_runtime_custom_bindings.js
diff --git a/extensions/renderer/resources/app_runtime_custom_bindings.js b/extensions/renderer/resources/app_runtime_custom_bindings.js
index f40f44df7df2c7837981a1bd0bda8f4b69f2acea..751a55a8749833af4790c632400b1d67609003dc 100644
--- a/extensions/renderer/resources/app_runtime_custom_bindings.js
+++ b/extensions/renderer/resources/app_runtime_custom_bindings.js
@@ -10,13 +10,15 @@ var AppViewGuestInternal =
getInternalApi ?
getInternalApi('appViewGuestInternal') :
require('binding').Binding.create('appViewGuestInternal').generate();
-var eventBindings = require('event_bindings');
+var registerArgumentMassager = bindingUtil ?
+ bindingUtil.registerEventArgumentMassager.bind(bindingUtil) :
jbroman 2017/06/12 15:09:49 Do we need to use $Function.bind here?
Devlin 2017/06/12 20:30:14 Done.
+ require('event_bindings').registerArgumentMassager;
var fileSystemHelpers = requireNative('file_system_natives');
var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem;
var entryIdManager = require('entryIdManager');
-eventBindings.registerArgumentMassager('app.runtime.onEmbedRequested',
- function(args, dispatch) {
+registerArgumentMassager('app.runtime.onEmbedRequested',
+ function(args, dispatch) {
var appEmbeddingRequest = args[0];
var id = appEmbeddingRequest.guestInstanceId;
delete appEmbeddingRequest.guestInstanceId;
@@ -31,8 +33,7 @@ eventBindings.registerArgumentMassager('app.runtime.onEmbedRequested',
dispatch([appEmbeddingRequest]);
});
-eventBindings.registerArgumentMassager('app.runtime.onLaunched',
- function(args, dispatch) {
+registerArgumentMassager('app.runtime.onLaunched', function(args, dispatch) {
var launchData = args[0];
if (launchData.items) {
// An onLaunched corresponding to file_handlers in the app's manifest.

Powered by Google App Engine
This is Rietveld 408576698