Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef GOOGLE_APIS_GCM_ENGINE_HEARTBEAT_MANAGER_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_HEARTBEAT_MANAGER_H_ |
| 6 #define GOOGLE_APIS_GCM_ENGINE_HEARTBEAT_MANAGER_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_HEARTBEAT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 // Whether the last heartbeat ping sent has been acknowledged or not. | 59 // Whether the last heartbeat ping sent has been acknowledged or not. |
| 60 bool waiting_for_ack_; | 60 bool waiting_for_ack_; |
| 61 | 61 |
| 62 // The current heartbeat interval. | 62 // The current heartbeat interval. |
| 63 int heartbeat_interval_ms_; | 63 int heartbeat_interval_ms_; |
| 64 // The most recent server-provided heartbeat interval (0 if none has been | 64 // The most recent server-provided heartbeat interval (0 if none has been |
| 65 // provided). | 65 // provided). |
| 66 int server_interval_ms_; | 66 int server_interval_ms_; |
| 67 | 67 |
| 68 // Timer for triggering heartbeats. | 68 // Timer for triggering heartbeats. |
| 69 base::Timer heartbeat_timer_; | 69 base::Timer* heartbeat_timer_; |
|
Daniel Erat
2014/10/15 15:04:22
please document the ownership of this pointer
Chirantan Ekbote
2014/10/16 21:26:38
Done.
| |
| 70 | 70 |
| 71 // Callbacks for interacting with the the connection. | 71 // Callbacks for interacting with the the connection. |
| 72 base::Closure send_heartbeat_callback_; | 72 base::Closure send_heartbeat_callback_; |
| 73 base::Closure trigger_reconnect_callback_; | 73 base::Closure trigger_reconnect_callback_; |
| 74 | 74 |
| 75 base::WeakPtrFactory<HeartbeatManager> weak_ptr_factory_; | 75 base::WeakPtrFactory<HeartbeatManager> weak_ptr_factory_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(HeartbeatManager); | 77 DISALLOW_COPY_AND_ASSIGN(HeartbeatManager); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace gcm | 80 } // namespace gcm |
| 81 | 81 |
| 82 #endif // GOOGLE_APIS_GCM_ENGINE_HEARTBEAT_MANAGER_H_ | 82 #endif // GOOGLE_APIS_GCM_ENGINE_HEARTBEAT_MANAGER_H_ |
| OLD | NEW |