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 subscription success/error codes for internal use & reporting in UMA. |
11 enum PushRegistrationStatus { | 11 enum PushSubscriptionStatus { |
12 // New successful registration (there was not yet a registration cached in | 12 // New successful subscriptions (there was not yet a subscription cached in |
13 // Service Worker storage, so the browser successfully registered with the | 13 // Service Worker storage, so the browser successfully subscribed with the |
14 // push service. This is likely to be a new push registration, though it's | 14 // push service. This is likely to be a new push subscription, though it's |
15 // possible that the push service had its own cache (for example if Chrome's | 15 // possible that the push service had its own cache (for example if Chrome's |
16 // app data was cleared, we might have forgotten about a registration that the | 16 // app data was cleared, we might have forgotten about a subscription that the |
17 // push service still stores). | 17 // push service still stores). |
18 PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE = 0, | 18 PUSH_SUBSCRIPTION_STATUS_SUCCESS_FROM_PUSH_SERVICE = 0, |
19 | 19 |
20 // Registration failed because there is no Service Worker. | 20 // Subscription failed because there is no Service Worker. |
21 PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER = 1, | 21 PUSH_SUBSCRIPTION_STATUS_NO_SERVICE_WORKER = 1, |
22 | 22 |
23 // Registration failed because the push service is not available. | 23 // Subscription failed because the push service is not available. |
24 PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 2, | 24 PUSH_SUBSCRIPTION_STATUS_SERVICE_NOT_AVAILABLE = 2, |
25 | 25 |
26 // Registration failed because the maximum number of registratons has been | 26 // Subscription failed because the maximum number of subscriptions has been |
27 // reached. | 27 // reached. |
28 PUSH_REGISTRATION_STATUS_LIMIT_REACHED = 3, | 28 PUSH_SUBSCRIPTION_STATUS_LIMIT_REACHED = 3, |
29 | 29 |
30 // Registration failed because permission was denied. | 30 // Subscription failed because permission was denied. |
31 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED = 4, | 31 PUSH_SUBSCRIPTION_STATUS_PERMISSION_DENIED = 4, |
32 | 32 |
33 // Registration failed in the push service implemented by the embedder. | 33 // Subscription failed in the push service implemented by the embedder. |
34 PUSH_REGISTRATION_STATUS_SERVICE_ERROR = 5, | 34 PUSH_SUBSCRIPTION_STATUS_SERVICE_ERROR = 5, |
35 | 35 |
36 // Registration failed because no sender id was provided by the page. | 36 // Subscription failed because no sender id was provided by the page. |
37 PUSH_REGISTRATION_STATUS_NO_SENDER_ID = 6, | 37 PUSH_SUBSCRIPTION_STATUS_NO_SENDER_ID = 6, |
38 | 38 |
39 // Registration succeeded, but we failed to persist it. | 39 // Subscription succeeded, but we failed to persist it. |
40 PUSH_REGISTRATION_STATUS_STORAGE_ERROR = 7, | 40 PUSH_SUBSCRIPTION_STATUS_STORAGE_ERROR = 7, |
41 | 41 |
42 // A successful registration was already cached in Service Worker storage. | 42 // A successful subscription was already cached in Service Worker storage. |
43 PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE = 8, | 43 PUSH_SUBSCRIPTION_STATUS_SUCCESS_FROM_CACHE = 8, |
44 | 44 |
45 // Registration failed due to a network error. | 45 // Subscription failed due to a network error. |
46 PUSH_REGISTRATION_STATUS_NETWORK_ERROR = 9, | 46 PUSH_SUBSCRIPTION_STATUS_NETWORK_ERROR = 9, |
47 | 47 |
48 // Registration failed because the push service is not available in incognito, | 48 // Subscription failed because the push service is not available in incognito, |
49 // but we tell JS that permission was denied to not reveal incognito. | 49 // but we tell JS that permission was denied to not reveal incognito. |
50 PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED = 10, | 50 PUSH_SUBSCRIPTION_STATUS_INCOGNITO_PERMISSION_DENIED = 10, |
51 | 51 |
52 // NOTE: Do not renumber these as that would confuse interpretation of | 52 // NOTE: Do not renumber these as that would confuse interpretation of |
53 // previously logged data. When making changes, also update the enum list | 53 // previously logged data. When making changes, also update the enum list |
54 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 54 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
55 // update PUSH_REGISTRATION_STATUS_LAST below. | 55 // update PUSH_SUBSCRIPTION_STATUS_LAST below. |
56 | 56 |
57 PUSH_REGISTRATION_STATUS_LAST = | 57 PUSH_SUBSCRIPTION_STATUS_LAST = |
58 PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED | 58 PUSH_SUBSCRIPTION_STATUS_INCOGNITO_PERMISSION_DENIED |
59 }; | 59 }; |
60 | 60 |
61 // Push unregistration success/error codes for internal use & reporting in UMA. | 61 // Push unsubscription success/error codes for internal use & reporting in UMA. |
62 enum PushUnregistrationStatus { | 62 enum PushUnsubscriptionStatus { |
63 // The unregistration was successful. | 63 // The unsubscription was successful. |
64 PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED = 0, | 64 PUSH_UNSUBSCRIPTION_STATUS_SUCCESS_UNSUBSCRIBED = 0, |
65 | 65 |
66 // Unregistration was unnecessary, as the registration was not found. | 66 // Unsubscription was unnecessary, as the subscription was not found. |
67 PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED = 1, | 67 PUSH_UNSUBSCRIPTION_STATUS_SUCCESS_WAS_NOT_SUBSCRIBED = 1, |
68 | 68 |
69 // The unregistration did not happen because of a network error, but will be | 69 // The unsubscription did not happen because of a network error, but will be |
70 // retried until it succeeds. | 70 // retried until it succeeds. |
71 PUSH_UNREGISTRATION_STATUS_PENDING_NETWORK_ERROR = 2, | 71 PUSH_UNSUBSCRIPTION_STATUS_PENDING_NETWORK_ERROR = 2, |
72 | 72 |
73 // Unregistration failed because there is no Service Worker. | 73 // Unsubscription failed because there is no Service Worker. |
74 PUSH_UNREGISTRATION_STATUS_NO_SERVICE_WORKER = 3, | 74 PUSH_UNSUBSCRIPTION_STATUS_NO_SERVICE_WORKER = 3, |
75 | 75 |
76 // Unregistration failed because the push service is not available. | 76 // Unsubscription failed because the push service is not available. |
77 PUSH_UNREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 4, | 77 PUSH_UNSUBSCRIPTION_STATUS_SERVICE_NOT_AVAILABLE = 4, |
78 | 78 |
79 // Unregistration failed in the push service implemented by the embedder, but | 79 // Unsubscription failed in the push service implemented by the embedder, but |
80 // will be retried until it succeeds. | 80 // will be retried until it succeeds. |
81 PUSH_UNREGISTRATION_STATUS_PENDING_SERVICE_ERROR = 5, | 81 PUSH_UNSUBSCRIPTION_STATUS_PENDING_SERVICE_ERROR = 5, |
82 | 82 |
83 // Unregistration succeeded, but we failed to clear Service Worker storage. | 83 // Unsubscription succeeded, but we failed to clear Service Worker storage. |
84 PUSH_UNREGISTRATION_STATUS_STORAGE_ERROR = 6, | 84 PUSH_UNSUBSCRIPTION_STATUS_STORAGE_ERROR = 6, |
85 | 85 |
86 // Unregistration failed due to a network error. | 86 // Unsubscription failed due to a network error. |
87 PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR = 7, | 87 PUSH_UNSUBSCRIPTION_STATUS_NETWORK_ERROR = 7, |
88 | 88 |
89 // NOTE: Do not renumber these as that would confuse interpretation of | 89 // NOTE: Do not renumber these as that would confuse interpretation of |
90 // previously logged data. When making changes, also update the enum list | 90 // previously logged data. When making changes, also update the enum list |
91 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 91 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
92 // update PUSH_UNREGISTRATION_STATUS_LAST below. | 92 // update PUSH_UNSUBSCRIPTION_STATUS_LAST below. |
93 | 93 |
94 PUSH_UNREGISTRATION_STATUS_LAST = PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR | 94 PUSH_UNSUBSCRIPTION_STATUS_LAST = PUSH_UNSUBSCRIPTION_STATUS_NETWORK_ERROR |
95 }; | 95 }; |
96 | 96 |
97 // Push getregistration success/error codes for internal use & reporting in UMA. | 97 // Push getsubscription success/error codes for internal use & reporting in UMA. |
98 enum PushGetRegistrationStatus { | 98 enum PushGetSubscriptionStatus { |
99 // Getting the registration was successful. | 99 // Getting the subscription was successful. |
100 PUSH_GETREGISTRATION_STATUS_SUCCESS = 0, | 100 PUSH_GETSUBSCRIPTION_STATUS_SUCCESS = 0, |
101 | 101 |
102 // Getting the registration failed because the push service is not available. | 102 // Getting the subscription failed because the push service is not available. |
103 PUSH_GETREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 1, | 103 PUSH_GETSUBSCRIPTION_STATUS_SERVICE_NOT_AVAILABLE = 1, |
104 | 104 |
105 // Getting the registration failed because we failed to read from storage. | 105 // Getting the subscription failed because we failed to read from storage. |
106 PUSH_GETREGISTRATION_STATUS_STORAGE_ERROR = 2, | 106 PUSH_GETSUBSCRIPTION_STATUS_STORAGE_ERROR = 2, |
107 | 107 |
108 // Getting the registration failed because there is no push registration. | 108 // Getting the subscription failed because there is no push subscription. |
109 PUSH_GETREGISTRATION_STATUS_REGISTRATION_NOT_FOUND = 3, | 109 PUSH_GETSUBSCRIPTION_STATUS_SUBSCRIPTION_NOT_FOUND = 3, |
110 | 110 |
111 // Getting the registration failed because the push service isn't available in | 111 // Getting the subscription failed because the push service isn't available in |
112 // incognito, but we tell JS registration not found to not reveal incognito. | 112 // incognito, but we tell JS subscription not found to not reveal incognito. |
113 PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND = 4, | 113 PUSH_GETSUBSCRIPTION_STATUS_INCOGNITO_SUBSCRIPTION_NOT_FOUND = 4, |
114 | 114 |
115 // NOTE: Do not renumber these as that would confuse interpretation of | 115 // NOTE: Do not renumber these as that would confuse interpretation of |
116 // previously logged data. When making changes, also update the enum list | 116 // previously logged data. When making changes, also update the enum list |
117 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 117 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
118 // update PUSH_GETREGISTRATION_STATUS_LAST below. | 118 // update PUSH_GETSUBSCRIPTION_STATUS_LAST below. |
119 | 119 |
120 PUSH_GETREGISTRATION_STATUS_LAST = | 120 PUSH_GETSUBSCRIPTION_STATUS_LAST = |
121 PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND | 121 PUSH_GETSUBSCRIPTION_STATUS_INCOGNITO_SUBSCRIPTION_NOT_FOUND |
122 }; | 122 }; |
123 | 123 |
124 // Push message event success/error codes for internal use & reporting in UMA. | 124 // Push message event success/error codes for internal use & reporting in UMA. |
125 enum PushDeliveryStatus { | 125 enum PushDeliveryStatus { |
126 // The message was successfully delivered. | 126 // The message was successfully delivered. |
127 PUSH_DELIVERY_STATUS_SUCCESS = 0, | 127 PUSH_DELIVERY_STATUS_SUCCESS = 0, |
128 | 128 |
129 // The message could not be delivered because it was invalid. | 129 // The message could not be delivered because it was invalid. |
130 PUSH_DELIVERY_STATUS_INVALID_MESSAGE = 1, | 130 PUSH_DELIVERY_STATUS_INVALID_MESSAGE = 1, |
131 | 131 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 // NOTE: Do not renumber these as that would confuse interpretation of | 175 // NOTE: Do not renumber these as that would confuse interpretation of |
176 // previously logged data. When making changes, also update the enum list | 176 // previously logged data. When making changes, also update the enum list |
177 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 177 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
178 // update PUSH_USER_VISIBLE_STATUS_LAST below. | 178 // update PUSH_USER_VISIBLE_STATUS_LAST below. |
179 | 179 |
180 PUSH_USER_VISIBLE_STATUS_LAST = | 180 PUSH_USER_VISIBLE_STATUS_LAST = |
181 PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED | 181 PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED |
182 }; | 182 }; |
183 | 183 |
184 const char* PushRegistrationStatusToString(PushRegistrationStatus status); | 184 const char* PushSubscriptionStatusToString(PushSubscriptionStatus status); |
185 | 185 |
186 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status); | 186 const char* PushUnsubscriptionStatusToString(PushUnsubscriptionStatus status); |
187 | 187 |
188 } // namespace content | 188 } // namespace content |
189 | 189 |
190 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 190 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
OLD | NEW |