Index: chrome/common/service_process_util.h |
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h |
index 28304e16dbbc849617b76af49ef8b2d993ef4b53..b0b0bd090705f255beac7e9a21d7bbd4cea4619d 100644 |
--- a/chrome/common/service_process_util.h |
+++ b/chrome/common/service_process_util.h |
@@ -10,6 +10,7 @@ |
#include "base/process.h" |
#include "base/scoped_ptr.h" |
#include "base/shared_memory.h" |
+#include "base/singleton.h" |
#include "base/task.h" |
// Return the IPC channel to connect to the service process. |
@@ -48,11 +49,11 @@ bool ForceServiceProcessShutdown(const std::string& version); |
// and this class are shared. |
class ServiceProcessState { |
public: |
- ServiceProcessState(); |
- ~ServiceProcessState(); |
+ // Returns the singleton instance. |
+ static ServiceProcessState* GetInstance(); |
// Tries to become the sole service process for the current user data dir. |
- // Returns false is another service process is already running. |
+ // Returns false if another service process is already running. |
bool Initialize(); |
// Signal that the service process is ready. |
@@ -69,7 +70,10 @@ class ServiceProcessState { |
// Unregister the service process to run on startup. |
bool RemoveFromAutoRun(); |
+ |
private: |
+ ServiceProcessState(); |
+ ~ServiceProcessState(); |
// Create the shared memory data for the service process. |
bool CreateSharedData(); |
@@ -95,6 +99,8 @@ class ServiceProcessState { |
struct StateData; |
StateData* state_; |
scoped_ptr<base::SharedMemory> shared_mem_service_data_; |
+ |
+ friend struct DefaultSingletonTraits<ServiceProcessState>; |
}; |
#endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ |