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

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 1688433005: Revert of Clean up public interface of AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 scoped_ptr<ChromotingHost> host_; 452 scoped_ptr<ChromotingHost> host_;
453 453
454 // Used to keep this HostProcess alive until it is shutdown. 454 // Used to keep this HostProcess alive until it is shutdown.
455 scoped_refptr<HostProcess> self_; 455 scoped_refptr<HostProcess> self_;
456 456
457 #if defined(REMOTING_MULTI_PROCESS) 457 #if defined(REMOTING_MULTI_PROCESS)
458 // Accessed on the UI thread. 458 // Accessed on the UI thread.
459 scoped_ptr<IPC::ChannelProxy> daemon_channel_; 459 scoped_ptr<IPC::ChannelProxy> daemon_channel_;
460 460
461 // AttachmentBroker for |daemon_channel_|.
462 scoped_ptr<IPC::AttachmentBrokerUnprivileged> attachment_broker_;
463
461 // Owned as |desktop_environment_factory_|. 464 // Owned as |desktop_environment_factory_|.
462 DesktopSessionConnector* desktop_session_connector_ = nullptr; 465 DesktopSessionConnector* desktop_session_connector_ = nullptr;
463 #endif // defined(REMOTING_MULTI_PROCESS) 466 #endif // defined(REMOTING_MULTI_PROCESS)
464 467
465 int* exit_code_out_; 468 int* exit_code_out_;
466 bool signal_parent_; 469 bool signal_parent_;
467 470
468 scoped_refptr<PairingRegistry> pairing_registry_; 471 scoped_refptr<PairingRegistry> pairing_registry_;
469 472
470 ShutdownWatchdog* shutdown_watchdog_; 473 ShutdownWatchdog* shutdown_watchdog_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 base::FileDescriptor pipe(pipe_handle, true); 535 base::FileDescriptor pipe(pipe_handle, true);
533 IPC::ChannelHandle channel_handle(channel_name, pipe); 536 IPC::ChannelHandle channel_handle(channel_name, pipe);
534 #endif // defined(OS_POSIX) 537 #endif // defined(OS_POSIX)
535 538
536 // Connect to the daemon process. 539 // Connect to the daemon process.
537 daemon_channel_ = IPC::ChannelProxy::Create(channel_handle, 540 daemon_channel_ = IPC::ChannelProxy::Create(channel_handle,
538 IPC::Channel::MODE_CLIENT, 541 IPC::Channel::MODE_CLIENT,
539 this, 542 this,
540 context_->network_task_runner()); 543 context_->network_task_runner());
541 544
542 IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); 545 attachment_broker_ = IPC::AttachmentBrokerUnprivileged::CreateBroker();
543 IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal(); 546 if (attachment_broker_) {
544 if (broker && !broker->IsPrivilegedBroker()) 547 attachment_broker_->DesignateBrokerCommunicationChannel(
545 broker->DesignateBrokerCommunicationChannel(daemon_channel_.get()); 548 daemon_channel_.get());
549 }
546 550
547 #else // !defined(REMOTING_MULTI_PROCESS) 551 #else // !defined(REMOTING_MULTI_PROCESS)
548 if (cmd_line->HasSwitch(kHostConfigSwitchName)) { 552 if (cmd_line->HasSwitch(kHostConfigSwitchName)) {
549 host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName); 553 host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName);
550 554
551 // Read config from stdin if necessary. 555 // Read config from stdin if necessary.
552 if (host_config_path_ == base::FilePath(kStdinConfigPath)) { 556 if (host_config_path_ == base::FilePath(kStdinConfigPath)) {
553 const size_t kBufferSize = 4096; 557 const size_t kBufferSize = 4096;
554 scoped_ptr<char[]> buf(new char[kBufferSize]); 558 scoped_ptr<char[]> buf(new char[kBufferSize]);
555 size_t len; 559 size_t len;
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); 1739 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds));
1736 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); 1740 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog);
1737 1741
1738 // Run the main (also UI) message loop until the host no longer needs it. 1742 // Run the main (also UI) message loop until the host no longer needs it.
1739 message_loop.Run(); 1743 message_loop.Run();
1740 1744
1741 return exit_code; 1745 return exit_code;
1742 } 1746 }
1743 1747
1744 } // namespace remoting 1748 } // namespace remoting
OLDNEW
« 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