| 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 e91e94455ee6d6ef5dac94a68ff7e720e68c6c7b..4e434d7281504481912396bfa217772863d85025 100644
|
| --- a/content/public/common/push_messaging_status.h
|
| +++ b/content/public/common/push_messaging_status.h
|
| @@ -7,7 +7,7 @@
|
|
|
| namespace content {
|
|
|
| -// Push registration success / error codes for internal use & reporting in UMA.
|
| +// Push registration success/error codes for internal use & reporting in UMA.
|
| enum PushRegistrationStatus {
|
| // New successful registration (there was not yet a registration cached in
|
| // Service Worker storage, so the browser successfully registered with the
|
| @@ -42,79 +42,113 @@ enum PushRegistrationStatus {
|
| // A successful registration was already cached in Service Worker storage.
|
| PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE = 8,
|
|
|
| + // Registration failed due to a network error.
|
| + PUSH_REGISTRATION_STATUS_NETWORK_ERROR = 9,
|
| +
|
| + // Registration failed because the push service is not available in incognito,
|
| + // but we tell JS that permission was denied to not reveal incognito.
|
| + PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED = 10,
|
| +
|
| // 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_SUCCESS_FROM_CACHE
|
| + PUSH_REGISTRATION_STATUS_LAST =
|
| + PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED
|
| };
|
|
|
| -// Push unregistration success / error codes for internal use & reporting.
|
| +// Push unregistration success/error codes for internal use & reporting in UMA.
|
| enum PushUnregistrationStatus {
|
| // The unregistration was successful.
|
| - PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTER,
|
| + PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED = 0,
|
| +
|
| + // Unregistration was unnecessary, as the registration was not found.
|
| + PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED = 1,
|
|
|
| - // The registration did not happen because of a network error, but will be
|
| + // The unregistration did not happen because of a network error, but will be
|
| // retried until it succeeds.
|
| - PUSH_UNREGISTRATION_STATUS_SUCCESS_WILL_RETRY_NETWORK_ERROR,
|
| + PUSH_UNREGISTRATION_STATUS_PENDING_WILL_RETRY_NETWORK_ERROR = 2,
|
| +
|
| + // Unregistration failed because there is no Service Worker.
|
| + PUSH_UNREGISTRATION_STATUS_NO_SERVICE_WORKER = 3,
|
| +
|
| + // Unregistration failed because the push service is not available.
|
| + PUSH_UNREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 4,
|
|
|
| - // The registration was not registered.
|
| - PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED,
|
| + // Unregistration failed in the push service implemented by the embedder.
|
| + PUSH_UNREGISTRATION_STATUS_SERVICE_ERROR = 5,
|
|
|
| - // The unregistration did not happen because of a network error.
|
| - PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR,
|
| + // Unregistration succeeded, but we failed to clear Service Worker storage.
|
| + PUSH_UNREGISTRATION_STATUS_STORAGE_ERROR = 6,
|
| +
|
| + // Unregistration failed due to a network error.
|
| + PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR = 7,
|
| +
|
| + // 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_STATUS_LAST below.
|
|
|
| - // The unregistration did not happen because of a miscellaneous error.
|
| - PUSH_UNREGISTRATION_STATUS_UNKNOWN_ERROR,
|
| + PUSH_UNREGISTRATION_STATUS_LAST = PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR
|
| };
|
|
|
| -// Push get registration success / error codes for internal use.
|
| +// Push getregistration success/error codes for internal use & reporting in UMA.
|
| enum PushGetRegistrationStatus {
|
| // Getting the registration was successful.
|
| - PUSH_GETREGISTRATION_STATUS_SUCCESS,
|
| + PUSH_GETREGISTRATION_STATUS_SUCCESS = 0,
|
| +
|
| + // Getting the registration failed because the push service is not available.
|
| + PUSH_GETREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 1,
|
| +
|
| + // Getting the registration failed because we failed to read from storage.
|
| + PUSH_GETREGISTRATION_STATUS_STORAGE_ERROR = 2,
|
|
|
| // Getting the registration failed because there is no push registration.
|
| - PUSH_GETREGISTRATION_STATUS_REGISTRATION_NOT_FOUND,
|
| + PUSH_GETREGISTRATION_STATUS_REGISTRATION_NOT_FOUND = 3,
|
|
|
| - // Getting the registration failed because of a service worker error.
|
| - PUSH_GETREGISTRATION_STATUS_SERVICE_WORKER_ERROR,
|
| + // Getting the registration failed because the push service isn't available in
|
| + // incognito, but we tell JS registration not found to not reveal incognito.
|
| + PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND = 4,
|
|
|
| - // When making changes, update PUSH_GETREGISTRATION_STATUS_LAST below.
|
| + // 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.
|
|
|
| - // Used for IPC message range checks.
|
| PUSH_GETREGISTRATION_STATUS_LAST =
|
| - PUSH_GETREGISTRATION_STATUS_SERVICE_WORKER_ERROR
|
| + PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND
|
| };
|
|
|
| -// Push message delivery success / error codes for internal use.
|
| +// Push message event success/error codes for internal use & reporting in UMA.
|
| enum PushDeliveryStatus {
|
| // The message was successfully delivered.
|
| - PUSH_DELIVERY_STATUS_SUCCESS,
|
| + PUSH_DELIVERY_STATUS_SUCCESS = 0,
|
|
|
| // The message could not be delivered because it was invalid.
|
| - PUSH_DELIVERY_STATUS_INVALID_MESSAGE,
|
| + PUSH_DELIVERY_STATUS_INVALID_MESSAGE = 1,
|
|
|
| // The message could not be delivered because the app id was unknown.
|
| - PUSH_DELIVERY_STATUS_UNKNOWN_APP_ID,
|
| + PUSH_DELIVERY_STATUS_UNKNOWN_APP_ID = 2,
|
|
|
| // The message could not be delivered because origin no longer has permission.
|
| - PUSH_DELIVERY_STATUS_PERMISSION_DENIED,
|
| + PUSH_DELIVERY_STATUS_PERMISSION_DENIED = 3,
|
|
|
| // The message could not be delivered because no service worker was found.
|
| - PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER,
|
| + PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER = 4,
|
|
|
| // The message could not be delivered because of a service worker error.
|
| - PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR,
|
| + PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR = 5,
|
|
|
| // The message was delivered, but the Service Worker passed a Promise to
|
| // event.waitUntil that got rejected.
|
| - PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED,
|
| + PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED = 6,
|
|
|
| - // When making changes, update PUSH_DELIVERY_STATUS_LAST below.
|
| + // 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_DELIVERY_STATUS_LAST below.
|
|
|
| - // Used for IPC message range checks.
|
| PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED
|
| };
|
|
|
| @@ -142,13 +176,14 @@ enum PushUserVisibleStatus {
|
| // in tools/metrics/histograms/histograms.xml to keep it in sync, and
|
| // update PUSH_USER_VISIBLE_STATUS_LAST below.
|
|
|
| - // Used for IPC message range checks.
|
| PUSH_USER_VISIBLE_STATUS_LAST =
|
| PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED
|
| };
|
|
|
| const char* PushRegistrationStatusToString(PushRegistrationStatus status);
|
|
|
| +const char* PushUnregistrationStatusToString(PushUnregistrationStatus status);
|
| +
|
| } // namespace content
|
|
|
| #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_
|
|
|