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 enum PushRegistrationStatus { | 11 enum PushRegistrationStatus { |
11 // Registration was successful. | 12 // Registration was successful. |
12 PUSH_REGISTRATION_STATUS_SUCCESS, | 13 PUSH_REGISTRATION_STATUS_SUCCESS = 0, |
13 | 14 |
14 // Registration failed because there is no Service Worker. | 15 // Registration failed because there is no Service Worker. |
15 PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER, | 16 PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER = 1, |
16 | 17 |
17 // Registration failed because the push service is not available. | 18 // Registration failed because the push service is not available. |
18 PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE, | 19 PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 2, |
19 | 20 |
20 // Registration failed because the maximum number of registratons has been | 21 // Registration failed because the maximum number of registratons has been |
21 // reached. | 22 // reached. |
22 PUSH_REGISTRATION_STATUS_LIMIT_REACHED, | 23 PUSH_REGISTRATION_STATUS_LIMIT_REACHED = 3, |
23 | 24 |
24 // Registration failed because permission was denied. | 25 // Registration failed because permission was denied. |
25 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED, | 26 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED = 4, |
26 | 27 |
27 // Registration failed in the push service implemented by the embedder. | 28 // Registration failed in the push service implemented by the embedder. |
28 PUSH_REGISTRATION_STATUS_SERVICE_ERROR, | 29 PUSH_REGISTRATION_STATUS_SERVICE_ERROR = 5, |
| 30 |
| 31 // NOTE: Do not renumber these as that would confuse interpretation of |
| 32 // previously logged data. When making changes, also update the enum list |
| 33 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
| 34 // update PUSH_REGISTRATION_STATUS_LAST below. |
29 | 35 |
30 // Used for IPC message range checks. | 36 // Used for IPC message range checks. |
31 PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_SERVICE_ERROR | 37 PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_SERVICE_ERROR |
32 }; | 38 }; |
33 | 39 |
| 40 // Push message delivery success / error codes for internal use. |
34 enum PushDeliveryStatus { | 41 enum PushDeliveryStatus { |
35 // The message was successfully delivered. | 42 // The message was successfully delivered. |
36 PUSH_DELIVERY_STATUS_SUCCESS, | 43 PUSH_DELIVERY_STATUS_SUCCESS, |
37 | 44 |
38 // The message could not be delivered because no service worker was found. | 45 // The message could not be delivered because no service worker was found. |
39 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER, | 46 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER, |
40 | 47 |
41 // The message could not be delivered because of a service worker error. | 48 // The message could not be delivered because of a service worker error. |
42 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR, | 49 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR, |
43 | 50 |
| 51 // When making changes, update PUSH_DELIVERY_STATUS_LAST below. |
| 52 |
44 // Used for IPC message range checks. | 53 // Used for IPC message range checks. |
45 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR | 54 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR |
46 }; | 55 }; |
47 | 56 |
48 const char* PushRegistrationStatusToString(PushRegistrationStatus status); | 57 const char* PushRegistrationStatusToString(PushRegistrationStatus status); |
49 | 58 |
50 } // namespace content | 59 } // namespace content |
51 | 60 |
52 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 61 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
OLD | NEW |