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

Unified Diff: chrome/browser/resources/plugins.js

Issue 2556353004: Mojo JS bindings: code generator maps interface ptr and request to InterfacePtr and InterfaceReques… (Closed)
Patch Set: . Created 4 years 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: chrome/browser/resources/plugins.js
diff --git a/chrome/browser/resources/plugins.js b/chrome/browser/resources/plugins.js
index 8acef3c763728f2773be649a4d82ba0232f29ce7..bffd6bb456c5062ac1c06882de56f851c0cdb975 100644
--- a/chrome/browser/resources/plugins.js
+++ b/chrome/browser/resources/plugins.js
@@ -227,35 +227,33 @@ var browserProxy = null;
function initializeProxies() {
return importModules([
+ 'mojo/public/js/bindings',
'mojo/public/js/connection',
'chrome/browser/ui/webui/plugins/plugins.mojom',
'content/public/renderer/frame_interfaces',
]).then(function(modules) {
- var connection = modules[0];
- var pluginsMojom = modules[1];
- var frameInterfaces = modules[2];
+ var bindings = modules[0];
+ var connection = modules[1];
+ var pluginsMojom = modules[2];
+ var frameInterfaces = modules[3];
browserProxy = connection.bindHandleToProxy(
frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name),
pluginsMojom.PluginsPageHandler);
/** @constructor */
- var PluginsPageImpl = function() {};
+ var PluginsPageImpl = function() {
+ this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this);
+ };
PluginsPageImpl.prototype = {
- __proto__: pluginsMojom.PluginsPage.stubClass.prototype,
-
/** @override */
onPluginsUpdated: function(plugins) {
returnPluginsData({plugins: plugins});
},
};
pageImpl = new PluginsPageImpl();
-
- // Create a message pipe, with one end of the pipe already connected to JS.
- var handle = connection.bindStubDerivedImpl(pageImpl);
- // Send the other end of the pipe to C++.
- browserProxy.setClientPage(handle);
+ browserProxy.setClientPage(pageImpl.binding.createInterfacePtrAndBind());
});
}

Powered by Google App Engine
This is Rietveld 408576698