| OLD | NEW |
| 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 | 8 |
| 9 #include <cstdint> | 9 #include <cstdint> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 context_->ui_task_runner(); | 463 context_->ui_task_runner(); |
| 464 task_runner->DeleteSoon(FROM_HERE, context_.release()); | 464 task_runner->DeleteSoon(FROM_HERE, context_.release()); |
| 465 } | 465 } |
| 466 | 466 |
| 467 bool HostProcess::InitWithCommandLine(const base::CommandLine* cmd_line) { | 467 bool HostProcess::InitWithCommandLine(const base::CommandLine* cmd_line) { |
| 468 #if defined(REMOTING_MULTI_PROCESS) | 468 #if defined(REMOTING_MULTI_PROCESS) |
| 469 // Mojo keeps the task runner passed to it alive forever, so an | 469 // Mojo keeps the task runner passed to it alive forever, so an |
| 470 // AutoThreadTaskRunner should not be passed to it. Otherwise, the process may | 470 // AutoThreadTaskRunner should not be passed to it. Otherwise, the process may |
| 471 // never shut down cleanly. | 471 // never shut down cleanly. |
| 472 ipc_support_ = base::MakeUnique<mojo::edk::ScopedIPCSupport>( | 472 ipc_support_ = base::MakeUnique<mojo::edk::ScopedIPCSupport>( |
| 473 context_->network_task_runner()->task_runner()); | 473 context_->network_task_runner()->task_runner(), |
| 474 mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST); |
| 474 mojo::edk::SetParentPipeHandle( | 475 mojo::edk::SetParentPipeHandle( |
| 475 mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( | 476 mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( |
| 476 *cmd_line)); | 477 *cmd_line)); |
| 477 | 478 |
| 478 // Connect to the daemon process. | 479 // Connect to the daemon process. |
| 479 daemon_channel_ = IPC::ChannelProxy::Create( | 480 daemon_channel_ = IPC::ChannelProxy::Create( |
| 480 mojo::edk::CreateChildMessagePipe( | 481 mojo::edk::CreateChildMessagePipe( |
| 481 cmd_line->GetSwitchValueASCII(kMojoPipeToken)) | 482 cmd_line->GetSwitchValueASCII(kMojoPipeToken)) |
| 482 .release(), | 483 .release(), |
| 483 IPC::Channel::MODE_CLIENT, this, context_->network_task_runner()); | 484 IPC::Channel::MODE_CLIENT, this, context_->network_task_runner()); |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1654 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1655 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
| 1655 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); | 1656 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); |
| 1656 | 1657 |
| 1657 // Run the main (also UI) message loop until the host no longer needs it. | 1658 // Run the main (also UI) message loop until the host no longer needs it. |
| 1658 base::RunLoop().Run(); | 1659 base::RunLoop().Run(); |
| 1659 | 1660 |
| 1660 return exit_code; | 1661 return exit_code; |
| 1661 } | 1662 } |
| 1662 | 1663 |
| 1663 } // namespace remoting | 1664 } // namespace remoting |
| OLD | NEW |