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/bind.h" | 10 #include "base/bind.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 to_send_.push_back(make_linked_ptr(packet_info.release())); | 362 to_send_.push_back(make_linked_ptr(packet_info.release())); |
363 | 363 |
364 // Notify that the messages has been succsfully queued for sending. | 364 // Notify that the messages has been succsfully queued for sending. |
365 // TODO(jianli): We should report QUEUED after writing to GCM store succeeds. | 365 // TODO(jianli): We should report QUEUED after writing to GCM store succeeds. |
366 NotifyMessageSendStatus(message.GetProtobuf(), QUEUED); | 366 NotifyMessageSendStatus(message.GetProtobuf(), QUEUED); |
367 | 367 |
368 MaybeSendMessage(); | 368 MaybeSendMessage(); |
369 } | 369 } |
370 | 370 |
| 371 void MCSClient::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) { |
| 372 heartbeat_manager_.UpdateHeartbeatTimer(timer.Pass()); |
| 373 } |
| 374 |
371 void MCSClient::ResetStateAndBuildLoginRequest( | 375 void MCSClient::ResetStateAndBuildLoginRequest( |
372 mcs_proto::LoginRequest* request) { | 376 mcs_proto::LoginRequest* request) { |
373 DCHECK(android_id_); | 377 DCHECK(android_id_); |
374 DCHECK(security_token_); | 378 DCHECK(security_token_); |
375 stream_id_in_ = 0; | 379 stream_id_in_ = 0; |
376 stream_id_out_ = 1; | 380 stream_id_out_ = 1; |
377 last_device_to_server_stream_id_received_ = 0; | 381 last_device_to_server_stream_id_received_ = 0; |
378 last_server_to_device_stream_id_received_ = 0; | 382 last_server_to_device_stream_id_received_ = 0; |
379 | 383 |
380 heartbeat_manager_.Stop(); | 384 heartbeat_manager_.Stop(); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get()); | 905 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get()); |
902 CollapseKey collapse_key(*data_message); | 906 CollapseKey collapse_key(*data_message); |
903 if (collapse_key.IsValid()) | 907 if (collapse_key.IsValid()) |
904 collapse_key_map_.erase(collapse_key); | 908 collapse_key_map_.erase(collapse_key); |
905 } | 909 } |
906 | 910 |
907 return packet; | 911 return packet; |
908 } | 912 } |
909 | 913 |
910 } // namespace gcm | 914 } // namespace gcm |
OLD | NEW |