summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/StorageNamespaceProxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/chromium/src/StorageNamespaceProxy.cpp')
-rw-r--r--WebKit/chromium/src/StorageNamespaceProxy.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/WebKit/chromium/src/StorageNamespaceProxy.cpp b/WebKit/chromium/src/StorageNamespaceProxy.cpp
index 1be1967..ec0dbce 100644
--- a/WebKit/chromium/src/StorageNamespaceProxy.cpp
+++ b/WebKit/chromium/src/StorageNamespaceProxy.cpp
@@ -47,11 +47,11 @@ PassRefPtr<StorageNamespace> StorageNamespace::localStorageNamespace(const Strin
return adoptRef(new StorageNamespaceProxy(WebKit::webKitClient()->createLocalStorageNamespace(path, quota), LocalStorage));
}
-PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* page)
+PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* page, unsigned quota)
{
WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(page->chrome()->client());
WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
- return adoptRef(new StorageNamespaceProxy(webViewClient->createSessionStorageNamespace(), SessionStorage));
+ return adoptRef(new StorageNamespaceProxy(webViewClient->createSessionStorageNamespace(quota), SessionStorage));
}
StorageNamespaceProxy::StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace, StorageType storageType)
@@ -67,13 +67,14 @@ StorageNamespaceProxy::~StorageNamespaceProxy()
PassRefPtr<StorageNamespace> StorageNamespaceProxy::copy()
{
ASSERT(m_storageType == SessionStorage);
- // The WebViewClient knows what its session storage namespace id is but we
- // do not. Returning 0 here causes it to be fetched (via the WebViewClient)
- // on its next use. Note that it is WebViewClient::createView's
- // responsibility to clone the session storage namespace id and that the
- // only time copy() is called is directly after the createView call...which
- // is why all of this is safe.
- return 0;
+ WebKit::WebStorageNamespace* newNamespace = m_storageNamespace->copy();
+ // Some embedders hook into WebViewClient::createView to make the copy of
+ // session storage and then return the object lazily. Other embedders
+ // choose to make the copy now and return a pointer immediately. So handle
+ // both cases.
+ if (!newNamespace)
+ return 0;
+ return adoptRef(new StorageNamespaceProxy(newNamespace, m_storageType));
}
PassRefPtr<StorageArea> StorageNamespaceProxy::storageArea(PassRefPtr<SecurityOrigin> origin)