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 #ifndef GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 typedef base::Callback<void(const MCSMessage& message)> | 77 typedef base::Callback<void(const MCSMessage& message)> |
78 OnMessageReceivedCallback; | 78 OnMessageReceivedCallback; |
79 // Callback when a message is sent (and receipt has been acknowledged by | 79 // Callback when a message is sent (and receipt has been acknowledged by |
80 // the MCS endpoint). | 80 // the MCS endpoint). |
81 typedef base::Callback< | 81 typedef base::Callback< |
82 void(int64 user_serial_number, | 82 void(int64 user_serial_number, |
83 const std::string& app_id, | 83 const std::string& app_id, |
84 const std::string& message_id, | 84 const std::string& message_id, |
85 MessageSendStatus status)> OnMessageSentCallback; | 85 MessageSendStatus status)> OnMessageSentCallback; |
86 | 86 |
| 87 static std::string GetStateString(State state); |
| 88 |
87 MCSClient(const std::string& version_string, | 89 MCSClient(const std::string& version_string, |
88 base::Clock* clock, | 90 base::Clock* clock, |
89 ConnectionFactory* connection_factory, | 91 ConnectionFactory* connection_factory, |
90 GCMStore* gcm_store); | 92 GCMStore* gcm_store); |
91 virtual ~MCSClient(); | 93 virtual ~MCSClient(); |
92 | 94 |
93 // Initialize the client. Will load any previous id/token information as well | 95 // Initialize the client. Will load any previous id/token information as well |
94 // as unacknowledged message information from the GCM storage, if it exists, | 96 // as unacknowledged message information from the GCM storage, if it exists, |
95 // passing the id/token information back via |initialization_callback| along | 97 // passing the id/token information back via |initialization_callback| along |
96 // with a |success == true| result. If no GCM information is present (and | 98 // with a |success == true| result. If no GCM information is present (and |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 HeartbeatManager heartbeat_manager_; | 270 HeartbeatManager heartbeat_manager_; |
269 | 271 |
270 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; | 272 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; |
271 | 273 |
272 DISALLOW_COPY_AND_ASSIGN(MCSClient); | 274 DISALLOW_COPY_AND_ASSIGN(MCSClient); |
273 }; | 275 }; |
274 | 276 |
275 } // namespace gcm | 277 } // namespace gcm |
276 | 278 |
277 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 279 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
OLD | NEW |