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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)
Patch Set: Update Cryptauth comment Created 4 years, 1 month 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 | « components/gcm_driver/gcm_client.h ('k') | components/gcm_driver/gcm_client_impl_unittest.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.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index 080a7d006fb208bdbcff659566dec87c476f049b..bd44af2c7a28b9843ef1b504b8618534dac6cb39 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -812,6 +812,13 @@ void GCMClientImpl::DestroyStoreCallback(bool success) {
}
void GCMClientImpl::ResetStoreCallback(bool success) {
+ // Even an incomplete reset may invalidate registrations, and this might be
+ // the only opportunity to notify the delegate. For example a partial reset
+ // that deletes the "CURRENT" file will cause GCMStoreImpl to consider the DB
+ // to no longer exist, in which case the next load will simply create a new
+ // store rather than resetting it.
+ delegate_->OnStoreReset();
+
if (!success) {
LOG(ERROR) << "Failed to reset GCM store";
RecordResetStoreErrorToUMA(DESTROYING_STORE_FAILED);
« no previous file with comments | « components/gcm_driver/gcm_client.h ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698