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

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

Issue 1316973002: Pass WebPushError::ErrorTypePermissionDenied when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
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 d503f507dd4c02b7413c1c2b54e155d4a47a69ad..089460172edf7b41f73932e9d539d6080d11893a 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -168,8 +168,13 @@ void PushProvider::OnSubscribeFromWorkerError(int request_id,
if (!callbacks)
return;
+ blink::WebPushError::ErrorType error_type =
+ status == PUSH_REGISTRATION_STATUS_PERMISSION_DENIED
+ ? blink::WebPushError::ErrorTypePermissionDenied
+ : blink::WebPushError::ErrorTypeAbort;
+
callbacks->onError(blink::WebPushError(
- blink::WebPushError::ErrorTypeAbort,
+ error_type,
blink::WebString::fromUTF8(PushRegistrationStatusToString(status))));
subscription_callbacks_.Remove(request_id);

Powered by Google App Engine
This is Rietveld 408576698