summaryrefslogtreecommitdiffstats
path: root/chrome/common/service_process_util.h
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 03:17:58 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 03:17:58 +0000
commit7b23c9b94767948f1759e59f779ffe6a09b55c34 (patch)
treeb484b34b2db6e9f35ec90aa79aadefc3c2d9f5c7 /chrome/common/service_process_util.h
parentc3c1250bec563360a1b4fd409a54c14ec14a4413 (diff)
downloadchromium_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/common/service_process_util.h')
-rw-r--r--chrome/common/service_process_util.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h
index 5f54f75..c84069a 100644
--- a/chrome/common/service_process_util.h
+++ b/chrome/common/service_process_util.h
@@ -7,16 +7,14 @@
#include <string>
-class Profile;
+#include "base/task.h"
// Return the IPC channel to connect to the service process.
//
-// TODO(hclam): Need more information to come up with the channel name.
std::string GetServiceProcessChannelName();
-// The following methods are used as a mechanism to signal a service process
-// is running properly and all initialized.
-//
+// The following methods are used within the service process.
+// --------------------------------------------------------------------------
// Tries to become the sole service process for the current user data dir.
// Returns false is another service process is already running.
@@ -24,13 +22,33 @@ bool TakeServiceProcessSingletonLock();
// Signal that the service process is running.
// This method is called when the service process is running and initialized.
-void SignalServiceProcessRunning();
+// |shutdown_task| is invoked when we get a shutdown request from another
+// process (in the same thread that called SignalServiceProcessRunning).
+void SignalServiceProcessRunning(Task* shutdown_task);
// Signal that the service process is stopped.
void SignalServiceProcessStopped();
+// Key used to register the service process to auto-run.
+std::string GetServiceProcessAutoRunKey();
+
+// This is exposed for testing only. Forces a service process matching the
+// specified version to shut down.
+bool ForceServiceProcessShutdown(const std::string& version);
+
+// --------------------------------------------------------------------------
+
+
+// The following methods are used in a process that acts as a client to the
+// service process (typically the browser process).
+
+// --------------------------------------------------------------------------
+
// This method checks that if the service process is running (ready to receive
// IPC commands).
+
bool CheckServiceProcessRunning();
+// --------------------------------------------------------------------------
#endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_
+