Index: components/gcm_driver/gcm_driver_desktop.h |
diff --git a/components/gcm_driver/gcm_driver_desktop.h b/components/gcm_driver/gcm_driver_desktop.h |
index 3c84d134e59c983430d978e030f24bea69431398..8987a29c71119cae90bad6ac49a3efd1871c400a 100644 |
--- a/components/gcm_driver/gcm_driver_desktop.h |
+++ b/components/gcm_driver/gcm_driver_desktop.h |
@@ -66,6 +66,7 @@ class GCMDriverDesktop : public GCMDriver, public IdentityProvider::Observer { |
virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; |
virtual bool IsStarted() const OVERRIDE; |
virtual bool IsGCMClientReady() const OVERRIDE; |
+ virtual bool IsConnected() const OVERRIDE; |
virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
bool clear_logs) OVERRIDE; |
virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, |
@@ -110,6 +111,8 @@ class GCMDriverDesktop : public GCMDriver, public IdentityProvider::Observer { |
void MessageSendError(const std::string& app_id, |
const GCMClient::SendErrorDetails& send_error_details); |
void GCMClientReady(); |
+ void OnConnected(const net::IPEndPoint& ip_endpoint); |
+ void OnDisconnected(); |
void GetGCMStatisticsFinished(const GCMClient::GCMStatistics& stats); |
@@ -119,6 +122,11 @@ class GCMDriverDesktop : public GCMDriver, public IdentityProvider::Observer { |
// Flag to indicate if GCMClient is ready. |
bool gcm_client_ready_; |
+ // Flag to indicate the last known state of the GCM client. Because this |
+ // flag lives on the UI thread, while the GCM client lives on the IO thread, |
+ // it may be out of date while connection changes are happening. |
+ bool connected_; |
+ |
// The account ID that this service is responsible for. Empty when the service |
// is not running. |
std::string account_id_; |