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

Unified Diff: google_apis/gcm/engine/mcs_client.cc

Issue 160703002: [GCM] Track connection failures properly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review and add connection success rate 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/mcs_client.cc
diff --git a/google_apis/gcm/engine/mcs_client.cc b/google_apis/gcm/engine/mcs_client.cc
index 127f9bf6541566e9a9c020a6337abfe721ba4d2c..277b9b01a1900339ca42f18c5b4bc8f13ddbb486 100644
--- a/google_apis/gcm/engine/mcs_client.cc
+++ b/google_apis/gcm/engine/mcs_client.cc
@@ -536,6 +536,9 @@ void MCSClient::HandlePacketFromWire(
state_ = UNINITIALIZED;
DVLOG(1) << " Error code: " << login_response->error().code();
DVLOG(1) << " Error message: " << login_response->error().message();
+ LOG(ERROR) << "Failed to log in to GCM, resetting connection.";
+ connection_factory_->SignalConnectionReset(
+ ConnectionFactory::LOGIN_FAILURE);
mcs_error_callback_.Run();
return;
}
@@ -586,7 +589,8 @@ void MCSClient::HandlePacketFromWire(
case kCloseTag:
LOG(ERROR) << "Received close command, resetting connection.";
state_ = LOADED;
- connection_factory_->SignalConnectionReset();
+ connection_factory_->SignalConnectionReset(
+ ConnectionFactory::CLOSE_COMMAND);
return;
case kIqStanzaTag: {
DCHECK_GE(stream_id_in_, 1U);
@@ -737,7 +741,8 @@ MCSClient::PersistentId MCSClient::GetNextPersistentId() {
}
void MCSClient::OnConnectionResetByHeartbeat() {
- connection_factory_->SignalConnectionReset();
+ connection_factory_->SignalConnectionReset(
+ ConnectionFactory::HEARTBEAT_FAILURE);
}
void MCSClient::NotifyMessageSendStatus(

Powered by Google App Engine
This is Rietveld 408576698