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

Unified Diff: remoting/host/desktop_process.cc

Issue 1679763002: Clean up public interface of AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove CHECK. Created 4 years, 10 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 | « remoting/host/desktop_process.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_process.cc
diff --git a/remoting/host/desktop_process.cc b/remoting/host/desktop_process.cc
index b0afa8e16d072444577e019908b732179b927839..e59b8a58be8e2d5ee6f864ad8783e5bc268dc0a7 100644
--- a/remoting/host/desktop_process.cc
+++ b/remoting/host/desktop_process.cc
@@ -82,6 +82,9 @@ void DesktopProcess::OnChannelConnected(int32_t peer_pid) {
void DesktopProcess::OnChannelError() {
// Shutdown the desktop process.
+ IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
+ if (broker && !broker->IsPrivilegedBroker())
+ broker->DeregisterBrokerCommunicationChannel(daemon_channel_.get());
daemon_channel_.reset();
if (desktop_agent_.get()) {
desktop_agent_->Stop();
@@ -141,14 +144,10 @@ bool DesktopProcess::Start(
IPC::ChannelProxy::Create(daemon_channel_name_, IPC::Channel::MODE_CLIENT,
this, io_task_runner.get());
- // Attachment broker may be already created in tests.
- if (!IPC::AttachmentBroker::GetGlobal())
- attachment_broker_ = IPC::AttachmentBrokerUnprivileged::CreateBroker();
-
- if (attachment_broker_) {
- attachment_broker_->DesignateBrokerCommunicationChannel(
- daemon_channel_.get());
- }
+ IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
+ IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
+ if (broker && !broker->IsPrivilegedBroker())
+ broker->RegisterBrokerCommunicationChannel(daemon_channel_.get());
// Pass |desktop_pipe| to the daemon.
daemon_channel_->Send(
« no previous file with comments | « remoting/host/desktop_process.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698