From e96bf0c56566457022d20682ee278cd135d7c681 Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Mon, 23 Aug 2010 23:20:57 +0000 Subject: Resubmit r56600 - 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. BUG=50244, 50242, 50243, 50249 Review URL: http://codereview.chromium.org/3153029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57120 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 bf299bd..7fb3dcc 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" @@ -1363,6 +1366,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