From e57d57b67290c8dfd701ac5021264a9ae1588b81 Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Wed, 18 Aug 2010 21:04:49 +0000 Subject: Start/stop service process when browser starts and stop Save the information that the setup of remoting has completed. After setup has been completed we start and stop service process when --enable-remoting presents when browser starts. Also save the information in the service process that host is registered and ready to be used. Again start chromoting host automatically once the host registration is done. Review URL: http://codereview.chromium.org/3185015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56600 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_main.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'chrome/browser/browser_main.cc') diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index b5fa926..108f6f1 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -59,6 +59,8 @@ #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/search_engines/template_url_prepopulate_data.h" +#include "chrome/browser/service/service_process_control.h" +#include "chrome/browser/service/service_process_control_manager.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/translate/translate_manager.h" #include "chrome/common/child_process.h" @@ -73,6 +75,7 @@ #include "chrome/common/net/net_resource_provider.h" #include "chrome/common/pref_names.h" #include "chrome/common/result_codes.h" +#include "chrome/common/service_process_type.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/master_preferences.h" #include "grit/app_locale_settings.h" @@ -1366,6 +1369,19 @@ int BrowserMain(const MainFunctionParams& parameters) { ChildProcess::WaitForDebugger(L"Browser"); } + // If remoting or cloud print proxy is enabled and setup has been completed + // we start the service process here. + // The prerequisite for running the service process is that we have IO, UI + // and PROCESS_LAUNCHER threads up and running. + // TODO(hclam): Need to check for cloud print proxy too. + if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) { + if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) { + ServiceProcessControl* control = ServiceProcessControlManager::instance() + ->GetProcessControl(profile, kServiceProcessRemoting); + control->Launch(NULL); + } + } + int result_code = ResultCodes::NORMAL_EXIT; if (parameters.ui_task) { // We are in test mode. Run one task and enter the main message loop. -- cgit v1.1