| 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 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 // TODO(wez): The HostProcess holds a reference to itself until Shutdown(). | 1663 // TODO(wez): The HostProcess holds a reference to itself until Shutdown(). |
| 1664 // Remove this hack as part of the multi-process refactoring. | 1664 // Remove this hack as part of the multi-process refactoring. |
| 1665 int exit_code = kSuccessExitCode; | 1665 int exit_code = kSuccessExitCode; |
| 1666 ShutdownWatchdog shutdown_watchdog( | 1666 ShutdownWatchdog shutdown_watchdog( |
| 1667 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1667 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
| 1668 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); | 1668 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); |
| 1669 | 1669 |
| 1670 // Run the main (also UI) message loop until the host no longer needs it. | 1670 // Run the main (also UI) message loop until the host no longer needs it. |
| 1671 base::RunLoop().Run(); | 1671 base::RunLoop().Run(); |
| 1672 | 1672 |
| 1673 // Block until tasks blocking shutdown have completed their execution. |
| 1674 base::TaskScheduler::GetInstance()->Shutdown(); |
| 1675 |
| 1673 return exit_code; | 1676 return exit_code; |
| 1674 } | 1677 } |
| 1675 | 1678 |
| 1676 } // namespace remoting | 1679 } // namespace remoting |
| OLD | NEW |