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

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

Issue 778243002: Push API: Return cached registration if available. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@store2
Patch Set: Rebase Created 6 years 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
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 ef5bf4fbda8a447f077d1e2c300619379a28607f..c55b1efdd86fb0a48f8c392cd9d187fb880ffb65 100644
--- a/content/public/common/push_messaging_status.h
+++ b/content/public/common/push_messaging_status.h
@@ -9,8 +9,13 @@ namespace content {
// Push registration success / error codes for internal use & reporting in UMA.
enum PushRegistrationStatus {
- // Registration was successful.
- PUSH_REGISTRATION_STATUS_SUCCESS = 0,
+ // New successful registration (there was not yet a registration cached in
+ // Service Worker storage, so the browser successfully registered with the
+ // push service. This is likely to be a new push registration, though it's
+ // possible that the push service had its own cache (for example if Chrome's
+ // app data was cleared, we might have forgotten about a registration that the
+ // push service still stores).
+ PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE = 0,
// Registration failed because there is no Service Worker.
PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER = 1,
@@ -34,13 +39,16 @@ enum PushRegistrationStatus {
// Registration succeeded, but we failed to persist it.
PUSH_REGISTRATION_STATUS_STORAGE_ERROR = 7,
+ // A successful registration was already cached in Service Worker storage.
+ PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE = 8,
+
// 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.
// Used for IPC message range checks.
- PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_STORAGE_ERROR
+ PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE
};
// Push message delivery success / error codes for internal use.
« no previous file with comments | « content/browser/push_messaging/push_messaging_message_filter.cc ('k') | content/public/common/push_messaging_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698