OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "remoting/host/setup/me2me_native_messaging_host_main.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host_main.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 #if defined(REMOTING_ENABLE_BREAKPAD) | 79 #if defined(REMOTING_ENABLE_BREAKPAD) |
80 // Initialize Breakpad as early as possible. On Mac the command-line needs to | 80 // Initialize Breakpad as early as possible. On Mac the command-line needs to |
81 // be initialized first, so that the preference for crash-reporting can be | 81 // be initialized first, so that the preference for crash-reporting can be |
82 // looked up in the config file. | 82 // looked up in the config file. |
83 // TODO(nicholss): Commenting out Breakpad. See crbug.com/637884 | 83 // TODO(nicholss): Commenting out Breakpad. See crbug.com/637884 |
84 // if (IsUsageStatsAllowed()) { | 84 // if (IsUsageStatsAllowed()) { |
85 // InitializeCrashReporting(); | 85 // InitializeCrashReporting(); |
86 // } | 86 // } |
87 #endif // defined(REMOTING_ENABLE_BREAKPAD) | 87 #endif // defined(REMOTING_ENABLE_BREAKPAD) |
88 | 88 |
89 // TODO(sergeyu): Consider adding separate pools for different task classes. | 89 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("Me2Me"); |
90 const int kMaxBackgroundThreads = 5; | |
91 base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); | |
92 | 90 |
93 // Mac OS X requires that the main thread be a UI message loop in order to | 91 // Mac OS X requires that the main thread be a UI message loop in order to |
94 // receive distributed notifications from the System Preferences pane. An | 92 // receive distributed notifications from the System Preferences pane. An |
95 // IO thread is needed for the pairing registry and URL context getter. | 93 // IO thread is needed for the pairing registry and URL context getter. |
96 base::Thread io_thread("io_thread"); | 94 base::Thread io_thread("io_thread"); |
97 io_thread.StartWithOptions( | 95 io_thread.StartWithOptions( |
98 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 96 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
99 | 97 |
100 base::Thread file_thread("file_thread"); | 98 base::Thread file_thread("file_thread"); |
101 file_thread.StartWithOptions( | 99 file_thread.StartWithOptions( |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // Run the loop until channel is alive. | 268 // Run the loop until channel is alive. |
271 run_loop.Run(); | 269 run_loop.Run(); |
272 | 270 |
273 // Block until tasks blocking shutdown have completed their execution. | 271 // Block until tasks blocking shutdown have completed their execution. |
274 base::TaskScheduler::GetInstance()->Shutdown(); | 272 base::TaskScheduler::GetInstance()->Shutdown(); |
275 | 273 |
276 return kSuccessExitCode; | 274 return kSuccessExitCode; |
277 } | 275 } |
278 | 276 |
279 } // namespace remoting | 277 } // namespace remoting |
OLD | NEW |