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

Side by Side Diff: content/common/push_messaging.mojom

Issue 2715903002: Re-design Unsubscribe and getPermissionStatus mojo interfaces. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « content/child/push_messaging/push_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 interface PushMessaging { 127 interface PushMessaging {
128 Subscribe(int32 render_frame_id, 128 Subscribe(int32 render_frame_id,
129 int64 service_worker_registration_id, 129 int64 service_worker_registration_id,
130 PushSubscriptionOptions options) 130 PushSubscriptionOptions options)
131 => (PushRegistrationStatus status, 131 => (PushRegistrationStatus status,
132 url.mojom.Url? endpoint, 132 url.mojom.Url? endpoint,
133 PushSubscriptionOptions? options, 133 PushSubscriptionOptions? options,
134 array<uint8>? p256dh, 134 array<uint8>? p256dh,
135 array<uint8>? auth); 135 array<uint8>? auth);
136 136
137 // It returns |did_unsubscribe| if is_success is true, and returns 137 // We use the value of |error_type| as a flag. If |error_type| == Unknown, it
138 // |error_type| and |error_message| if is_success is false. 138 // means no error and returns |did_unsubscribe|. Else, it means there is an
139 // error and returns |error_type| and |error_message|.
Peter Beverloo 2017/02/24 15:55:35 What about renaming PushErrorType::UNKNOWN to Push
139 Unsubscribe(int64 service_worker_registration_id) 140 Unsubscribe(int64 service_worker_registration_id)
140 => (bool is_success, 141 => (PushErrorType error_type,
141 bool did_unsubscribe, 142 bool did_unsubscribe,
142 PushErrorType error_type,
143 string? error_message); 143 string? error_message);
144 144
145 GetSubscription(int64 service_worker_registration_id) 145 GetSubscription(int64 service_worker_registration_id)
146 => (PushGetRegistrationStatus status, 146 => (PushGetRegistrationStatus status,
147 url.mojom.Url? endpoint, 147 url.mojom.Url? endpoint,
148 PushSubscriptionOptions? options, 148 PushSubscriptionOptions? options,
149 array<uint8>? p256dh, 149 array<uint8>? p256dh,
150 array<uint8>? auth); 150 array<uint8>? auth);
151 151
152 // It returns |status| if |is_success| is true and returns |error| if 152 // We use the value of |error_type| as a flag. If |error_type| == Unknown, it
153 // |is_success| is false. 153 // means no error and returns |status|. Else, it means there is an error and
154 // returns |error_type|.
154 GetPermissionStatus(int64 service_worker_registration_id, 155 GetPermissionStatus(int64 service_worker_registration_id,
155 bool user_visible) 156 bool user_visible)
156 => (bool is_success, 157 => (PushErrorType error_type,
157 // |status| is meaningful when (is_success == true) 158 PushPermissionStatus status);
158 PushPermissionStatus status,
159 // |error| is meaningful when (is_success == false)
160 PushErrorType error);
161 }; 159 };
OLDNEW
« no previous file with comments | « content/child/push_messaging/push_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698