OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
6 #define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 6 #define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 | 9 |
10 // Push registration success / error codes for internal use & reporting in UMA. | 10 // Push registration success / error codes for internal use & reporting in UMA. |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Registration failed because permission was denied. | 25 // Registration failed because permission was denied. |
26 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED = 4, | 26 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED = 4, |
27 | 27 |
28 // Registration failed in the push service implemented by the embedder. | 28 // Registration failed in the push service implemented by the embedder. |
29 PUSH_REGISTRATION_STATUS_SERVICE_ERROR = 5, | 29 PUSH_REGISTRATION_STATUS_SERVICE_ERROR = 5, |
30 | 30 |
31 // Registration failed because no sender id was provided by the page. | 31 // Registration failed because no sender id was provided by the page. |
32 PUSH_REGISTRATION_STATUS_NO_SENDER_ID = 6, | 32 PUSH_REGISTRATION_STATUS_NO_SENDER_ID = 6, |
33 | 33 |
| 34 // Registration succeeded, but we failed to persist it. |
| 35 PUSH_REGISTRATION_STATUS_STORAGE_ERROR = 7, |
| 36 |
34 // NOTE: Do not renumber these as that would confuse interpretation of | 37 // NOTE: Do not renumber these as that would confuse interpretation of |
35 // previously logged data. When making changes, also update the enum list | 38 // previously logged data. When making changes, also update the enum list |
36 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 39 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
37 // update PUSH_REGISTRATION_STATUS_LAST below. | 40 // update PUSH_REGISTRATION_STATUS_LAST below. |
38 | 41 |
39 // Used for IPC message range checks. | 42 // Used for IPC message range checks. |
40 PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_NO_SENDER_ID | 43 PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_STORAGE_ERROR |
41 }; | 44 }; |
42 | 45 |
43 // Push message delivery success / error codes for internal use. | 46 // Push message delivery success / error codes for internal use. |
44 enum PushDeliveryStatus { | 47 enum PushDeliveryStatus { |
45 // The message was successfully delivered. | 48 // The message was successfully delivered. |
46 PUSH_DELIVERY_STATUS_SUCCESS, | 49 PUSH_DELIVERY_STATUS_SUCCESS, |
47 | 50 |
48 // The message could not be delivered because no service worker was found. | 51 // The message could not be delivered because no service worker was found. |
49 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER, | 52 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER, |
50 | 53 |
51 // The message could not be delivered because of a service worker error. | 54 // The message could not be delivered because of a service worker error. |
52 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR, | 55 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR, |
53 | 56 |
54 // The message was delivered, but the Service Worker passed a Promise to | 57 // The message was delivered, but the Service Worker passed a Promise to |
55 // event.waitUntil that got rejected. | 58 // event.waitUntil that got rejected. |
56 PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED, | 59 PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED, |
57 | 60 |
58 // When making changes, update PUSH_DELIVERY_STATUS_LAST below. | 61 // When making changes, update PUSH_DELIVERY_STATUS_LAST below. |
59 | 62 |
60 // Used for IPC message range checks. | 63 // Used for IPC message range checks. |
61 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED | 64 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED |
62 }; | 65 }; |
63 | 66 |
64 const char* PushRegistrationStatusToString(PushRegistrationStatus status); | 67 const char* PushRegistrationStatusToString(PushRegistrationStatus status); |
65 | 68 |
66 } // namespace content | 69 } // namespace content |
67 | 70 |
68 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 71 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
OLD | NEW |