diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 06:51:15 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 06:51:15 +0000 |
commit | 75c91e64b82abaa843d9327f7b57cc9a0abe1696 (patch) | |
tree | 28e9093690edc475c7a7d69b21a90facef3d2641 /webkit/api | |
parent | 8922e1ff7ac33a3f88079e1e6d3ae8671602a952 (diff) | |
download | chromium_src-75c91e64b82abaa843d9327f7b57cc9a0abe1696.zip chromium_src-75c91e64b82abaa843d9327f7b57cc9a0abe1696.tar.gz chromium_src-75c91e64b82abaa843d9327f7b57cc9a0abe1696.tar.bz2 |
Add quota support.
Add a 5mb quota to DOM Storage. Most of the details are in an upstream patch (https://bugs.webkit.org/show_bug.cgi?id=29991 ).
BUG=16876
TEST=I added a layout test upstream and it works.
Review URL: http://codereview.chromium.org/255050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api')
-rw-r--r-- | webkit/api/public/WebKitClient.h | 6 | ||||
-rw-r--r-- | webkit/api/public/WebStorageNamespace.h | 4 | ||||
-rw-r--r-- | webkit/api/src/StorageNamespaceProxy.cpp | 2 | ||||
-rw-r--r-- | webkit/api/src/WebStorageNamespaceImpl.cpp | 5 |
4 files changed, 8 insertions, 9 deletions
diff --git a/webkit/api/public/WebKitClient.h b/webkit/api/public/WebKitClient.h index 32bd4c70..0e380048 100644 --- a/webkit/api/public/WebKitClient.h +++ b/webkit/api/public/WebKitClient.h @@ -83,10 +83,8 @@ namespace WebKit { // DOM Storage -------------------------------------------------- - // Return a LocalStorage namespace that corresponds to the following - // path. - virtual WebStorageNamespace* createLocalStorageNamespace( - const WebString& path) = 0; + // Return a LocalStorage namespace that corresponds to the following path. + virtual WebStorageNamespace* createLocalStorageNamespace(const WebString& path, unsigned quota) = 0; // Return a new SessionStorage namespace. virtual WebStorageNamespace* createSessionStorageNamespace() = 0; diff --git a/webkit/api/public/WebStorageNamespace.h b/webkit/api/public/WebStorageNamespace.h index 362e41e1..1253cec 100644 --- a/webkit/api/public/WebStorageNamespace.h +++ b/webkit/api/public/WebStorageNamespace.h @@ -46,9 +46,11 @@ namespace WebKit { // where the SQLite databases that make LocalStorage data persistent are located. // If path is empty, data will not persist. You should call delete on the returned // object when you're finished. - WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath); + WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath, unsigned quota); WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace(); + static const unsigned noQuota = UINT_MAX; + virtual ~WebStorageNamespace() { } // Create a new WebStorageArea object. Two subsequent calls with the same origin diff --git a/webkit/api/src/StorageNamespaceProxy.cpp b/webkit/api/src/StorageNamespaceProxy.cpp index 8b44f6e..e22bbef 100644 --- a/webkit/api/src/StorageNamespaceProxy.cpp +++ b/webkit/api/src/StorageNamespaceProxy.cpp @@ -39,7 +39,7 @@ namespace WebCore { PassRefPtr<StorageNamespace> StorageNamespace::localStorageNamespace(const String& path, unsigned quota) { - return new StorageNamespaceProxy(WebKit::webKitClient()->createLocalStorageNamespace(path)); + return new StorageNamespaceProxy(WebKit::webKitClient()->createLocalStorageNamespace(path, quota)); } PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace() diff --git a/webkit/api/src/WebStorageNamespaceImpl.cpp b/webkit/api/src/WebStorageNamespaceImpl.cpp index 6754d18..11d2cf3 100644 --- a/webkit/api/src/WebStorageNamespaceImpl.cpp +++ b/webkit/api/src/WebStorageNamespaceImpl.cpp @@ -34,16 +34,15 @@ #if ENABLE(DOM_STORAGE) #include "SecurityOrigin.h" -#include "StorageMap.h" #include "WebStorageAreaImpl.h" #include "WebString.h" namespace WebKit { -WebStorageNamespace* WebStorageNamespace::createLocalStorageNamespace(const WebString& path) +WebStorageNamespace* WebStorageNamespace::createLocalStorageNamespace(const WebString& path, unsigned quota) { - return new WebStorageNamespaceImpl(WebCore::StorageNamespaceImpl::localStorageNamespace(path, WebCore::StorageMap::noQuota)); + return new WebStorageNamespaceImpl(WebCore::StorageNamespaceImpl::localStorageNamespace(path, quota)); } WebStorageNamespace* WebStorageNamespace::createSessionStorageNamespace() |