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

Unified Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 1452823003: Bind Application in renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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
« no previous file with comments | « content/common/mojo/mojo_shell_connection_impl.h ('k') | content/public/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/mojo_shell_connection_impl.cc
diff --git a/content/common/mojo/mojo_shell_connection_impl.cc b/content/common/mojo/mojo_shell_connection_impl.cc
index 5125df35de953d4f6e615a3569d5035e4ca5ca6a..25c8be1c0e7eae4a06dcdab0f5bbb078502246f2 100644
--- a/content/common/mojo/mojo_shell_connection_impl.cc
+++ b/content/common/mojo/mojo_shell_connection_impl.cc
@@ -31,19 +31,26 @@ bool IsRunningInMojoShell() {
// static
void MojoShellConnectionImpl::Create() {
DCHECK(IsRunningInMojoShell());
+ CreateWithMessagePipe(mojo::ScopedMessagePipeHandle());
+}
+
+// static
+void MojoShellConnectionImpl::CreateWithMessagePipe(
+ mojo::ScopedMessagePipeHandle handle) {
DCHECK(!lazy_tls_ptr.Pointer()->Get());
MojoShellConnectionImpl* connection = new MojoShellConnectionImpl;
lazy_tls_ptr.Pointer()->Set(connection);
- connection->WaitForShell();
+ connection->WaitForShell(handle.Pass());
}
MojoShellConnectionImpl::MojoShellConnectionImpl() : initialized_(false) {}
MojoShellConnectionImpl::~MojoShellConnectionImpl() {}
-void MojoShellConnectionImpl::WaitForShell() {
+void MojoShellConnectionImpl::WaitForShell(
+ mojo::ScopedMessagePipeHandle handle) {
mojo::InterfaceRequest<mojo::Application> application_request;
- runner_connection_.reset(
- mojo::runner::RunnerConnection::ConnectToRunner(&application_request));
+ runner_connection_.reset(mojo::runner::RunnerConnection::ConnectToRunner(
+ &application_request, handle.Pass()));
application_impl_.reset(new mojo::ApplicationImpl(
this, application_request.Pass()));
application_impl_->WaitForInitialize();
« no previous file with comments | « content/common/mojo/mojo_shell_connection_impl.h ('k') | content/public/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698