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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 for (auto listener : listeners_) | 123 for (auto listener : listeners_) |
124 found |= listener->AcceptConnection(connection); | 124 found |= listener->AcceptConnection(connection); |
125 return found; | 125 return found; |
126 } | 126 } |
127 | 127 |
128 shell::Connector* MojoShellConnectionImpl::GetConnector() { | 128 shell::Connector* MojoShellConnectionImpl::GetConnector() { |
129 DCHECK(shell_connection_); | 129 DCHECK(shell_connection_); |
130 return shell_connection_->connector(); | 130 return shell_connection_->connector(); |
131 } | 131 } |
132 | 132 |
| 133 const shell::Identity& MojoShellConnectionImpl::GetIdentity() const { |
| 134 DCHECK(shell_connection_); |
| 135 return shell_connection_->identity(); |
| 136 } |
| 137 |
133 bool MojoShellConnectionImpl::UsingExternalShell() const { | 138 bool MojoShellConnectionImpl::UsingExternalShell() const { |
134 return external_; | 139 return external_; |
135 } | 140 } |
136 | 141 |
137 void MojoShellConnectionImpl::SetConnectionLostClosure( | 142 void MojoShellConnectionImpl::SetConnectionLostClosure( |
138 const base::Closure& closure) { | 143 const base::Closure& closure) { |
139 shell_connection_->set_connection_lost_closure(closure); | 144 shell_connection_->set_connection_lost_closure(closure); |
140 } | 145 } |
141 | 146 |
142 void MojoShellConnectionImpl::AddListener(std::unique_ptr<Listener> listener) { | 147 void MojoShellConnectionImpl::AddListener(std::unique_ptr<Listener> listener) { |
(...skipping 18 matching lines...) Expand all Loading... |
161 // static | 166 // static |
162 void MojoShellConnection::Destroy() { | 167 void MojoShellConnection::Destroy() { |
163 // This joins the shell controller thread. | 168 // This joins the shell controller thread. |
164 delete Get(); | 169 delete Get(); |
165 lazy_tls_ptr.Pointer()->Set(nullptr); | 170 lazy_tls_ptr.Pointer()->Set(nullptr); |
166 } | 171 } |
167 | 172 |
168 MojoShellConnection::~MojoShellConnection() {} | 173 MojoShellConnection::~MojoShellConnection() {} |
169 | 174 |
170 } // namespace content | 175 } // namespace content |
OLD | NEW |