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

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: Rebase 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
« no previous file with comments | « google_apis/gcm/engine/fake_connection_handler.cc ('k') | google_apis/gcm/engine/mcs_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0a0bfc92731d919fb3190cb2a7c04262673b426b..0044dcb302af0e45015e704b1fa9e69196a8b69a 100644
--- a/google_apis/gcm/engine/mcs_client.cc
+++ b/google_apis/gcm/engine/mcs_client.cc
@@ -532,6 +532,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;
}
@@ -582,7 +585,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);
@@ -733,7 +737,8 @@ MCSClient::PersistentId MCSClient::GetNextPersistentId() {
}
void MCSClient::OnConnectionResetByHeartbeat() {
- connection_factory_->SignalConnectionReset();
+ connection_factory_->SignalConnectionReset(
+ ConnectionFactory::HEARTBEAT_FAILURE);
}
void MCSClient::NotifyMessageSendStatus(
« no previous file with comments | « google_apis/gcm/engine/fake_connection_handler.cc ('k') | google_apis/gcm/engine/mcs_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698