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

Unified Diff: google_apis/gcm/engine/connection_factory_impl.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
« no previous file with comments | « google_apis/gcm/engine/connection_factory.h ('k') | google_apis/gcm/engine/connection_factory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/connection_factory_impl.h
diff --git a/google_apis/gcm/engine/connection_factory_impl.h b/google_apis/gcm/engine/connection_factory_impl.h
index 3d79a78689f18a56775bbc61251e1a49cf6d702c..3b4d6acfa430b19432a860258c0a7fcabb1601ba 100644
--- a/google_apis/gcm/engine/connection_factory_impl.h
+++ b/google_apis/gcm/engine/connection_factory_impl.h
@@ -44,7 +44,7 @@ class GCM_EXPORT ConnectionFactoryImpl :
virtual void Connect() OVERRIDE;
virtual bool IsEndpointReachable() const OVERRIDE;
virtual base::TimeTicks NextRetryAttempt() const OVERRIDE;
- virtual void SignalConnectionReset() OVERRIDE;
+ virtual void SignalConnectionReset(ConnectionResetReason reason) OVERRIDE;
// NetworkChangeNotifier observer implementations.
virtual void OnConnectionTypeChanged(
@@ -93,15 +93,24 @@ class GCM_EXPORT ConnectionFactoryImpl :
net::ClientSocketHandle socket_handle_;
// Connection attempt backoff policy.
fgorski 2014/02/12 21:56:27 nit: backoff entry. I should have noticed that ea
Nicolas Zea 2014/02/12 22:27:34 Done.
scoped_ptr<net::BackoffEntry> backoff_entry_;
- // Backoff policy from previous backoff attempt.
+ // Backoff entry from previous backoff attempt. Updated on each login
+ // completion.
scoped_ptr<net::BackoffEntry> previous_backoff_;
- base::TimeTicks backoff_reset_time_;
// Whether a connection attempt is currently in progress or we're in backoff
// waiting until the next connection attempt. |!connecting_| denotes
// steady state with an active connection.
bool connecting_;
+ // Whether login successfully completed after the connection was established.
+ // If a connection reset happens while attempting to log in, the current
+ // backoff entry is reused (after incrementing with a new failure).
+ bool logging_in_;
+
+ // The time of the last login completion. Used for calculating whether to
+ // restore a previous backoff entry and for measuring uptime.
+ base::TimeTicks last_login_time_;
jianli 2014/02/12 22:20:59 nit: include file for base::TimeTicks
Nicolas Zea 2014/02/12 22:27:34 Done.
+
// The current connection handler, if one exists.
scoped_ptr<ConnectionHandlerImpl> connection_handler_;
« no previous file with comments | « google_apis/gcm/engine/connection_factory.h ('k') | google_apis/gcm/engine/connection_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698