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

Unified Diff: components/gcm_driver/gcm_client_impl.h

Issue 910093003: Reset the GCM store to recover from it when it is busted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more feedback Created 5 years, 10 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_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cf1b33b940d2d77594fbcff55cb5611efb6b2e43..801a2251d735ee63cdd424dfeaf471c9aec6e402 100644
--- a/components/gcm_driver/gcm_client_impl.h
+++ b/components/gcm_driver/gcm_client_impl.h
@@ -198,8 +198,8 @@ class GCMClientImpl
void OnFirstTimeDeviceCheckinCompleted(const CheckinInfo& checkin_info);
// Starts a login on mcs_client_.
void StartMCSLogin();
- // Resets state to before initialization.
- void ResetState();
+ // Resets the GCM store when it is corrupted.
+ void ResetStore();
// Sets state to ready. This will initiate the MCS login and notify the
// delegates.
void OnReady(const std::vector<AccountMapping>& account_mappings,
@@ -237,6 +237,9 @@ class GCMClientImpl
// Callback for store operation where result does not matter.
void IgnoreWriteResultCallback(bool success);
+ // Callback for resetting the GCM store.
+ void ResetStoreCallback(bool success);
+
// Completes the registration request.
void OnRegisterCompleted(const std::string& app_id,
const std::vector<std::string>& sender_ids,
@@ -303,6 +306,10 @@ class GCMClientImpl
// Data loaded from the GCM store.
scoped_ptr<GCMStore::LoadResult> load_result_;
+ // Tracks if the GCM store has been reset. This is used to prevent from
+ // resetting and loading from the store again and again.
+ bool gcm_store_reset_;
+
scoped_refptr<net::HttpNetworkSession> network_session_;
net::BoundNetLog net_log_;
scoped_ptr<ConnectionFactory> connection_factory_;
« no previous file with comments | « no previous file | components/gcm_driver/gcm_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698