Index: google_apis/gcm/engine/connection_factory.h |
diff --git a/google_apis/gcm/engine/connection_factory.h b/google_apis/gcm/engine/connection_factory.h |
index 962a79a73e200a954881f1692ea96a1cd2a53827..298bf5e423787ecf6f3851b9d16d8196c1c29235 100644 |
--- a/google_apis/gcm/engine/connection_factory.h |
+++ b/google_apis/gcm/engine/connection_factory.h |
@@ -23,6 +23,18 @@ class GCM_EXPORT ConnectionFactory { |
typedef base::Callback<void(mcs_proto::LoginRequest* login_request)> |
BuildLoginRequestCallback; |
+ // Reasons for triggering a connection reset. Note that these enums are |
+ // consumed by a histogram, so ordering should not be modified. |
+ enum ConnectionResetReason { |
+ LOGIN_FAILURE, // Login response included an error. |
+ CLOSE_COMMAND, // Received a close command. |
+ HEARTBEAT_FAILURE, // Heartbeat was not acknowledged in time. |
+ SOCKET_FAILURE, // net::Socket error. |
+ // Count of total number of connection reset reasons. All new reset reasons |
+ // should be added above this line. |
+ CONNECTION_RESET_COUNT, |
+ }; |
+ |
ConnectionFactory(); |
virtual ~ConnectionFactory(); |
@@ -62,7 +74,7 @@ class GCM_EXPORT ConnectionFactory { |
// event forced a reset (e.g. server sends a close connection response). |
// If the last connection was made within kConnectionResetWindowSecs, the old |
// backoff is restored, else a new backoff kicks off. |
- virtual void SignalConnectionReset() = 0; |
+ virtual void SignalConnectionReset(ConnectionResetReason reason) = 0; |
}; |
} // namespace gcm |