From 68c50e5a858c0ec0c06abebaef0fca939f76861d Mon Sep 17 00:00:00 2001 From: "satish@chromium.org" Date: Wed, 12 May 2010 11:14:39 +0000 Subject: Pass quota parameter to WebStorageNamespace::createSessionStorageNamespace(). Put a per-origin quota on session storage since it is using memory in the browser process, and should not be allowed to grow arbitrarily large. Landing on behalf of hans@chromium.org from http://codereview.chromium.org/1998003/show BUG=42740 TEST=none Review URL: http://codereview.chromium.org/1995014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47020 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/tools/layout_tests/test_expectations.txt | 2 +- webkit/tools/test_shell/test_shell_webkit_init.h | 3 ++- webkit/tools/test_shell/test_webview_delegate.cc | 7 +++++-- webkit/tools/test_shell/test_webview_delegate.h | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'webkit') diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index fa10140..2546c17 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -5,4 +5,4 @@ // Only add expectations here to temporarily suppress messages on the bots // until the changes can be landed upstream. - +BUG42740 : storage/domstorage/quota.html = TEXT diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h index 9158f16..55f308f 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.h +++ b/webkit/tools/test_shell/test_shell_webkit_init.h @@ -198,8 +198,9 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { virtual WebKit::WebStorageNamespace* createLocalStorageNamespace( const WebKit::WebString& path, unsigned quota) { + // Enforce quota here, ignoring the value from the renderer as in Chrome. return WebKit::WebStorageNamespace::createLocalStorageNamespace(path, - quota); + WebKit::WebStorageNamespace::m_localStorageQuota); } void dispatchStorageEvent(const WebKit::WebString& key, diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 169412e..6e5c8ce 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -333,8 +333,11 @@ WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { return shell_->CreatePopupWidget(); } -WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace() { - return WebKit::WebStorageNamespace::createSessionStorageNamespace(); +WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( + unsigned quota) { + // Enforce quota, ignoring the parameter from WebCore as in Chrome. + return WebKit::WebStorageNamespace::createSessionStorageNamespace( + WebStorageNamespace::m_sessionStorageQuota); } void TestWebViewDelegate::didAddMessageToConsole( diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index cdf0060..e2b36c77 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -84,7 +84,8 @@ class TestWebViewDelegate : public WebKit::WebViewClient, virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); virtual WebKit::WebWidget* createPopupMenu( const WebKit::WebPopupMenuInfo& info); - virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(); + virtual WebKit::WebStorageNamespace* createSessionStorageNamespace( + unsigned quota); virtual void didAddMessageToConsole( const WebKit::WebConsoleMessage& message, const WebKit::WebString& source_name, unsigned source_line); -- cgit v1.1