| 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/mcs_client.h" | 5 #include "google_apis/gcm/engine/mcs_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 to_send_.push_back(make_linked_ptr(packet_info.release())); | 331 to_send_.push_back(make_linked_ptr(packet_info.release())); |
| 332 | 332 |
| 333 // Notify that the messages has been succsfully queued for sending. | 333 // Notify that the messages has been succsfully queued for sending. |
| 334 // TODO(jianli): We should report QUEUED after writing to GCM store succeeds. | 334 // TODO(jianli): We should report QUEUED after writing to GCM store succeeds. |
| 335 NotifyMessageSendStatus(message.GetProtobuf(), QUEUED); | 335 NotifyMessageSendStatus(message.GetProtobuf(), QUEUED); |
| 336 | 336 |
| 337 MaybeSendMessage(); | 337 MaybeSendMessage(); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void MCSClient::Destroy() { | |
| 341 gcm_store_->Destroy(base::Bind(&MCSClient::OnGCMUpdateFinished, | |
| 342 weak_ptr_factory_.GetWeakPtr())); | |
| 343 } | |
| 344 | |
| 345 void MCSClient::ResetStateAndBuildLoginRequest( | 340 void MCSClient::ResetStateAndBuildLoginRequest( |
| 346 mcs_proto::LoginRequest* request) { | 341 mcs_proto::LoginRequest* request) { |
| 347 DCHECK(android_id_); | 342 DCHECK(android_id_); |
| 348 DCHECK(security_token_); | 343 DCHECK(security_token_); |
| 349 stream_id_in_ = 0; | 344 stream_id_in_ = 0; |
| 350 stream_id_out_ = 1; | 345 stream_id_out_ = 1; |
| 351 last_device_to_server_stream_id_received_ = 0; | 346 last_device_to_server_stream_id_received_ = 0; |
| 352 last_server_to_device_stream_id_received_ = 0; | 347 last_server_to_device_stream_id_received_ = 0; |
| 353 | 348 |
| 354 heartbeat_manager_.Stop(); | 349 heartbeat_manager_.Stop(); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get()); | 866 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get()); |
| 872 CollapseKey collapse_key(*data_message); | 867 CollapseKey collapse_key(*data_message); |
| 873 if (collapse_key.IsValid()) | 868 if (collapse_key.IsValid()) |
| 874 collapse_key_map_.erase(collapse_key); | 869 collapse_key_map_.erase(collapse_key); |
| 875 } | 870 } |
| 876 | 871 |
| 877 return packet; | 872 return packet; |
| 878 } | 873 } |
| 879 | 874 |
| 880 } // namespace gcm | 875 } // namespace gcm |
| OLD | NEW |