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

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

Issue 980433003: [GCM] Fix crash during connection races (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/fake_connection_handler.cc
diff --git a/google_apis/gcm/engine/fake_connection_handler.cc b/google_apis/gcm/engine/fake_connection_handler.cc
index dbffbcea0608a9e2454e7212468bba8075cd8578..243c28068492a345ccab779dec14d2161891d128 100644
--- a/google_apis/gcm/engine/fake_connection_handler.cc
+++ b/google_apis/gcm/engine/fake_connection_handler.cc
@@ -32,7 +32,8 @@ FakeConnectionHandler::FakeConnectionHandler(
write_callback_(write_callback),
fail_login_(false),
fail_send_(false),
- initialized_(false) {
+ initialized_(false),
+ had_error_(false) {
}
FakeConnectionHandler::~FakeConnectionHandler() {
@@ -51,10 +52,11 @@ void FakeConnectionHandler::Init(const mcs_proto::LoginRequest& login_request,
void FakeConnectionHandler::Reset() {
initialized_ = false;
+ had_error_ = false;
}
bool FakeConnectionHandler::CanSendMessage() const {
- return initialized_;
+ return initialized_ && !had_error_;
}
void FakeConnectionHandler::SendMessage(

Powered by Google App Engine
This is Rietveld 408576698