| 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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 IPC_MESSAGE_FORWARD( | 765 IPC_MESSAGE_FORWARD( |
| 766 ChromotingDaemonNetworkMsg_DesktopAttached, | 766 ChromotingDaemonNetworkMsg_DesktopAttached, |
| 767 desktop_session_connector_, | 767 desktop_session_connector_, |
| 768 DesktopSessionConnector::OnDesktopSessionAgentAttached) | 768 DesktopSessionConnector::OnDesktopSessionAgentAttached) |
| 769 IPC_MESSAGE_FORWARD(ChromotingDaemonNetworkMsg_TerminalDisconnected, | 769 IPC_MESSAGE_FORWARD(ChromotingDaemonNetworkMsg_TerminalDisconnected, |
| 770 desktop_session_connector_, | 770 desktop_session_connector_, |
| 771 DesktopSessionConnector::OnTerminalDisconnected) | 771 DesktopSessionConnector::OnTerminalDisconnected) |
| 772 IPC_MESSAGE_UNHANDLED(handled = false) | 772 IPC_MESSAGE_UNHANDLED(handled = false) |
| 773 IPC_END_MESSAGE_MAP() | 773 IPC_END_MESSAGE_MAP() |
| 774 | 774 |
| 775 CHECK(handled) << "Received unexpected IPC type: " << message.type(); | 775 // Received unexpected IPC type. |
| 776 CHECK(handled); |
| 776 return handled; | 777 return handled; |
| 777 | 778 |
| 778 #else // !defined(REMOTING_MULTI_PROCESS) | 779 #else // !defined(REMOTING_MULTI_PROCESS) |
| 779 return false; | 780 return false; |
| 780 #endif // !defined(REMOTING_MULTI_PROCESS) | 781 #endif // !defined(REMOTING_MULTI_PROCESS) |
| 781 } | 782 } |
| 782 | 783 |
| 783 void HostProcess::OnChannelError() { | 784 void HostProcess::OnChannelError() { |
| 784 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); | 785 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); |
| 785 | 786 |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 void HostProcess::OnCrash(const std::string& function_name, | 1607 void HostProcess::OnCrash(const std::string& function_name, |
| 1607 const std::string& file_name, | 1608 const std::string& file_name, |
| 1608 const int& line_number) { | 1609 const int& line_number) { |
| 1609 char message[1024]; | 1610 char message[1024]; |
| 1610 base::snprintf(message, sizeof(message), | 1611 base::snprintf(message, sizeof(message), |
| 1611 "Requested by %s at %s, line %d.", | 1612 "Requested by %s at %s, line %d.", |
| 1612 function_name.c_str(), file_name.c_str(), line_number); | 1613 function_name.c_str(), file_name.c_str(), line_number); |
| 1613 base::debug::Alias(message); | 1614 base::debug::Alias(message); |
| 1614 | 1615 |
| 1615 // The daemon requested us to crash the process. | 1616 // The daemon requested us to crash the process. |
| 1616 CHECK(false) << message; | 1617 LOG(FATAL) << message; |
| 1617 } | 1618 } |
| 1618 | 1619 |
| 1619 int HostProcessMain() { | 1620 int HostProcessMain() { |
| 1620 HOST_LOG << "Starting host process: version " << STRINGIZE(VERSION); | 1621 HOST_LOG << "Starting host process: version " << STRINGIZE(VERSION); |
| 1621 | 1622 |
| 1622 #if defined(OS_LINUX) | 1623 #if defined(OS_LINUX) |
| 1623 // Required in order for us to run multiple X11 threads. | 1624 // Required in order for us to run multiple X11 threads. |
| 1624 XInitThreads(); | 1625 XInitThreads(); |
| 1625 | 1626 |
| 1626 // Required for any calls into GTK functions, such as the Disconnect and | 1627 // Required for any calls into GTK functions, such as the Disconnect and |
| (...skipping 27 matching lines...) Expand all 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 |