OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 module content.mojom; | 5 module content.mojom; |
6 | 6 |
7 import "url/mojo/url.mojom"; | 7 import "url/mojo/url.mojom"; |
8 | 8 |
9 // TODO(heke): The type-mapping struct and enums are duplicately defined. Need | 9 // TODO(heke): The type-mapping struct and enums are duplicately defined. Need |
10 // to remove/replace those defined in content or blink namespace. | 10 // to remove/replace those defined in content or blink namespace. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 PUBLIC_KEY_UNAVAILABLE = 11, | 61 PUBLIC_KEY_UNAVAILABLE = 11, |
62 | 62 |
63 // Registration failed because the manifest could not be retrieved or was | 63 // Registration failed because the manifest could not be retrieved or was |
64 // empty. | 64 // empty. |
65 MANIFEST_EMPTY_OR_MISSING = 12, | 65 MANIFEST_EMPTY_OR_MISSING = 12, |
66 | 66 |
67 // Registration failed because a subscription with a different sender id | 67 // Registration failed because a subscription with a different sender id |
68 // already exists. | 68 // already exists. |
69 SENDER_ID_MISMATCH = 13, | 69 SENDER_ID_MISMATCH = 13, |
70 | 70 |
| 71 // Registration failed because storage was corrupt. It will be retried |
| 72 // automatically after unsubscribing to fix the corruption. |
| 73 STORAGE_CORRUPT = 14, |
| 74 |
71 // NOTE: Do not renumber these as that would confuse interpretation of | 75 // NOTE: Do not renumber these as that would confuse interpretation of |
72 // previously logged data. When making changes, also update the enum list | 76 // previously logged data. When making changes, also update the enum list |
73 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 77 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
74 // update LAST below. | 78 // update LAST below. |
75 | 79 |
76 LAST = SENDER_ID_MISMATCH | 80 LAST = STORAGE_CORRUPT |
77 }; | 81 }; |
78 | 82 |
79 enum PushErrorType { | 83 enum PushErrorType { |
80 ABORT = 0, | 84 ABORT = 0, |
81 NETWORK = 1, | 85 NETWORK = 1, |
82 NONE = 2, | 86 NONE = 2, |
83 NOT_ALLOWED = 3, | 87 NOT_ALLOWED = 3, |
84 NOT_FOUND = 4, | 88 NOT_FOUND = 4, |
85 NOT_SUPPORTED = 5, | 89 NOT_SUPPORTED = 5, |
86 INVALID_STATE = 6, | 90 INVALID_STATE = 6, |
(...skipping 12 matching lines...) Expand all Loading... |
99 // Getting the registration failed because we failed to read from storage. | 103 // Getting the registration failed because we failed to read from storage. |
100 STORAGE_ERROR = 2, | 104 STORAGE_ERROR = 2, |
101 | 105 |
102 // Getting the registration failed because there is no push registration. | 106 // Getting the registration failed because there is no push registration. |
103 REGISTRATION_NOT_FOUND = 3, | 107 REGISTRATION_NOT_FOUND = 3, |
104 | 108 |
105 // Getting the registration failed because the push service isn't available in | 109 // Getting the registration failed because the push service isn't available in |
106 // incognito, but we tell JS registration not found to not reveal incognito. | 110 // incognito, but we tell JS registration not found to not reveal incognito. |
107 INCOGNITO_REGISTRATION_NOT_FOUND = 4, | 111 INCOGNITO_REGISTRATION_NOT_FOUND = 4, |
108 | 112 |
109 // Registration failed because the public key could not be retrieved. | 113 // Getting the registration failed because public key could not be retrieved. |
110 PUBLIC_KEY_UNAVAILABLE = 5, | 114 // PUBLIC_KEY_UNAVAILABLE = 5, |
| 115 |
| 116 // Getting the registration failed because storage was corrupt. |
| 117 STORAGE_CORRUPT = 6, |
111 | 118 |
112 // NOTE: Do not renumber these as that would confuse interpretation of | 119 // NOTE: Do not renumber these as that would confuse interpretation of |
113 // previously logged data. When making changes, also update the enum list | 120 // previously logged data. When making changes, also update the enum list |
114 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 121 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
115 // update LAST below. | 122 // update LAST below. |
116 | 123 |
117 LAST = PUBLIC_KEY_UNAVAILABLE | 124 LAST = STORAGE_CORRUPT |
118 }; | 125 }; |
119 | 126 |
120 enum PushPermissionStatus { | 127 enum PushPermissionStatus { |
121 GRANTED = 0, | 128 GRANTED = 0, |
122 DENIED = 1, | 129 DENIED = 1, |
123 PROMPT = 2, | 130 PROMPT = 2, |
124 LAST = PROMPT | 131 LAST = PROMPT |
125 }; | 132 }; |
126 | 133 |
127 interface PushMessaging { | 134 interface PushMessaging { |
(...skipping 22 matching lines...) Expand all Loading... |
150 array<uint8>? auth); | 157 array<uint8>? auth); |
151 | 158 |
152 // We use the value of |error_type| as a flag. If |error_type| == NONE, it | 159 // We use the value of |error_type| as a flag. If |error_type| == NONE, it |
153 // means no error and returns |status|. Else, it means there is an error and | 160 // means no error and returns |status|. Else, it means there is an error and |
154 // returns |error_type|. | 161 // returns |error_type|. |
155 GetPermissionStatus(int64 service_worker_registration_id, | 162 GetPermissionStatus(int64 service_worker_registration_id, |
156 bool user_visible) | 163 bool user_visible) |
157 => (PushErrorType error_type, | 164 => (PushErrorType error_type, |
158 PushPermissionStatus status); | 165 PushPermissionStatus status); |
159 }; | 166 }; |
OLD | NEW |