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

Unified Diff: remoting/host/remoting_me2me_host.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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index a80ef55b04ccd02ee409911c4d40f500a6f1d17d..9004846aac9a4949d73879419ac0ae4160746a35 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -461,9 +461,6 @@ class HostProcess : public ConfigWatcher::Delegate,
// Accessed on the UI thread.
scoped_ptr<IPC::ChannelProxy> daemon_channel_;
- // AttachmentBroker for |daemon_channel_|.
- scoped_ptr<IPC::AttachmentBrokerUnprivileged> attachment_broker_;
-
// Owned as |desktop_environment_factory_|.
DesktopSessionConnector* desktop_session_connector_ = nullptr;
#endif // defined(REMOTING_MULTI_PROCESS)
@@ -545,11 +542,10 @@ bool HostProcess::InitWithCommandLine(const base::CommandLine* cmd_line) {
this,
context_->network_task_runner());
- 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());
#else // !defined(REMOTING_MULTI_PROCESS)
if (cmd_line->HasSwitch(kHostConfigSwitchName)) {
@@ -931,7 +927,9 @@ void HostProcess::ShutdownOnUiThread() {
policy_watcher_.reset();
#if defined(REMOTING_MULTI_PROCESS)
- attachment_broker_.reset();
+ IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
+ if (broker && !broker->IsPrivilegedBroker())
+ broker->DeregisterBrokerCommunicationChannel(daemon_channel_.get());
daemon_channel_.reset();
#endif // defined(REMOTING_MULTI_PROCESS)
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698