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

Unified Diff: components/gcm_driver/gcm_app_handler.h

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_account_mapper.cc ('k') | components/gcm_driver/gcm_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_app_handler.h
diff --git a/components/gcm_driver/gcm_app_handler.h b/components/gcm_driver/gcm_app_handler.h
index 4ee8b906167f68bdf3bf52c44fcda9ba38b7c83b..934819c25c42b69b43e8ae965f4070b8ad221086 100644
--- a/components/gcm_driver/gcm_app_handler.h
+++ b/components/gcm_driver/gcm_app_handler.h
@@ -23,6 +23,15 @@ class GCMAppHandler {
// make safe for ShutdownHandler to be called multiple times.
virtual void ShutdownHandler() = 0;
+ // Called when the GCM store is reset (e.g. due to corruption), which changes
+ // the device ID, invalidating all prior registrations. Any stored state
+ // related to GCM registrations or InstanceIDs should be deleted. This should
+ // only be considered a defense in depth, as this method will not be called if
+ // the store is reset before this app handler is registered; hence it is
+ // recommended to regularly revalidate any stored registrations/InstanceIDs.
+ // TODO(johnme): GCMDriver doesn't yet provide an API for revalidating them.
+ virtual void OnStoreReset() = 0;
+
// Called when a GCM message has been received.
virtual void OnMessage(const std::string& app_id,
const IncomingMessage& message) = 0;
« no previous file with comments | « components/gcm_driver/gcm_account_mapper.cc ('k') | components/gcm_driver/gcm_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698