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

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: Add test, refactor and 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..eaf71859f2cb973f885581639105a88c13f37874 100644
--- a/content/public/common/push_messaging_status.h
+++ b/content/public/common/push_messaging_status.h
@@ -12,27 +12,30 @@ enum PushRegistrationStatus {
// Registration was successful.
PUSH_REGISTRATION_STATUS_SUCCESS = 0,
+ // A successful registration was already cached in Service Worker storage.
+ PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE = 1,
+
// Registration failed because there is no Service Worker.
- PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER = 1,
+ PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER = 2,
// Registration failed because the push service is not available.
- PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 2,
+ PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 3,
// Registration failed because the maximum number of registratons has been
// reached.
- PUSH_REGISTRATION_STATUS_LIMIT_REACHED = 3,
+ PUSH_REGISTRATION_STATUS_LIMIT_REACHED = 4,
// Registration failed because permission was denied.
- PUSH_REGISTRATION_STATUS_PERMISSION_DENIED = 4,
+ PUSH_REGISTRATION_STATUS_PERMISSION_DENIED = 5,
// Registration failed in the push service implemented by the embedder.
- PUSH_REGISTRATION_STATUS_SERVICE_ERROR = 5,
+ PUSH_REGISTRATION_STATUS_SERVICE_ERROR = 6,
// Registration failed because no sender id was provided by the page.
- PUSH_REGISTRATION_STATUS_NO_SENDER_ID = 6,
+ PUSH_REGISTRATION_STATUS_NO_SENDER_ID = 7,
// Registration succeeded, but we failed to persist it.
- PUSH_REGISTRATION_STATUS_STORAGE_ERROR = 7,
+ PUSH_REGISTRATION_STATUS_STORAGE_ERROR = 8,
// NOTE: Do not renumber these as that would confuse interpretation of
// previously logged data. When making changes, also update the enum list

Powered by Google App Engine
This is Rietveld 408576698