OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/mojo/mojo_shell_connection_impl.h" | 5 #include "content/common/mojo/mojo_shell_connection_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 WaitForShell(std::move(handle)); | 57 WaitForShell(std::move(handle)); |
58 } | 58 } |
59 | 59 |
60 MojoShellConnectionImpl::MojoShellConnectionImpl() : initialized_(false) {} | 60 MojoShellConnectionImpl::MojoShellConnectionImpl() : initialized_(false) {} |
61 MojoShellConnectionImpl::~MojoShellConnectionImpl() { | 61 MojoShellConnectionImpl::~MojoShellConnectionImpl() { |
62 STLDeleteElements(&listeners_); | 62 STLDeleteElements(&listeners_); |
63 } | 63 } |
64 | 64 |
65 void MojoShellConnectionImpl::WaitForShell( | 65 void MojoShellConnectionImpl::WaitForShell( |
66 mojo::ScopedMessagePipeHandle handle) { | 66 mojo::ScopedMessagePipeHandle handle) { |
67 mojo::InterfaceRequest<mojo::Application> application_request; | 67 mojo::ApplicationRequest application_request; |
68 runner_connection_.reset(mojo::shell::RunnerConnection::ConnectToRunner( | 68 runner_connection_.reset(mojo::shell::RunnerConnection::ConnectToRunner( |
69 &application_request, std::move(handle))); | 69 &application_request, std::move(handle))); |
70 application_impl_.reset( | 70 application_impl_.reset( |
71 new mojo::ApplicationImpl(this, std::move(application_request))); | 71 new mojo::ApplicationImpl(this, std::move(application_request))); |
72 application_impl_->WaitForInitialize(); | 72 application_impl_->WaitForInitialize(); |
73 } | 73 } |
74 | 74 |
75 void MojoShellConnectionImpl::Initialize(mojo::ApplicationImpl* application) { | 75 void MojoShellConnectionImpl::Initialize(mojo::ApplicationImpl* application) { |
76 initialized_ = true; | 76 initialized_ = true; |
77 } | 77 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // static | 109 // static |
110 void MojoShellConnection::Destroy() { | 110 void MojoShellConnection::Destroy() { |
111 // This joins the shell controller thread. | 111 // This joins the shell controller thread. |
112 delete Get(); | 112 delete Get(); |
113 lazy_tls_ptr.Pointer()->Set(nullptr); | 113 lazy_tls_ptr.Pointer()->Set(nullptr); |
114 } | 114 } |
115 | 115 |
116 MojoShellConnection::~MojoShellConnection() {} | 116 MojoShellConnection::~MojoShellConnection() {} |
117 | 117 |
118 } // namespace content | 118 } // namespace content |
OLD | NEW |