Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: components/gcm_driver/gcm_account_mapper.h

Issue 580603002: [GCM] Adding registration ID request and tests to GCM Account Mapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CR feedback Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/gcm_driver/gcm_account_mapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_account_mapper.h
diff --git a/components/gcm_driver/gcm_account_mapper.h b/components/gcm_driver/gcm_account_mapper.h
index 43d3365222b54b257d988983cc7c2f28d319cacc..524adbdd3554546ddaab6f09fcb2e9cfd9c0b148 100644
--- a/components/gcm_driver/gcm_account_mapper.h
+++ b/components/gcm_driver/gcm_account_mapper.h
@@ -32,8 +32,7 @@ class GCMAccountMapper : public GCMAppHandler {
explicit GCMAccountMapper(GCMDriver* gcm_driver);
virtual ~GCMAccountMapper();
- void Initialize(const AccountMappings& account_mappings,
- const std::string& registration_id);
+ void Initialize(const AccountMappings& account_mappings);
// Called by AccountTracker, when a new list of account tokens is available.
// This will cause a refresh of account mappings and sending updates to GCM.
@@ -57,6 +56,9 @@ class GCMAccountMapper : public GCMAppHandler {
typedef std::map<std::string, GCMClient::OutgoingMessage> OutgoingMessages;
+ // Checks whether account mapper is ready to process new account tokens.
+ bool IsReady();
+
// Informs GCM of an added or refreshed account mapping.
void SendAddMappingMessage(AccountMapping& account_mapping);
@@ -70,6 +72,13 @@ class GCMAccountMapper : public GCMAppHandler {
const std::string& message_id,
GCMClient::Result result);
+ // Gets a registration for account mapper from GCM.
+ void GetRegistration();
+
+ // Callback for registering with GCM.
+ void OnRegisterFinished(const std::string& registration_id,
+ GCMClient::Result result);
+
// Checks whether the update can be triggered now. If the current time is
// within reasonable time (6 hours) of when the update is due, we want to
// trigger the update immediately to take advantage of a fresh OAuth2 token.
@@ -98,6 +107,8 @@ class GCMAccountMapper : public GCMAppHandler {
// Currnetly tracked account mappings.
AccountMappings accounts_;
+ std::vector<GCMClient::AccountTokenInfo> pending_account_tokens_;
+
// GCM Registration ID of the account mapper.
std::string registration_id_;
« no previous file with comments | « no previous file | components/gcm_driver/gcm_account_mapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698