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

Unified Diff: content/public/common/push_messaging_status.h

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Fix include Created 3 years, 9 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 | « content/public/browser/push_messaging_service.h ('k') | content/public/common/push_messaging_status.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/push_messaging_status.h
diff --git a/content/public/common/push_messaging_status.h b/content/public/common/push_messaging_status.h
index e5e7ccf1d35de298cd056f00add821916e2db44f..7619555c7f602ff1a1f6bb8cb4d1f0d1e3e00d00 100644
--- a/content/public/common/push_messaging_status.h
+++ b/content/public/common/push_messaging_status.h
@@ -61,12 +61,16 @@ enum PushRegistrationStatus {
// already exists.
PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH = 13,
+ // Registration failed because storage was corrupt. It will be retried
+ // automatically after unsubscribing to fix the corruption.
+ PUSH_REGISTRATION_STATUS_STORAGE_CORRUPT = 14,
+
// NOTE: Do not renumber these as that would confuse interpretation of
// previously logged data. When making changes, also update the enum list
// in tools/metrics/histograms/histograms.xml to keep it in sync, and
// update PUSH_REGISTRATION_STATUS_LAST below.
- PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH
+ PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_STORAGE_CORRUPT
};
// Push unregistration reason for reporting in UMA. Enum values can be added,
@@ -96,13 +100,20 @@ enum PushUnregistrationReason {
// Unregistering because the service worker was unregistered.
PUSH_UNREGISTRATION_REASON_SERVICE_WORKER_UNREGISTERED = 7,
+ // Website called subscribe API and the stored subscription was corrupt, so
+ // it is being unsubscribed in order to attempt a clean subscription.
+ PUSH_UNREGISTRATION_REASON_SUBSCRIBE_STORAGE_CORRUPT = 8,
+
+ // Website called getSubscription API and the stored subscription was corrupt.
+ PUSH_UNREGISTRATION_REASON_GET_SUBSCRIPTION_STORAGE_CORRUPT = 9,
+
// NOTE: Do not renumber these as that would confuse interpretation of
// previously logged data. When making changes, also update the enum list
// in tools/metrics/histograms/histograms.xml to keep it in sync, and
// update PUSH_UNREGISTRATION_REASON_LAST below.
PUSH_UNREGISTRATION_REASON_LAST =
- PUSH_UNREGISTRATION_REASON_SERVICE_WORKER_UNREGISTERED
+ PUSH_UNREGISTRATION_REASON_GET_SUBSCRIPTION_STORAGE_CORRUPT
};
// Push unregistration success/error codes for internal use & reporting in UMA.
@@ -161,16 +172,18 @@ enum PushGetRegistrationStatus {
// incognito, but we tell JS registration not found to not reveal incognito.
PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND = 4,
- // Registration failed because the public key could not be retrieved.
- PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE = 5,
+ // Getting the registration failed because public key could not be retrieved.
+ // PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE = 5,
+
+ // Getting the registration failed because storage was corrupt.
+ PUSH_GETREGISTRATION_STATUS_STORAGE_CORRUPT = 6,
// NOTE: Do not renumber these as that would confuse interpretation of
// previously logged data. When making changes, also update the enum list
// in tools/metrics/histograms/histograms.xml to keep it in sync, and
// update PUSH_GETREGISTRATION_STATUS_LAST below.
- PUSH_GETREGISTRATION_STATUS_LAST =
- PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE
+ PUSH_GETREGISTRATION_STATUS_LAST = PUSH_GETREGISTRATION_STATUS_STORAGE_CORRUPT
};
// Push message event success/error codes for internal use & reporting in UMA.
« no previous file with comments | « content/public/browser/push_messaging_service.h ('k') | content/public/common/push_messaging_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698