diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 03:17:58 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 03:17:58 +0000 |
commit | 7b23c9b94767948f1759e59f779ffe6a09b55c34 (patch) | |
tree | b484b34b2db6e9f35ec90aa79aadefc3c2d9f5c7 /chrome/service | |
parent | c3c1250bec563360a1b4fd409a54c14ec14a4413 (diff) | |
download | chromium_src-7b23c9b94767948f1759e59f779ffe6a09b55c34.zip chromium_src-7b23c9b94767948f1759e59f779ffe6a09b55c34.tar.gz chromium_src-7b23c9b94767948f1759e59f779ffe6a09b55c34.tar.bz2 |
The IPC channel names and event names used by the service process now append the version string so that a browser with the same version only can talk to it.
In addition, the service process writes its version into shared memory (the name of this shared mem does not use a version) and also listens on a shutdown event. This can be used by a newer service process to shutdown an older version when it starts.
BUG=None
TEST=Unittests, with an existing service process running, let chrome autoupdate and then run the service process again. It should kill the old one.
Review URL: http://codereview.chromium.org/3603016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r-- | chrome/service/service_process.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc index db562c3..3af4d2f 100644 --- a/chrome/service/service_process.cc +++ b/chrome/service/service_process.cc @@ -113,7 +113,8 @@ bool ServiceProcess::Initialize(MessageLoop* message_loop, // After the IPC server has started we signal that the service process is // running. - SignalServiceProcessRunning(); + SignalServiceProcessRunning( + NewRunnableMethod(this, &ServiceProcess::Shutdown)); // See if we need to stay running. ScheduleShutdownCheck(); @@ -121,10 +122,7 @@ bool ServiceProcess::Initialize(MessageLoop* message_loop, } bool ServiceProcess::Teardown() { - if (service_prefs_.get()) { - service_prefs_->WritePrefs(); - service_prefs_.reset(); - } + service_prefs_.reset(); cloud_print_proxy_.reset(); #if defined(ENABLE_REMOTING) @@ -234,7 +232,7 @@ bool ServiceProcess::AddServiceProcessToAutoStart() { // We need a unique name for the command per user-date-dir. Just use the // channel name. return win_util::AddCommandToAutoRun( - HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessChannelName()), + HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey()), cmd_line.command_line_string()); } #endif // defined(OS_WIN) @@ -246,7 +244,7 @@ bool ServiceProcess::RemoveServiceProcessFromAutoStart() { // chrome/common and implementation for non-Windows platforms needs to be added. #if defined(OS_WIN) return win_util::RemoveCommandFromAutoRun( - HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessChannelName())); + HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey())); #endif // defined(OS_WIN) return false; } |