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

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: Rebase and address code review comments. 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..e800513738218fd6db62b040a3f7bf4dbd61c428 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"
@@ -78,12 +79,14 @@ class GCM_EXPORT ConnectionFactoryImpl :
// connection is active, returns an empty IPEndpoint.
net::IPEndPoint GetPeerIP();
+ ConnectionEventTracker* GetEventTrackerForTesting() {
Peter Beverloo 2016/12/05 16:29:35 nit: prefer making this private w/ a friends decla
harkness 2016/12/06 12:53:35 Done.
+ return &event_tracker_;
+ }
+
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.
@@ -117,6 +120,11 @@ class GCM_EXPORT ConnectionFactoryImpl :
// necessary.
void ConnectWithBackoff();
+ // Implementation of Connect(..). If not in backoff, uses |login_request_|
Peter Beverloo 2016/12/05 16:29:35 nit: |login_request_| does not exist. Mind updatin
harkness 2016/12/06 12:53:35 Done.
+ // 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);
@@ -130,6 +138,10 @@ class GCM_EXPORT ConnectionFactoryImpl :
// Session's cache, if available.
void RebuildNetworkSessionAuthCache();
+ // The tracker will maintain a list of all connection attempts with GCM,
+ // whether they suceeded, and their duration.
Peter Beverloo 2016/12/05 16:29:35 nit: s/suceeded/succeeded/
harkness 2016/12/06 12:53:35 Done.
+ ConnectionEventTracker event_tracker_;
+
// The MCS endpoints to make connections to, sorted in order of priority.
const std::vector<GURL> mcs_endpoints_;
// Index to the endpoint for which a connection should be attempted next.

Powered by Google App Engine
This is Rietveld 408576698