Chromium Code Reviews| 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 04c5e4f9c4b3b9b0085269b4ac573fc613b6d3d5..584300631bf4e4d079889c31d212b69c3555cb2b 100644 |
| --- a/google_apis/gcm/engine/connection_factory_impl.h |
| +++ b/google_apis/gcm/engine/connection_factory_impl.h |
| @@ -12,6 +12,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/time/time.h" |
| +#include "google_apis/gcm/engine/connection_event_tracker.h" |
| #include "google_apis/gcm/engine/connection_handler.h" |
| #include "google_apis/gcm/protocol/mcs.pb.h" |
| #include "net/base/backoff_entry.h" |
| @@ -79,11 +80,9 @@ class GCM_EXPORT ConnectionFactoryImpl : |
| net::IPEndPoint GetPeerIP(); |
| protected: |
| - // Implementation of Connect(..). If not in backoff, uses |login_request_| |
| - // in attempting a connection/handshake. On connection/handshake failure, goes |
| - // into backoff. |
| + // Initiate the connection to the GCM server. |
| // Virtual for testing. |
| - virtual void ConnectImpl(); |
| + virtual void StartConnection(); |
| // Helper method for initalizing the connection hander. |
| // Virtual for testing. |
| @@ -112,11 +111,20 @@ class GCM_EXPORT ConnectionFactoryImpl : |
| // ConnectionHandler callback for connection issues. |
| void ConnectionHandlerCallback(int result); |
| + // The tracker will maintain a list of all connection attempts with GCM, |
| + // whether they suceeded, and their duration. |
| + ConnectionEventTracker event_tracker_; |
|
Nicolas Zea
2016/12/01 18:51:49
nit: protected members are kind of discouraged. I
Peter Beverloo
2016/12/02 15:19:13
+1 (our C++ style guide outright forbids this exce
harkness
2016/12/05 15:39:01
Moved it and added a ForTesting accessor.
|
| + |
| private: |
| // Helper method for checking backoff and triggering a connection as |
| // necessary. |
| void ConnectWithBackoff(); |
| + // Implementation of Connect(..). If not in backoff, uses |login_request_| |
| + // in attempting a connection/handshake. On connection/handshake failure, goes |
| + // into backoff. |
| + void ConnectImpl(); |
| + |
| // Proxy resolution and connection functions. |
| void OnProxyResolveDone(int status); |
| void OnProxyConnectDone(int status); |