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

Unified Diff: content/utility/utility_main.cc

Issue 2629873002: Do not create base::HighResolutionTimerManager in service utility process (Closed)
Patch Set: Fix 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..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);
« 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