Chromium Code Reviews| Index: components/gcm_driver/gcm_client_impl.h |
| diff --git a/components/gcm_driver/gcm_client_impl.h b/components/gcm_driver/gcm_client_impl.h |
| index 0ce19d6d6cf91e61a5456747864c1b6fc01bb735..51a55731d29907a517bdafe55e1809b5d3bb24b2 100644 |
| --- a/components/gcm_driver/gcm_client_impl.h |
| +++ b/components/gcm_driver/gcm_client_impl.h |
| @@ -6,6 +6,7 @@ |
| #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| #include <map> |
| +#include <set> |
| #include <string> |
| #include <vector> |
| @@ -101,6 +102,8 @@ class GCMClientImpl |
| virtual void SetRecording(bool recording) OVERRIDE; |
| virtual void ClearActivityLogs() OVERRIDE; |
| virtual GCMStatistics GetStatistics() const OVERRIDE; |
| + virtual void SetAccountsForCheckin( |
| + const std::map<std::string, std::string>& account_tokens) OVERRIDE; |
| // GCMStatsRecorder::Delegate implemenation. |
| virtual void OnActivityRecorded() OVERRIDE; |
| @@ -127,17 +130,26 @@ class GCMClientImpl |
| READY, |
| }; |
| - // The check-in info for the user. Returned by the server. |
| + // The check-in info for the device. |
| struct CheckinInfo { |
| - CheckinInfo() : android_id(0), secret(0) {} |
| + CheckinInfo(); |
| + ~CheckinInfo(); |
| bool IsValid() const { return android_id != 0 && secret != 0; } |
| - void Reset() { |
| - android_id = 0; |
| - secret = 0; |
| - } |
| + void SnapshotCheckinAccounts(); |
|
Nicolas Zea
2014/07/16 20:53:54
Hmm, I wonder if this struct is becoming complex e
fgorski
2014/07/17 03:35:35
Ack. Lemme do a separate patch for that, there is
|
| + void Reset(); |
| + // Android ID of the device as assigned by the server. |
| uint64 android_id; |
| + // Security token of the device as assigned by the server. |
| uint64 secret; |
| + // True if accounts where already provided through SetAccountsForCheckin(), |
|
Nicolas Zea
2014/07/16 20:53:54
nit: where -> were
fgorski
2014/07/17 03:35:35
Done.
|
| + // or when |last_checkin_accounts| was loaded as empty. |
| + bool accounts_set; |
| + // Map of account email addresses and OAuth2 tokens that will be sent to the |
| + // checkin server on a next checkin. |
| + std::map<std::string, std::string> account_tokens; |
| + // As set of accounts last checkin was completed with. |
| + std::set<std::string> last_checkin_accounts; |
| }; |
| // Collection of pending registration requests. Keys are app IDs, while values |
| @@ -199,8 +211,8 @@ class GCMClientImpl |
| void SchedulePeriodicCheckin(); |
| // Gets the time until next checkin. |
| base::TimeDelta GetTimeToNextCheckin() const; |
| - // Callback for setting last checkin time in the |gcm_store_|. |
| - void SetLastCheckinTimeCallback(bool success); |
| + // Callback for setting last checkin information in the |gcm_store_|. |
| + void SetLastCheckinInfoCallback(bool success); |
| // Callback for persisting device credentials in the |gcm_store_|. |
| void SetDeviceCredentialsCallback(bool success); |