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

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

Issue 160703002: [GCM] Track connection failures properly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update 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/fake_connection_factory.h
diff --git a/google_apis/gcm/engine/fake_connection_factory.h b/google_apis/gcm/engine/fake_connection_factory.h
index bd29310603101726f821f8d77e9e3253c2ef193d..393e591e926d58485bbc4ee2e81468ac7d594b8b 100644
--- a/google_apis/gcm/engine/fake_connection_factory.h
+++ b/google_apis/gcm/engine/fake_connection_factory.h
@@ -28,13 +28,26 @@ class FakeConnectionFactory : public ConnectionFactory {
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;
+
+ // Whether a connection reset has been triggered and is yet to run.
+ bool reconnect_pending() const { return reconnect_pending_; }
+
+ // Whether connection resets should be handled immediately or delayed until
+ // release.
+ void set_delay_reconnect(bool should_delay) {
+ delay_reconnect_ = should_delay;
+ }
private:
scoped_ptr<FakeConnectionHandler> connection_handler_;
BuildLoginRequestCallback request_builder_;
+ // Logic for handling connection resets.
+ bool reconnect_pending_;
+ bool delay_reconnect_;
+
DISALLOW_COPY_AND_ASSIGN(FakeConnectionFactory);
};

Powered by Google App Engine
This is Rietveld 408576698