| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 uint32_t id) { | 91 uint32_t id) { |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) { | 94 bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) { |
| 95 bool found = false; | 95 bool found = false; |
| 96 for (auto listener : listeners_) | 96 for (auto listener : listeners_) |
| 97 found |= listener->AcceptConnection(connection); | 97 found |= listener->AcceptConnection(connection); |
| 98 return found; | 98 return found; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void MojoShellConnectionImpl::ShellConnectionLost() { | |
| 102 LOG(ERROR) << "Shell connection lost."; | |
| 103 } | |
| 104 | |
| 105 mojo::Connector* MojoShellConnectionImpl::GetConnector() { | 101 mojo::Connector* MojoShellConnectionImpl::GetConnector() { |
| 106 DCHECK(shell_connection_); | 102 DCHECK(shell_connection_); |
| 107 return shell_connection_->connector(); | 103 return shell_connection_->connector(); |
| 108 } | 104 } |
| 109 | 105 |
| 110 bool MojoShellConnectionImpl::UsingExternalShell() const { | 106 bool MojoShellConnectionImpl::UsingExternalShell() const { |
| 111 return external_; | 107 return external_; |
| 112 } | 108 } |
| 113 | 109 |
| 114 void MojoShellConnectionImpl::AddListener(Listener* listener) { | 110 void MojoShellConnectionImpl::AddListener(Listener* listener) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 131 // static | 127 // static |
| 132 void MojoShellConnection::Destroy() { | 128 void MojoShellConnection::Destroy() { |
| 133 // This joins the shell controller thread. | 129 // This joins the shell controller thread. |
| 134 delete Get(); | 130 delete Get(); |
| 135 lazy_tls_ptr.Pointer()->Set(nullptr); | 131 lazy_tls_ptr.Pointer()->Set(nullptr); |
| 136 } | 132 } |
| 137 | 133 |
| 138 MojoShellConnection::~MojoShellConnection() {} | 134 MojoShellConnection::~MojoShellConnection() {} |
| 139 | 135 |
| 140 } // namespace content | 136 } // namespace content |
| OLD | NEW |