Chromium Code Reviews| Index: google_apis/gcm/engine/mcs_client.h |
| diff --git a/google_apis/gcm/engine/mcs_client.h b/google_apis/gcm/engine/mcs_client.h |
| index c3009b8189f82e79933f479a380f4f22558a996d..537ec38ce4816470789ecd8806c89c3f93643ae5 100644 |
| --- a/google_apis/gcm/engine/mcs_client.h |
| +++ b/google_apis/gcm/engine/mcs_client.h |
| @@ -18,6 +18,7 @@ |
| #include "google_apis/gcm/engine/connection_handler.h" |
| #include "google_apis/gcm/engine/gcm_store.h" |
| #include "google_apis/gcm/engine/heartbeat_manager.h" |
| +#include "google_apis/gcm/gcm_stats_recorder.h" |
| namespace base { |
| class Clock; |
| @@ -37,6 +38,7 @@ namespace gcm { |
| class CollapseKey; |
| class ConnectionFactory; |
| +class GCMStatsRecorder; |
| struct ReliablePacketInfo; |
| // An MCS client. This client is in charge of all communications with an |
| @@ -54,6 +56,8 @@ class GCM_EXPORT MCSClient { |
| CONNECTED, // Connected and running. |
| }; |
| + // Any change made to this enum should have corresponding change in the |
| + // GetMessageSendStatusString(...) function in mcs_client.cc. |
| enum MessageSendStatus { |
| // Message was queued succcessfully. |
| QUEUED, |
| @@ -61,14 +65,14 @@ class GCM_EXPORT MCSClient { |
| SENT, |
| // Message not saved, because total queue size limit reached. |
| QUEUE_SIZE_LIMIT_REACHED, |
| - // Messgae not saved, because app queue size limit reached. |
| + // Message not saved, because app queue size limit reached. |
| APP_QUEUE_SIZE_LIMIT_REACHED, |
| // Message too large to send. |
| MESSAGE_TOO_LARGE, |
| // Message not send becuase of TTL = 0 and no working connection. |
| NO_CONNECTION_ON_ZERO_TTL, |
| // Message exceeded TTL. |
| - TTL_EXCEEDED |
| + TTL_EXCEEDED, |
| }; |
| // Callback for MCSClient's error conditions. |
| @@ -89,7 +93,8 @@ class GCM_EXPORT MCSClient { |
| MCSClient(const std::string& version_string, |
| base::Clock* clock, |
| ConnectionFactory* connection_factory, |
| - GCMStore* gcm_store); |
| + GCMStore* gcm_store, |
| + GCMStatsRecorder* recorder); |
| virtual ~MCSClient(); |
| // Initialize the client. Will load any previous id/token information as well |
| @@ -127,6 +132,12 @@ class GCM_EXPORT MCSClient { |
| // Returns the current state of the client. |
| State state() const { return state_; } |
| + // Returns the size of the send message queue. |
| + int GetSendQueueSize() const ; |
|
jianli
2014/03/18 23:53:23
nit: space betwee ';'.
juyik
2014/03/20 01:09:53
Done.
|
| + |
| + // Returns the size of the un-acked messaage queue. |
| + int GetUnackedQueueSize() const ; |
|
jianli
2014/03/18 23:53:23
ditto
juyik
2014/03/20 01:09:53
Done.
|
| + |
| // Returns text representation of the state enum. |
| std::string GetStateString() const; |
| @@ -265,6 +276,9 @@ class GCM_EXPORT MCSClient { |
| // Manager to handle triggering/detecting heartbeats. |
| HeartbeatManager heartbeat_manager_; |
| + // Recorder that records GCM activities for debugging purpose. Not owned. |
| + GCMStatsRecorder* recorder_; |
| + |
| base::WeakPtrFactory<MCSClient> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(MCSClient); |