Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1465)

Unified Diff: chrome/common/service_process_util.h

Issue 6349029: Get service processes working on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up small typo in comment Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/service_process_util.h
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h
index 6f2685e17018a625ad9c009f7f4b2d738c0410fd..c3ad259668da17e1097cbaf2f2b90c39b84d69ba 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;
« no previous file with comments | « chrome/browser/service/service_process_control_browsertest.cc ('k') | chrome/common/service_process_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698