summaryrefslogtreecommitdiffstats
path: root/chrome/common/service_process_util.h
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 17:14:36 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 17:14:36 +0000
commit56f0f264ff866052ebcb24e75147cb600e6547a1 (patch)
tree8b16bded93f914cacbf3cb130fae3539ad4bb268 /chrome/common/service_process_util.h
parent04a8454da64b62bfad5091efd5cf1143443283f0 (diff)
downloadchromium_src-56f0f264ff866052ebcb24e75147cb600e6547a1.zip
chromium_src-56f0f264ff866052ebcb24e75147cb600e6547a1.tar.gz
chromium_src-56f0f264ff866052ebcb24e75147cb600e6547a1.tar.bz2
Get service process running standalone on the mac by hooking it into launchd.
BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/6482016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/service_process_util.h')
-rw-r--r--chrome/common/service_process_util.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h
index 175499d..2ad72d7 100644
--- a/chrome/common/service_process_util.h
+++ b/chrome/common/service_process_util.h
@@ -7,11 +7,14 @@
#include <string>
+#include "base/basictypes.h"
#include "base/process.h"
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "ipc/ipc_channel_handle.h"
class Task;
+class CommandLine;
namespace base {
class MessageLoopProxy;
@@ -20,9 +23,9 @@ namespace base {
template <typename T> struct DefaultSingletonTraits;
// Return the IPC channel to connect to the service process.
-//
-std::string GetServiceProcessChannelName();
+IPC::ChannelHandle GetServiceProcessChannel();
+#if !defined(OS_MACOSX)
// Return a name that is scoped to this instance of the service process. We
// use the user-data-dir as a scoping prefix.
std::string GetServiceProcessScopedName(const std::string& append_str);
@@ -30,6 +33,7 @@ std::string GetServiceProcessScopedName(const std::string& append_str);
// Return a name that is scoped to this instance of the service process. We
// use the user-data-dir and the version as a scoping prefix.
std::string GetServiceProcessScopedVersionedName(const std::string& append_str);
+#endif // OS_MACOSX
// The following methods are used in a process that acts as a client to the
// service process (typically the browser process).
@@ -43,7 +47,7 @@ bool CheckServiceProcessReady();
// 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);
+bool GetServiceProcessData(std::string* version, base::ProcessId* pid);
// --------------------------------------------------------------------------
// Forces a service process matching the specified version to shut down.
@@ -76,15 +80,19 @@ class ServiceProcessState {
void SignalStopped();
// Register the service process to run on startup.
- bool AddToAutoRun();
+ bool AddToAutoRun(CommandLine* command_line);
// Unregister the service process to run on startup.
bool RemoveFromAutoRun();
+ // Return the channel handle used for communicating with the service.
+ IPC::ChannelHandle GetServiceProcessChannel();
+
private:
ServiceProcessState();
~ServiceProcessState();
+#if !defined(OS_MACOSX)
// Create the shared memory data for the service process.
bool CreateSharedData();
@@ -95,9 +103,10 @@ class ServiceProcessState {
// Acquires a singleton lock for the service process. A return value of false
// means that a service process instance is already running.
bool TakeSingletonLock();
+#endif // !OS_MACOSX
- // Key used to register the service process to auto-run.
- std::string GetAutoRunKey();
+ // Initialize the platform specific state.
+ bool InitializeState();
// Tear down the platform specific state.
void TearDownState();