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

Unified Diff: content/utility/utility_main.cc

Issue 2629873002: Do not create base::HighResolutionTimerManager in service utility process (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/utility/utility_main.cc
diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc
index e8acf88ea2b5f98385506762b5ee2662e6a205c0..a2f8a3812a9ebe0346cd1a594598b7cc574bf5d1 100644
--- a/content/utility/utility_main.cc
+++ b/content/utility/utility_main.cc
@@ -13,6 +13,7 @@
#include "content/common/sandbox_linux/sandbox_linux.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
+#include "content/public/common/mojo_channel_switches.h"
#include "content/public/common/sandbox_init.h"
#include "content/utility/utility_thread_impl.h"
@@ -40,7 +41,16 @@ int UtilityMain(const MainFunctionParams& parameters) {
ChildProcess utility_process;
utility_process.set_main_thread(new UtilityThreadImpl());
- base::HighResolutionTimerManager hi_res_timer_manager;
+ // TODO(leonhsl): Both utility process and service utility process would come
+ // here, but the later is launched without connection to service manager.
+ // However, service manager connection is necessary for instantiation of the
+ // process-wide base::PowerMonitor, which is further necessary to
+ // base::HighResolutionTimerManager. So in case of service utility process, we
+ // disable base::HighResolutionTimerManager for now, until we resolved
+ // http://crbug.com/646833.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kServiceRequestChannelToken))
Vitaly Buka (NO REVIEWS) 2017/01/18 19:07:50 Please add {}
Vitaly Buka (NO REVIEWS) 2017/01/19 04:25:35 Probably you can just base::HighResolutionTimerMan
leonhsl(Using Gerrit) 2017/01/19 07:06:44 I suppose the comment above means that we can just
+ base::HighResolutionTimerManager hi_res_timer_manager;
#if defined(OS_WIN)
bool no_sandbox = parameters.command_line.HasSwitch(switches::kNoSandbox);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698