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

Unified Diff: mojo/apps/js/js_app.cc

Issue 686203004: Mojo JS Bindings: Simplify sharing services for content-provided JS applications (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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: mojo/apps/js/js_app.cc
diff --git a/mojo/apps/js/js_app.cc b/mojo/apps/js/js_app.cc
index f3550fa2530719b32958793e8e361bce7ce86260..32499d35ad4189f9a756f0b2ccffce8579af323c 100644
--- a/mojo/apps/js/js_app.cc
+++ b/mojo/apps/js/js_app.cc
@@ -48,22 +48,24 @@ void JSApp::Quit() {
FROM_HERE, base::Bind(&JSApp::Terminate, base::Unretained(this)));
}
-Handle JSApp::ConnectToService(const std::string& application_url,
- const std::string& interface_name) {
+MessagePipeHandle JSApp::ConnectToApplication(
+ const std::string& application_url) {
CHECK(on_js_app_thread());
MessagePipe pipe;
+ InterfaceRequest<ServiceProvider> request =
+ MakeRequest<ServiceProvider>(pipe.handle1.Pass());
app_delegate_impl_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&ApplicationDelegateImpl::ConnectToService,
+ base::Bind(&ApplicationDelegateImpl::ConnectToApplication,
base::Unretained(app_delegate_impl_),
- base::Passed(pipe.handle1.Pass()),
application_url,
- interface_name));
+ base::Passed(request.Pass())));
- return pipe.handle0.release();
+ return pipe.handle0.Pass().release();
}
+
void JSApp::Run() {
CHECK(!js_app_task_runner_.get() && !on_app_delegate_impl_thread());
js_app_task_runner_ = base::MessageLoop::current()->task_runner();

Powered by Google App Engine
This is Rietveld 408576698