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

Unified Diff: third_party/mojo/src/mojo/public/js/connection.js

Issue 910883002: Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply 9f87aeadbda22441b7d469e596f7bd7d0d73e2a8 (https://codereview.chromium.org/908973002/) Created 5 years, 10 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: third_party/mojo/src/mojo/public/js/connection.js
diff --git a/third_party/mojo/src/mojo/public/js/connection.js b/third_party/mojo/src/mojo/public/js/connection.js
index 223e71128911ea8ddb329a1cbdfea3b5185df07a..4a7a8b8883db9e7455b46e4c6f8003657e25ea87 100644
--- a/third_party/mojo/src/mojo/public/js/connection.js
+++ b/third_party/mojo/src/mojo/public/js/connection.js
@@ -140,10 +140,13 @@ define("mojo/public/js/connection", [
}
// Return a handle for a message pipe that's connected to a stub for
- // localInterface. The stub delegates to impl. Used by generated code for
- // outgoing interface parameters: the caller specifies impl, and the generated
- // code sends the handle returned by this function.
- function bindImpl(impl, localInterface) {
+ // localInterface. Used by generated code for outgoing interface
+ // parameters: the caller is given the generated stub via
+ // |stubCallback(stub)| and the generated code sends the handle
+ // returned by this function. The caller is responsible for managing
+ // the lifetime of the stub and for setting it's implementation
+ // delegate with: StubBindings(stub).delegate = myImpl;
+ function bindImpl(stubCallback, localInterface) {
var messagePipe = core.createMessagePipe();
if (messagePipe.result != core.RESULT_OK)
throw new Error("createMessagePipe failed " + messagePipe.result);
@@ -152,8 +155,8 @@ define("mojo/public/js/connection", [
var router = new Router(messagePipe.handle0);
var connection = new BaseConnection(stub, undefined, router);
StubBindings(stub).connection = connection;
- if (impl)
- StubBindings(stub).delegate = impl;
+ if (stubCallback)
+ stubCallback(stub);
return messagePipe.handle1;
}

Powered by Google App Engine
This is Rietveld 408576698