OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "google_apis/gcm/engine/connection_handler_impl.h" | 5 #include "google_apis/gcm/engine/connection_handler_impl.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "google/protobuf/io/coded_stream.h" | 8 #include "google/protobuf/io/coded_stream.h" |
9 #include "google_apis/gcm/base/mcs_util.h" | 9 #include "google_apis/gcm/base/mcs_util.h" |
10 #include "google_apis/gcm/base/socket_stream.h" | 10 #include "google_apis/gcm/base/socket_stream.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 CloseConnection(); | 395 CloseConnection(); |
396 connection_callback_.Run(net::ERR_TIMED_OUT); | 396 connection_callback_.Run(net::ERR_TIMED_OUT); |
397 } | 397 } |
398 | 398 |
399 void ConnectionHandlerImpl::CloseConnection() { | 399 void ConnectionHandlerImpl::CloseConnection() { |
400 DVLOG(1) << "Closing connection."; | 400 DVLOG(1) << "Closing connection."; |
401 read_timeout_timer_.Stop(); | 401 read_timeout_timer_.Stop(); |
402 if (socket_) | 402 if (socket_) |
403 socket_->Disconnect(); | 403 socket_->Disconnect(); |
404 socket_ = NULL; | 404 socket_ = NULL; |
| 405 handshake_complete_ = false; |
| 406 message_tag_ = 0; |
| 407 message_size_ = 0; |
405 input_stream_.reset(); | 408 input_stream_.reset(); |
406 output_stream_.reset(); | 409 output_stream_.reset(); |
407 weak_ptr_factory_.InvalidateWeakPtrs(); | 410 weak_ptr_factory_.InvalidateWeakPtrs(); |
408 } | 411 } |
409 | 412 |
410 } // namespace gcm | 413 } // namespace gcm |
OLD | NEW |