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

Unified Diff: google_apis/gcm/engine/connection_factory.h

Issue 160703002: [GCM] Track connection failures properly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 6 years, 10 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
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
« no previous file with comments | « no previous file | google_apis/gcm/engine/connection_factory_impl.h » ('j') | google_apis/gcm/engine/connection_factory_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698