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

Unified Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 1461243002: [OLD ATTEMPT, DO NOT REVIEW] mustash: Enable connections to mus from the Chrome renderer Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A bunch of cleanup Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/common/mojo/mojo_shell_connection_impl.cc
diff --git a/content/common/mojo/mojo_shell_connection_impl.cc b/content/common/mojo/mojo_shell_connection_impl.cc
index 25c8be1c0e7eae4a06dcdab0f5bbb078502246f2..8d66522ecd54bd6f2d75813280bf3e64afe576cd 100644
--- a/content/common/mojo/mojo_shell_connection_impl.cc
+++ b/content/common/mojo/mojo_shell_connection_impl.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/process/process_handle.h"
Ben Goodger (Google) 2015/11/24 06:42:40 ??
Fady Samuel 2015/11/24 13:32:06 Done.
#include "base/threading/thread_local.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/application/public/cpp/application_impl.h"
@@ -85,6 +86,11 @@ void MojoShellConnectionImpl::RemoveListener(Listener* listener) {
listeners_.erase(it);
}
+void MojoShellConnectionImpl::OnDestroy() {
+ for (auto listener : listeners_)
+ listener->OnDestroy();
+}
+
// static
MojoShellConnection* MojoShellConnection::Get() {
return lazy_tls_ptr.Pointer()->Get();
@@ -92,6 +98,7 @@ MojoShellConnection* MojoShellConnection::Get() {
// static
void MojoShellConnection::Destroy() {
+ static_cast<MojoShellConnectionImpl*>(Get())->OnDestroy();
Ben Goodger (Google) 2015/11/24 06:42:40 can this be done in ~MojoShellConnectionImpl?
Fady Samuel 2015/11/24 13:32:06 Done.
// This joins the shell controller thread.
delete Get();
lazy_tls_ptr.Pointer()->Set(nullptr);

Powered by Google App Engine
This is Rietveld 408576698