summaryrefslogtreecommitdiffstats
path: root/WebCore/notifications/Notification.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/notifications/Notification.cpp')
-rw-r--r--WebCore/notifications/Notification.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/WebCore/notifications/Notification.cpp b/WebCore/notifications/Notification.cpp
index ecb5799..ed30800 100644
--- a/WebCore/notifications/Notification.cpp
+++ b/WebCore/notifications/Notification.cpp
@@ -38,7 +38,7 @@
#include "Document.h"
#include "EventNames.h"
-#include "WorkerContext.h"
+#include "WorkerContext.h"
namespace WebCore {
@@ -49,7 +49,8 @@ Notification::Notification(const String& url, ScriptExecutionContext* context, E
, m_presenter(provider)
{
ASSERT(m_presenter);
- if (m_presenter->checkPermission(context->securityOrigin()) != NotificationPresenter::PermissionAllowed) {
+ Document* document = context->isDocument() ? static_cast<Document*>(context) : 0;
+ if (m_presenter->checkPermission(context->url(), document) != NotificationPresenter::PermissionAllowed) {
ec = SECURITY_ERR;
return;
}
@@ -69,11 +70,12 @@ Notification::Notification(const NotificationContents& contents, ScriptExecution
, m_presenter(provider)
{
ASSERT(m_presenter);
- if (m_presenter->checkPermission(context->securityOrigin()) != NotificationPresenter::PermissionAllowed) {
+ Document* document = context->isDocument() ? static_cast<Document*>(context) : 0;
+ if (m_presenter->checkPermission(context->url(), document) != NotificationPresenter::PermissionAllowed) {
ec = SECURITY_ERR;
return;
}
-
+
KURL icon = context->completeURL(contents.icon());
if (!icon.isEmpty() && !icon.isValid()) {
ec = SYNTAX_ERR;