| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 // Required for any calls into GTK functions, such as the Disconnect and | 1634 // Required for any calls into GTK functions, such as the Disconnect and |
| 1635 // Continue windows, though these should not be used for the Me2Me case | 1635 // Continue windows, though these should not be used for the Me2Me case |
| 1636 // (crbug.com/104377). | 1636 // (crbug.com/104377). |
| 1637 gtk_init(nullptr, nullptr); | 1637 gtk_init(nullptr, nullptr); |
| 1638 | 1638 |
| 1639 // Need to prime the host OS version value for linux to prevent IO on the | 1639 // Need to prime the host OS version value for linux to prevent IO on the |
| 1640 // network thread. base::GetLinuxDistro() caches the result. | 1640 // network thread. base::GetLinuxDistro() caches the result. |
| 1641 base::GetLinuxDistro(); | 1641 base::GetLinuxDistro(); |
| 1642 #endif | 1642 #endif |
| 1643 | 1643 |
| 1644 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("Me2Me"); | 1644 base::TaskScheduler::CreateAndStartWithDefaultParams("Me2Me"); |
| 1645 | 1645 |
| 1646 // Create the main message loop and start helper threads. | 1646 // Create the main message loop and start helper threads. |
| 1647 base::MessageLoopForUI message_loop; | 1647 base::MessageLoopForUI message_loop; |
| 1648 std::unique_ptr<ChromotingHostContext> context = | 1648 std::unique_ptr<ChromotingHostContext> context = |
| 1649 ChromotingHostContext::Create( | 1649 ChromotingHostContext::Create( |
| 1650 new AutoThreadTaskRunner(message_loop.task_runner(), | 1650 new AutoThreadTaskRunner(message_loop.task_runner(), |
| 1651 base::MessageLoop::QuitWhenIdleClosure())); | 1651 base::MessageLoop::QuitWhenIdleClosure())); |
| 1652 if (!context) | 1652 if (!context) |
| 1653 return kInitializationFailed; | 1653 return kInitializationFailed; |
| 1654 | 1654 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1667 // Run the main (also UI) message loop until the host no longer needs it. | 1667 // Run the main (also UI) message loop until the host no longer needs it. |
| 1668 base::RunLoop().Run(); | 1668 base::RunLoop().Run(); |
| 1669 | 1669 |
| 1670 // Block until tasks blocking shutdown have completed their execution. | 1670 // Block until tasks blocking shutdown have completed their execution. |
| 1671 base::TaskScheduler::GetInstance()->Shutdown(); | 1671 base::TaskScheduler::GetInstance()->Shutdown(); |
| 1672 | 1672 |
| 1673 return exit_code; | 1673 return exit_code; |
| 1674 } | 1674 } |
| 1675 | 1675 |
| 1676 } // namespace remoting | 1676 } // namespace remoting |
| OLD | NEW |