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

Unified Diff: Source/modules/push_messaging/PushManager.cpp

Issue 1136513002: Reject permissonState calls if userVisible is not present as parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 | « LayoutTests/http/tests/push_messaging/resources/instrumentation-service-worker.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/push_messaging/PushManager.cpp
diff --git a/Source/modules/push_messaging/PushManager.cpp b/Source/modules/push_messaging/PushManager.cpp
index 90a7f642a0609fd76d63b1742bcce2aaf7792703..9d7810367dd2b220453c45762996cfa207868453 100644
--- a/Source/modules/push_messaging/PushManager.cpp
+++ b/Source/modules/push_messaging/PushManager.cpp
@@ -93,6 +93,10 @@ ScriptPromise PushManager::permissionState(ScriptState* scriptState, const PushS
if (!document->domWindow() || !document->frame())
return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "Document is detached from window."));
}
+ if (!options.userVisibleOnly()) {
+ return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError,
johnme 2015/05/08 15:48:22 To change the subject (since I think Peter and Mic
johnme 2015/05/08 15:57:07 Oh, it's rejecting the promise with an exception,
Miguel Garcia 2015/05/08 21:00:32 Yes, it feels more accurate than just denying. Tha
+ "Chrome does not support push subscriptions that do not enable the userVisibleOnly option."));
+ }
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
« no previous file with comments | « LayoutTests/http/tests/push_messaging/resources/instrumentation-service-worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698