diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 04:14:42 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 04:14:42 +0000 |
commit | c3498a1c9ead237b365f316b761ea3d534b671f9 (patch) | |
tree | 7c287f6bd53347a2e91a447ce28320ae2a55fa09 /chrome/common/service_process_util.h | |
parent | 09f2b5517f8cb83a2a22e0249caf3dbd07dd8d08 (diff) | |
download | chromium_src-c3498a1c9ead237b365f316b761ea3d534b671f9.zip chromium_src-c3498a1c9ead237b365f316b761ea3d534b671f9.tar.gz chromium_src-c3498a1c9ead237b365f316b761ea3d534b671f9.tar.bz2 |
Get service processes working on Mac and Linux.
Service processes will now launch, and attach to ipc channels.
BUG=NONE
TEST=BUILD
Review URL: http://codereview.chromium.org/6349029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/service_process_util.h')
-rw-r--r-- | chrome/common/service_process_util.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h index 6f2685e..c3ad259 100644 --- a/chrome/common/service_process_util.h +++ b/chrome/common/service_process_util.h @@ -10,7 +10,9 @@ #include "base/process.h" #include "base/scoped_ptr.h" #include "base/shared_memory.h" -#include "base/task.h" + +class Task; +class MessageLoop; template <typename T> struct DefaultSingletonTraits; @@ -33,16 +35,17 @@ std::string GetServiceProcessScopedVersionedName(const std::string& append_str); // IPC commands. bool CheckServiceProcessReady(); -// Returns the process id of the currently running service process. Returns 0 -// if no service process is running. +// Returns the process id and version of the currently running service process. // Note: DO NOT use this check whether the service process is ready because -// a non-zero return value only means that the process is running and not that -// it is ready to receive IPC commands. This method is only exposed for testing. -base::ProcessId GetServiceProcessPid(); +// a true return value only means that some process shared data was available, +// and not that the process is ready to receive IPC commands, or even running. +// This method is only exposed for testing. +bool GetServiceProcessSharedData(std::string* version, base::ProcessId* pid); // -------------------------------------------------------------------------- // Forces a service process matching the specified version to shut down. -bool ForceServiceProcessShutdown(const std::string& version); +bool ForceServiceProcessShutdown(const std::string& version, + base::ProcessId process_id); // This is a class that is used by the service process to signal events and // share data with external clients. This class lives in this file because the @@ -61,7 +64,9 @@ class ServiceProcessState { // This method is called when the service process is running and initialized. // |shutdown_task| is invoked when we get a shutdown request from another // process (in the same thread that called SignalReady). It can be NULL. - void SignalReady(Task* shutdown_task); + // |message_loop| must be of type IO and is the loop that POSIX uses + // to monitor the service process. + bool SignalReady(MessageLoop *message_loop, Task* shutdown_task); // Signal that the service process is stopped. void SignalStopped(); @@ -93,8 +98,6 @@ class ServiceProcessState { // Tear down the platform specific state. void TearDownState(); - // Allows each platform to specify whether it supports killing older versions. - bool ShouldHandleOtherVersion(); // An opaque object that maintains state. The actual definition of this is // platform dependent. struct StateData; |