| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // passing the id/token information back via |initialization_callback| along | 91 // passing the id/token information back via |initialization_callback| along |
| 92 // with a |success == true| result. If no GCM information is present (and | 92 // with a |success == true| result. If no GCM information is present (and |
| 93 // this is therefore a fresh client), a clean GCM store will be created and | 93 // this is therefore a fresh client), a clean GCM store will be created and |
| 94 // values of 0 will be returned via |initialization_callback| with | 94 // values of 0 will be returned via |initialization_callback| with |
| 95 // |success == true|. | 95 // |success == true|. |
| 96 /// If an error loading the GCM store is encountered, | 96 /// If an error loading the GCM store is encountered, |
| 97 // |initialization_callback| will be invoked with |success == false|. | 97 // |initialization_callback| will be invoked with |success == false|. |
| 98 void Initialize(const ErrorCallback& initialization_callback, | 98 void Initialize(const ErrorCallback& initialization_callback, |
| 99 const OnMessageReceivedCallback& message_received_callback, | 99 const OnMessageReceivedCallback& message_received_callback, |
| 100 const OnMessageSentCallback& message_sent_callback, | 100 const OnMessageSentCallback& message_sent_callback, |
| 101 const GCMStore::LoadResult& load_result); | 101 scoped_ptr<GCMStore::LoadResult> load_result); |
| 102 | 102 |
| 103 // Logs the client into the server. Client must be initialized. | 103 // Logs the client into the server. Client must be initialized. |
| 104 // |android_id| and |security_token| are optional if this is not a new | 104 // |android_id| and |security_token| are optional if this is not a new |
| 105 // client, else they must be non-zero. | 105 // client, else they must be non-zero. |
| 106 // Successful login will result in |message_received_callback| being invoked | 106 // Successful login will result in |message_received_callback| being invoked |
| 107 // with a valid LoginResponse. | 107 // with a valid LoginResponse. |
| 108 // Login failure (typically invalid id/token) will shut down the client, and | 108 // Login failure (typically invalid id/token) will shut down the client, and |
| 109 // |initialization_callback| to be invoked with |success = false|. | 109 // |initialization_callback| to be invoked with |success = false|. |
| 110 void Login(uint64 android_id, uint64 security_token); | 110 void Login(uint64 android_id, uint64 security_token); |
| 111 | 111 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 HeartbeatManager heartbeat_manager_; | 246 HeartbeatManager heartbeat_manager_; |
| 247 | 247 |
| 248 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; | 248 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; |
| 249 | 249 |
| 250 DISALLOW_COPY_AND_ASSIGN(MCSClient); | 250 DISALLOW_COPY_AND_ASSIGN(MCSClient); |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 } // namespace gcm | 253 } // namespace gcm |
| 254 | 254 |
| 255 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 255 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
| OLD | NEW |