diff options
-rw-r--r-- | webkit/api/src/WebStorageAreaImpl.cpp | 4 | ||||
-rw-r--r-- | webkit/api/src/WebStorageAreaImpl.h | 5 | ||||
-rw-r--r-- | webkit/api/src/WebStorageNamespaceImpl.cpp | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/webkit/api/src/WebStorageAreaImpl.cpp b/webkit/api/src/WebStorageAreaImpl.cpp index 6a5a762..d7115bf 100644 --- a/webkit/api/src/WebStorageAreaImpl.cpp +++ b/webkit/api/src/WebStorageAreaImpl.cpp @@ -34,12 +34,14 @@ #if ENABLE(DOM_STORAGE) #include "ExceptionCode.h" +#include "SecurityOrigin.h" #include "WebString.h" namespace WebKit { -WebStorageAreaImpl::WebStorageAreaImpl(PassRefPtr<WebCore::StorageArea> storageArea) +WebStorageAreaImpl::WebStorageAreaImpl(PassRefPtr<WebCore::StorageArea> storageArea, PassRefPtr<WebCore::SecurityOrigin> origin) : m_storageArea(storageArea) + , m_origin(origin) { } diff --git a/webkit/api/src/WebStorageAreaImpl.h b/webkit/api/src/WebStorageAreaImpl.h index 5e5ffc4..d855360 100644 --- a/webkit/api/src/WebStorageAreaImpl.h +++ b/webkit/api/src/WebStorageAreaImpl.h @@ -40,7 +40,7 @@ namespace WebKit { class WebStorageAreaImpl : public WebStorageArea { public: - WebStorageAreaImpl(PassRefPtr<WebCore::StorageArea> storageArea); + WebStorageAreaImpl(PassRefPtr<WebCore::StorageArea> storageArea, PassRefPtr<WebCore::SecurityOrigin> origin); virtual ~WebStorageAreaImpl(); virtual void lock(bool& invalidateCache, size_t& bytesLeftInQuota); virtual void unlock(); @@ -53,6 +53,9 @@ namespace WebKit { private: RefPtr<WebCore::StorageArea> m_storageArea; + + // We must store a reference to this because m_storageArea contains a pointer to it. + RefPtr<WebCore::SecurityOrigin> m_origin; }; } // namespace WebKit diff --git a/webkit/api/src/WebStorageNamespaceImpl.cpp b/webkit/api/src/WebStorageNamespaceImpl.cpp index e6fa684..991aa2a 100644 --- a/webkit/api/src/WebStorageNamespaceImpl.cpp +++ b/webkit/api/src/WebStorageNamespaceImpl.cpp @@ -62,7 +62,7 @@ WebStorageNamespaceImpl::~WebStorageNamespaceImpl() WebStorageArea* WebStorageNamespaceImpl::createStorageArea(const WebString& originString) { RefPtr<WebCore::SecurityOrigin> origin = WebCore::SecurityOrigin::createFromString(originString); - return new WebStorageAreaImpl(m_storageNamespace->storageArea(origin.get())); + return new WebStorageAreaImpl(m_storageNamespace->storageArea(origin.get()), origin.release()); } WebStorageNamespace* WebStorageNamespaceImpl::copy() |