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

Unified Diff: content/child/push_messaging/push_provider.cc

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.h ('k') | content/common/push_messaging.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/push_messaging/push_provider.cc
diff --git a/content/child/push_messaging/push_provider.cc b/content/child/push_messaging/push_provider.cc
index 7807c14dcfef319eb2c98add953f83303fb1a7f1..eb58709828a8e23c065bd24e0e92d94a99bd2526 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -184,13 +184,13 @@ void PushProvider::unsubscribe(
void PushProvider::DidUnsubscribe(
std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks,
- bool is_success,
- bool did_unsubscribe,
blink::WebPushError::ErrorType error_type,
+ bool did_unsubscribe,
const base::Optional<std::string>& error_message) {
DCHECK(callbacks);
- if (is_success) {
+ // ErrorTypeNone indicates success.
+ if (error_type == blink::WebPushError::ErrorTypeNone) {
callbacks->onSuccess(did_unsubscribe);
} else {
callbacks->onError(blink::WebPushError(
@@ -260,22 +260,21 @@ void PushProvider::getPermissionStatus(
void PushProvider::DidGetPermissionStatus(
std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks,
- bool is_success,
- blink::WebPushPermissionStatus status,
- blink::WebPushError::ErrorType error) {
+ blink::WebPushError::ErrorType error_type,
+ blink::WebPushPermissionStatus status) {
DCHECK(callbacks);
-
- if (is_success) {
+ // ErrorTypeNone indicates success.
+ if (error_type == blink::WebPushError::ErrorTypeNone) {
callbacks->onSuccess(status);
} else {
std::string error_message;
- if (error == blink::WebPushError::ErrorTypeNotSupported) {
+ if (error_type == blink::WebPushError::ErrorTypeNotSupported) {
error_message =
"Push subscriptions that don't enable userVisibleOnly are not "
"supported.";
}
- callbacks->onError(
- blink::WebPushError(error, blink::WebString::fromUTF8(error_message)));
+ callbacks->onError(blink::WebPushError(
+ error_type, blink::WebString::fromUTF8(error_message)));
}
}
« no previous file with comments | « content/child/push_messaging/push_provider.h ('k') | content/common/push_messaging.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698