Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Unified Diff: remoting/host/it2me/it2me_native_messaging_host_main.cc

Issue 2669893002: Initialize TaskScheduler in remoting processes. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_native_messaging_host_main.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host_main.cc b/remoting/host/it2me/it2me_native_messaging_host_main.cc
index 44d319e4162a6c6a6a18eb47dbf17b0786895698..b6451dff9c5aedaae59f95469867d0048586c735 100644
--- a/remoting/host/it2me/it2me_native_messaging_host_main.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host_main.cc
@@ -11,6 +11,7 @@
#include "base/i18n/icu_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/task_scheduler/task_scheduler.h"
#include "build/build_config.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/base/breakpad.h"
@@ -45,7 +46,13 @@ namespace remoting {
// Creates a It2MeNativeMessagingHost instance, attaches it to stdin/stdout and
// runs the message loop until It2MeNativeMessagingHost signals shutdown.
-int StartIt2MeNativeMessagingHost() {
+int It2MeNativeMessagingHostMain(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;
@@ -72,6 +79,10 @@ int StartIt2MeNativeMessagingHost() {
// Required to find the ICU data file, used by some file_util routines.
base::i18n::InitializeICU();
+ // TODO(sergeyu): Consider adding separate pools for different task classes.
+ const int kMaxBackgroundThreads = 5;
+ base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads);
+
remoting::LoadResources("");
#if defined(OS_LINUX)
@@ -192,14 +203,4 @@ int StartIt2MeNativeMessagingHost() {
return kSuccessExitCode;
}
-int It2MeNativeMessagingHostMain(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 StartIt2MeNativeMessagingHost();
-}
-
} // namespace remoting
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698