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..b50047186910713c172064fa12ed2594af309ef1 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" |
Fady Samuel
2015/11/24 04:42:38
delete this.
|
#include "base/threading/thread_local.h" |
#include "mojo/application/public/cpp/application_delegate.h" |
#include "mojo/application/public/cpp/application_impl.h" |
@@ -62,6 +63,8 @@ void MojoShellConnectionImpl::Initialize(mojo::ApplicationImpl* application) { |
bool MojoShellConnectionImpl::ConfigureIncomingConnection( |
mojo::ApplicationConnection* connection) { |
+ fprintf(stderr, "[%d] >>>%s url %s \n", base::GetCurrentProcId(), |
+ __PRETTY_FUNCTION__, connection->GetRemoteApplicationURL().c_str()); |
bool found = false; |
for (auto listener : listeners_) |
found |= listener->ConfigureIncomingConnection(connection); |
@@ -85,6 +88,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 +100,7 @@ MojoShellConnection* MojoShellConnection::Get() { |
// static |
void MojoShellConnection::Destroy() { |
+ static_cast<MojoShellConnectionImpl*>(Get())->OnDestroy(); |
// This joins the shell controller thread. |
delete Get(); |
lazy_tls_ptr.Pointer()->Set(nullptr); |