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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 DCHECK(shell_connection_); | 115 DCHECK(shell_connection_); |
116 return shell_connection_->identity(); | 116 return shell_connection_->identity(); |
117 } | 117 } |
118 | 118 |
119 bool MojoShellConnectionImpl::UsingExternalShell() const { | 119 bool MojoShellConnectionImpl::UsingExternalShell() const { |
120 return external_; | 120 return external_; |
121 } | 121 } |
122 | 122 |
123 void MojoShellConnectionImpl::SetConnectionLostClosure( | 123 void MojoShellConnectionImpl::SetConnectionLostClosure( |
124 const base::Closure& closure) { | 124 const base::Closure& closure) { |
125 shell_connection_->set_connection_lost_closure(closure); | 125 shell_connection_->SetConnectionLostClosure(closure); |
126 } | 126 } |
127 | 127 |
128 void MojoShellConnectionImpl::AddListener(std::unique_ptr<Listener> listener) { | 128 void MojoShellConnectionImpl::AddListener(std::unique_ptr<Listener> listener) { |
129 DCHECK(std::find(listeners_.begin(), listeners_.end(), listener.get()) == | 129 DCHECK(std::find(listeners_.begin(), listeners_.end(), listener.get()) == |
130 listeners_.end()); | 130 listeners_.end()); |
131 listeners_.push_back(listener.release()); | 131 listeners_.push_back(listener.release()); |
132 } | 132 } |
133 | 133 |
134 std::unique_ptr<MojoShellConnection::Listener> | 134 std::unique_ptr<MojoShellConnection::Listener> |
135 MojoShellConnectionImpl::RemoveListener(Listener* listener) { | 135 MojoShellConnectionImpl::RemoveListener(Listener* listener) { |
(...skipping 11 matching lines...) Expand all Loading... |
147 // static | 147 // static |
148 void MojoShellConnection::Destroy() { | 148 void MojoShellConnection::Destroy() { |
149 // This joins the shell controller thread. | 149 // This joins the shell controller thread. |
150 delete Get(); | 150 delete Get(); |
151 lazy_tls_ptr.Pointer()->Set(nullptr); | 151 lazy_tls_ptr.Pointer()->Set(nullptr); |
152 } | 152 } |
153 | 153 |
154 MojoShellConnection::~MojoShellConnection() {} | 154 MojoShellConnection::~MojoShellConnection() {} |
155 | 155 |
156 } // namespace content | 156 } // namespace content |
OLD | NEW |