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

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: Invert connection creation flow. Needs lots of work. 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..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);

Powered by Google App Engine
This is Rietveld 408576698