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

Unified Diff: content/common/child_process_host_impl.cc

Issue 1260053003: Update contents to use attachment broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_refactor2
Patch Set: Use new api. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | content/public/common/child_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_process_host_impl.cc
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
index bd420dfaf2cdacb9ee75bbe5285264b4f6ca1bdd..529556d4000fe2f7a77073c5b5f0bac9c3858598 100644
--- a/content/common/child_process_host_impl.cc
+++ b/content/common/child_process_host_impl.cc
@@ -149,12 +149,12 @@ base::FilePath ChildProcessHost::GetChildPath(int flags) {
}
// static
-IPC::AttachmentBroker* ChildProcessHost::GetAttachmentBroker() {
-#if defined(OS_WIN)
+IPC::AttachmentBrokerPrivileged* ChildProcessHost::GetAttachmentBroker() {
+#if USE_ATTACHMENT_BROKER
return &g_attachment_broker.Get();
#else
return nullptr;
-#endif // defined(OS_WIN)
+#endif // USE_ATTACHMENT_BROKER
}
ChildProcessHostImpl::ChildProcessHostImpl(ChildProcessHostDelegate* delegate)
@@ -166,6 +166,9 @@ ChildProcessHostImpl::ChildProcessHostImpl(ChildProcessHostDelegate* delegate)
}
ChildProcessHostImpl::~ChildProcessHostImpl() {
+#if USE_ATTACHMENT_BROKER
+ g_attachment_broker.Get().DeregisterCommunicationChannel(channel_.get());
+#endif
for (size_t i = 0; i < filters_.size(); ++i) {
filters_[i]->OnChannelClosing();
filters_[i]->OnFilterRemoved();
@@ -189,6 +192,9 @@ std::string ChildProcessHostImpl::CreateChannel() {
IPC::Channel::CreateServer(channel_id_, this, GetAttachmentBroker());
if (!channel_->Connect())
return std::string();
+#if USE_ATTACHMENT_BROKER
+ g_attachment_broker.Get().RegisterCommunicationChannel(channel_.get());
+#endif
for (size_t i = 0; i < filters_.size(); ++i)
filters_[i]->OnFilterAdded(channel_.get());
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | content/public/common/child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698