Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 1920033005: services/shell: Fix running the connection-lost callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/mojo/embedded_application_runner.cc ('k') | content/public/common/mojo_shell_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698