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

Unified Diff: content/test/data/web_ui_mojo.js

Issue 206923002: Adds plumbing to pass WebUI mojo::Handle from browser to renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge 2 trunk Created 6 years, 9 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: content/test/data/web_ui_mojo.js
diff --git a/content/test/data/web_ui_mojo.js b/content/test/data/web_ui_mojo.js
new file mode 100644
index 0000000000000000000000000000000000000000..84ba92a2b2a80eef914c65c1da188f9b2f25168c
--- /dev/null
+++ b/content/test/data/web_ui_mojo.js
@@ -0,0 +1,31 @@
+define('main', [
+ 'mojo/public/bindings/js/connector',
+ 'content/test/data/web_ui_test_mojo_bindings.mojom',
+], function(connector, bindings) {
+
+ function RendererTargetTest(bindings) {
+ this.bindings_ = bindings;
+ }
+
+ // TODO(aa): It is a bummer to need this stub object in JavaScript. We should
+ // have a 'client' object that contains both the sending and receiving bits of
+ // the client side of the interface. Since JS is loosely typed, we do not need
+ // a separate base class to inherit from to receive callbacks.
+ RendererTargetTest.prototype =
+ Object.create(bindings.RendererTargetStub.prototype);
+
+ RendererTargetTest.prototype.test = function() {
darin (slow to review) 2014/03/21 00:04:52 it looks like these few lines are repeated below.
sky 2014/03/21 03:19:16 Good catch. The case is slightly different and thi
+ this.bindings_.test();
+ };
+
+ RendererTargetTest.prototype.Test = function() {
+ this.bindings_.test();
+ };
+
+ var connection;
+
+ return function(handle) {
+ connection = new connector.Connection(handle, RendererTargetTest,
+ bindings.RendererTargetProxy);
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698