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

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
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..8352bd06beff509da783d728d884ed5c2991cc9e 100644
--- a/Source/modules/push_messaging/PushManager.cpp
+++ b/Source/modules/push_messaging/PushManager.cpp
@@ -93,6 +93,9 @@ 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, "non-visible push messages are not supported."));
Peter Beverloo 2015/05/07 15:28:21 What about: "Chrome does not yet support push subs
Miguel Garcia 2015/05/07 19:40:46 I'd prefer to avoid "yet" since it's not clear exa
+ }
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();

Powered by Google App Engine
This is Rietveld 408576698