| Index: remoting/host/setup/me2me_native_messaging_host_main.cc
|
| diff --git a/remoting/host/setup/me2me_native_messaging_host_main.cc b/remoting/host/setup/me2me_native_messaging_host_main.cc
|
| index b7a8140e128a670fadc5f039a2f349f7c4956c11..d91e34820f507cf6dc5f55fafa8baec3b5cc7f0d 100644
|
| --- a/remoting/host/setup/me2me_native_messaging_host_main.cc
|
| +++ b/remoting/host/setup/me2me_native_messaging_host_main.cc
|
| @@ -16,6 +16,7 @@
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/run_loop.h"
|
| #include "base/strings/string_number_conversions.h"
|
| +#include "base/task_scheduler/task_scheduler.h"
|
| #include "base/threading/thread.h"
|
| #include "build/build_config.h"
|
| #include "net/url_request/url_fetcher.h"
|
| @@ -51,7 +52,13 @@ using remoting::protocol::PairingRegistry;
|
|
|
| namespace remoting {
|
|
|
| -int StartMe2MeNativeMessagingHost() {
|
| +int Me2MeNativeMessagingHostMain(int argc, char** argv) {
|
| + // This object instance is required by Chrome code (such as MessageLoop).
|
| + base::AtExitManager exit_manager;
|
| +
|
| + base::CommandLine::Init(argc, argv);
|
| + remoting::InitHostLogging();
|
| +
|
| #if defined(OS_MACOSX)
|
| // Needed so we don't leak objects when threads are created.
|
| base::mac::ScopedNSAutoreleasePool pool;
|
| @@ -79,6 +86,10 @@ int StartMe2MeNativeMessagingHost() {
|
| // }
|
| #endif // defined(REMOTING_ENABLE_BREAKPAD)
|
|
|
| + // TODO(sergeyu): Consider adding separate pools for different task classes.
|
| + const int kMaxBackgroundThreads = 5;
|
| + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads);
|
| +
|
| // Mac OS X requires that the main thread be a UI message loop in order to
|
| // receive distributed notifications from the System Preferences pane. An
|
| // IO thread is needed for the pairing registry and URL context getter.
|
| @@ -261,14 +272,4 @@ int StartMe2MeNativeMessagingHost() {
|
| return kSuccessExitCode;
|
| }
|
|
|
| -int Me2MeNativeMessagingHostMain(int argc, char** argv) {
|
| - // This object instance is required by Chrome code (such as MessageLoop).
|
| - base::AtExitManager exit_manager;
|
| -
|
| - base::CommandLine::Init(argc, argv);
|
| - remoting::InitHostLogging();
|
| -
|
| - return StartMe2MeNativeMessagingHost();
|
| -}
|
| -
|
| } // namespace remoting
|
|
|