Index: content/utility/utility_main.cc |
diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc |
index e8acf88ea2b5f98385506762b5ee2662e6a205c0..837e6eeafa69761069acc7ec7ea0be692fafa30e 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,18 @@ 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. |
+ std::unique_ptr<base::HighResolutionTimerManager> hi_res_timer_manager; |
danakj
2017/01/20 16:37:33
you could use Optional if u dont want to add mallo
leonhsl(Using Gerrit)
2017/01/22 06:05:07
Done and thanks!
|
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
danakj
2017/01/20 16:37:33
It makes sense that if (!base::PowerMonitor::Get()
leonhsl(Using Gerrit)
2017/01/22 06:05:07
Done.
|
+ switches::kServiceRequestChannelToken)) { |
+ hi_res_timer_manager.reset(new base::HighResolutionTimerManager()); |
+ } |
#if defined(OS_WIN) |
bool no_sandbox = parameters.command_line.HasSwitch(switches::kNoSandbox); |