Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1288)

Unified Diff: content/common/push_messaging.mojom

Issue 2715903002: Re-design Unsubscribe and getPermissionStatus mojo interfaces. (Closed)
Patch Set: Re-design Unsubscribe and getPermissionStatus mojo interfaces. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/push_messaging/push_provider.cc ('k') | content/common/push_messaging_param_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/push_messaging.mojom
diff --git a/content/common/push_messaging.mojom b/content/common/push_messaging.mojom
index ae843a2834682583c91d2a39be83a71068be1612..db435ad9a2758457705eac30d0837cb627946e59 100644
--- a/content/common/push_messaging.mojom
+++ b/content/common/push_messaging.mojom
@@ -79,10 +79,10 @@ enum PushRegistrationStatus {
enum PushErrorType {
ABORT = 0,
NETWORK = 1,
- NOT_ALLOWED = 2,
- NOT_FOUND = 3,
- NOT_SUPPORTED = 4,
- UNKNOWN = 5,
+ NONE = 2,
+ NOT_ALLOWED = 3,
+ NOT_FOUND = 4,
+ NOT_SUPPORTED = 5,
INVALID_STATE = 6,
LAST = INVALID_STATE
};
@@ -134,12 +134,12 @@ interface PushMessaging {
array<uint8>? p256dh,
array<uint8>? auth);
- // It returns |did_unsubscribe| if is_success is true, and returns
- // |error_type| and |error_message| if is_success is false.
+ // We use the value of |error_type| as a flag. If |error_type| == NONE, it
+ // means no error and returns |did_unsubscribe|. Else, it means there is an
+ // error and returns |error_type| and |error_message|.
Unsubscribe(int64 service_worker_registration_id)
- => (bool is_success,
+ => (PushErrorType error_type,
bool did_unsubscribe,
- PushErrorType error_type,
string? error_message);
GetSubscription(int64 service_worker_registration_id)
@@ -149,13 +149,11 @@ interface PushMessaging {
array<uint8>? p256dh,
array<uint8>? auth);
- // It returns |status| if |is_success| is true and returns |error| if
- // |is_success| is false.
+ // We use the value of |error_type| as a flag. If |error_type| == NONE, it
+ // means no error and returns |status|. Else, it means there is an error and
+ // returns |error_type|.
GetPermissionStatus(int64 service_worker_registration_id,
bool user_visible)
- => (bool is_success,
- // |status| is meaningful when (is_success == true)
- PushPermissionStatus status,
- // |error| is meaningful when (is_success == false)
- PushErrorType error);
+ => (PushErrorType error_type,
+ PushPermissionStatus status);
};
« no previous file with comments | « content/child/push_messaging/push_provider.cc ('k') | content/common/push_messaging_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698