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

Unified Diff: chrome/service/service_process.h

Issue 3257011: Registered the service process to AutoRun (for Windows) if any service (Cloud... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixed Linux compile Created 10 years, 4 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
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_process.h
===================================================================
--- chrome/service/service_process.h (revision 58099)
+++ chrome/service/service_process.h (working copy)
@@ -11,9 +11,9 @@
#include "base/scoped_ptr.h"
#include "base/thread.h"
#include "base/waitable_event.h"
+#include "chrome/service/cloud_print/cloud_print_proxy.h"
#include "chrome/service/remoting/remoting_directory_service.h"
-class CloudPrintProxy;
class JsonPrefStore;
class ServiceIPCServer;
@@ -30,7 +30,8 @@
// The ServiceProcess does not inherit from ChildProcess because this
// process can live independently of the browser process.
-class ServiceProcess : public RemotingDirectoryService::Client {
+class ServiceProcess : public RemotingDirectoryService::Client,
+ public CloudPrintProxy::Client {
public:
ServiceProcess();
~ServiceProcess();
@@ -73,6 +74,10 @@
CloudPrintProxy* GetCloudPrintProxy();
+ // CloudPrintProxy::Client implementation.
+ virtual void OnCloudPrintProxyEnabled();
+ virtual void OnCloudPrintProxyDisabled();
+
#if defined(ENABLE_REMOTING)
// Return the reference to the chromoting host only if it has started.
remoting::ChromotingHost* GetChromotingHost() { return chromoting_host_; }
@@ -97,6 +102,16 @@
#endif
private:
+ // Called exactly ONCE per process instance for each service that gets
+ // enabled in this process.
+ void OnServiceEnabled();
+ // Called exactly ONCE per process instance for each service that gets
+ // disabled in this process (note that shutdown != disabled).
+ void OnServiceDisabled();
+
+ bool AddServiceProcessToAutoStart();
+ bool RemoveServiceProcessFromAutoStart();
+
#if defined(ENABLE_REMOTING)
FRIEND_TEST_ALL_PREFIXES(ServiceProcessTest, RunChromoting);
FRIEND_TEST_ALL_PREFIXES(ServiceProcessTest, RunChromotingUntilShutdown);
@@ -143,6 +158,9 @@
// Pointer to the main message loop that host this object.
MessageLoop* main_message_loop_;
+ // Count of currently enabled services in this process.
+ int enabled_services_;
+
DISALLOW_COPY_AND_ASSIGN(ServiceProcess);
};
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698