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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 uint32_t id) { | 119 uint32_t id) { |
120 } | 120 } |
121 | 121 |
122 bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) { | 122 bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) { |
123 bool found = false; | 123 bool found = false; |
124 for (auto listener : listeners_) | 124 for (auto listener : listeners_) |
125 found |= listener->AcceptConnection(connection); | 125 found |= listener->AcceptConnection(connection); |
126 return found; | 126 return found; |
127 } | 127 } |
128 | 128 |
129 void MojoShellConnectionImpl::ShellConnectionLost() { | |
130 LOG(ERROR) << "Shell connection lost."; | |
131 } | |
132 | |
133 mojo::Connector* MojoShellConnectionImpl::GetConnector() { | 129 mojo::Connector* MojoShellConnectionImpl::GetConnector() { |
134 DCHECK(shell_connection_); | 130 DCHECK(shell_connection_); |
135 return shell_connection_->connector(); | 131 return shell_connection_->connector(); |
136 } | 132 } |
137 | 133 |
138 bool MojoShellConnectionImpl::UsingExternalShell() const { | 134 bool MojoShellConnectionImpl::UsingExternalShell() const { |
139 return external_; | 135 return external_; |
140 } | 136 } |
141 | 137 |
142 void MojoShellConnectionImpl::AddListener(Listener* listener) { | 138 void MojoShellConnectionImpl::AddListener(Listener* listener) { |
(...skipping 16 matching lines...) Expand all Loading... |
159 // static | 155 // static |
160 void MojoShellConnection::Destroy() { | 156 void MojoShellConnection::Destroy() { |
161 // This joins the shell controller thread. | 157 // This joins the shell controller thread. |
162 delete Get(); | 158 delete Get(); |
163 lazy_tls_ptr.Pointer()->Set(nullptr); | 159 lazy_tls_ptr.Pointer()->Set(nullptr); |
164 } | 160 } |
165 | 161 |
166 MojoShellConnection::~MojoShellConnection() {} | 162 MojoShellConnection::~MojoShellConnection() {} |
167 | 163 |
168 } // namespace content | 164 } // namespace content |
OLD | NEW |