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

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

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.h
diff --git a/google_apis/gcm/engine/fake_connection_handler.h b/google_apis/gcm/engine/fake_connection_handler.h
index 4e43d12dec11df94d727ed36af15fedf88561e6e..f1094780d08ddb1cf60872bba36559cd1a208398 100644
--- a/google_apis/gcm/engine/fake_connection_handler.h
+++ b/google_apis/gcm/engine/fake_connection_handler.h
@@ -51,6 +51,13 @@ class FakeConnectionHandler : public ConnectionHandler {
fail_send_ = fail_send;
}
+ // Whether a socket-level error was encountered or not.
+ void set_had_error(bool had_error) {
+ had_error_ = had_error;
+ }
+
+ bool initialized() const { return initialized_; }
+
private:
ConnectionHandler::ProtoReceivedCallback read_callback_;
ConnectionHandler::ProtoSentCallback write_callback_;
@@ -66,6 +73,9 @@ class FakeConnectionHandler : public ConnectionHandler {
// Whether a successful login has completed.
bool initialized_;
+ // Whether an error was encountered after a successful login.
+ bool had_error_;
+
DISALLOW_COPY_AND_ASSIGN(FakeConnectionHandler);
};

Powered by Google App Engine
This is Rietveld 408576698