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

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

Issue 2481873002: Added ClientEvent proto and structure for storing events in the factory. (Closed)
Patch Set: Added ConnectionEventTracker to manage all the events. Created 4 years 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_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);

Powered by Google App Engine
This is Rietveld 408576698