diff options
Diffstat (limited to 'WebCore/page/DOMWindow.cpp')
-rw-r--r-- | WebCore/page/DOMWindow.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index c74cfaf..633feb6 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -58,7 +58,7 @@ #include "InspectorController.h" #include "InspectorTimelineAgent.h" #include "Location.h" -#include "Media.h" +#include "StyleMedia.h" #include "MessageEvent.h" #include "Navigator.h" #include "NotificationCenter.h" @@ -575,7 +575,7 @@ Location* DOMWindow::location() const } #if ENABLE(DOM_STORAGE) -Storage* DOMWindow::sessionStorage() const +Storage* DOMWindow::sessionStorage(ExceptionCode& ec) const { if (m_sessionStorage) return m_sessionStorage.get(); @@ -584,6 +584,11 @@ Storage* DOMWindow::sessionStorage() const if (!document) return 0; + if (!document->securityOrigin()->canAccessLocalStorage()) { + ec = SECURITY_ERR; + return 0; + } + Page* page = document->page(); if (!page) return 0; @@ -601,16 +606,16 @@ Storage* DOMWindow::localStorage(ExceptionCode& ec) const { if (m_localStorage) return m_localStorage.get(); - + Document* document = this->document(); if (!document) return 0; - + if (!document->securityOrigin()->canAccessLocalStorage()) { ec = SECURITY_ERR; return 0; } - + Page* page = document->page(); if (!page) return 0; @@ -1136,10 +1141,10 @@ Document* DOMWindow::document() const return m_frame->document(); } -PassRefPtr<Media> DOMWindow::media() const +PassRefPtr<StyleMedia> DOMWindow::styleMedia() const { if (!m_media) - m_media = Media::create(m_frame); + m_media = StyleMedia::create(m_frame); return m_media.get(); } |