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

Unified Diff: chrome/browser/resources/omnibox/omnibox.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/omnibox/omnibox.js
diff --git a/chrome/browser/resources/omnibox/omnibox.js b/chrome/browser/resources/omnibox/omnibox.js
index 7fa1ef5ce49989525502ac69cf033ea550f5ddd4..11c4a9939d948dcfa02e842863197c216b318f50 100644
--- a/chrome/browser/resources/omnibox/omnibox.js
+++ b/chrome/browser/resources/omnibox/omnibox.js
@@ -415,24 +415,26 @@
function initializeProxies() {
return importModules([
+ 'mojo/public/js/bindings',
'mojo/public/js/connection',
'chrome/browser/ui/webui/omnibox/omnibox.mojom',
'content/public/renderer/frame_interfaces',
]).then(function(modules) {
- var connection = modules[0];
- var mojom = modules[1];
- var frameInterfaces = modules[2];
+ var bindings = modules[0];
+ var connection = modules[1];
+ var mojom = modules[2];
+ var frameInterfaces = modules[3];
browserProxy = connection.bindHandleToProxy(
frameInterfaces.getInterface(mojom.OmniboxPageHandler.name),
mojom.OmniboxPageHandler);
/** @constructor */
- var OmniboxPageImpl = function() {};
+ var OmniboxPageImpl = function() {
+ this.binding = new bindings.Binding(mojom.OmniboxPage, this);
+ };
OmniboxPageImpl.prototype = {
- __proto__: mojom.OmniboxPage.stubClass.prototype,
-
/** @override */
handleNewAutocompleteResult: function(result) {
progressiveAutocompleteResults.push(result);
@@ -441,12 +443,7 @@
};
pageImpl = new OmniboxPageImpl();
-
- // 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