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

Unified Diff: chrome/browser/service/service_process_control.h

Issue 8438020: Cloud print connector policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac compile Created 9 years, 1 month 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/browser/service/service_process_control.h
diff --git a/chrome/browser/service/service_process_control.h b/chrome/browser/service/service_process_control.h
index 483d78cfa9139fd6b108fb0b560090dd763659af..1e4261dab93e78f64058f805f16ec3d9e89b7b37 100644
--- a/chrome/browser/service/service_process_control.h
+++ b/chrome/browser/service/service_process_control.h
@@ -48,8 +48,10 @@ class ServiceProcessControl : public IPC::Channel::Sender,
// Returns the singleton instance of this class.
static ServiceProcessControl* GetInstance();
+
// Return true if this object is connected to the service.
- bool is_connected() const { return channel_.get() != NULL; }
+ // Virtual for testing.
+ virtual bool is_connected() const;
// If no service process is currently running, creates a new service process
// and connects to it. If a service process is already running this method
@@ -61,11 +63,13 @@ class ServiceProcessControl : public IPC::Channel::Sender,
// this case, the task is invoked on success or failure.
// Note that if we are already connected to service process then
// |success_task| can be invoked in the context of the Launch call.
- void Launch(const base::Closure& success_task,
- const base::Closure& failure_task);
+ // Virtual for testing.
+ virtual void Launch(const base::Closure& success_task,
+ const base::Closure& failure_task);
// Disconnect the IPC channel from the service process.
- void Disconnect();
+ // Virtual for testing.
+ virtual void Disconnect();
// IPC::Channel::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -87,7 +91,8 @@ class ServiceProcessControl : public IPC::Channel::Sender,
// Send a shutdown message to the service process. IPC channel will be
// destroyed after calling this method.
// Return true if the message was sent.
- bool Shutdown();
+ // Virtual for testing.
+ virtual bool Shutdown();
// Send request for cloud print proxy info (enabled state, email, proxy id).
// The callback gets the information when received.
@@ -125,6 +130,7 @@ class ServiceProcessControl : public IPC::Channel::Sender,
uint32 retry_count_;
};
+ friend class MockServiceProcessControl;
ServiceProcessControl();
virtual ~ServiceProcessControl();

Powered by Google App Engine
This is Rietveld 408576698