Bug 72628

Summary: QWebSettings::setOfflineStorageDefaultQuota has no effect
Product: WebKit Reporter: Bernhard Rosenkraenzer <bero>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: chenzx
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch none

Description Bernhard Rosenkraenzer 2011-11-17 09:53:48 PST
After trying to increase available localStorage using QWebSettings::setOfflineStorageDefaultQuota(0xffffffff);, localStorage is still limited to 5 MB.

The problem is that lower level WebKit respects the limits set with Settings::setLocalStorageQuota - which isn't accessible through the Qt API layer.
IMO the fix is for QWebSettings::setOfflineStorageDefaultQuota(x) to call Settings::setLocalStorageQuota(x). Note, however, that the former takes a 64bit value while the latter takes a 32bit value.
Comment 1 Bernhard Rosenkraenzer 2011-11-17 10:12:49 PST
Created attachment 115613 [details]
Proposed patch
Comment 2 Bernhard Rosenkraenzer 2011-11-18 02:24:29 PST
Actually the proposed patch isn't going to work with the current version anymore (it was against the version of QtWebkit shipped with Qt 4.7.4) because the localStorage quota has moved to GroupSettings, which isn't accessible to global QWebSettings.

The most reasonable thing to do seems to be adding a setLocalStorageQuota API to QWebPage - the only thing to do without breaking the existing API that I can think of would be doing d->page->group().groupSettings()->setLocalStorageQuotaBytes(QWebSettings::globalSettings()->offlineStorageDefaultQuota()) in the QWebPage constructor
Comment 3 Chen Zhixiang 2013-07-12 03:47:09 PDT
I have recently encouter the similar problem, my fix is:

1) Change the QWebSettings ctor, & make an empty WebCore::Settings object:

QWebSettings::QWebSettings()
    //: d(new QWebSettingsPrivate)
    : d(new QWebSettingsPrivate(WebCore::Settings::create(0).leakPtr()))
{
    ...

2) Change WebCore/page/Settings.cpp, add NULL-check to every m_page->xxx calls.
Comment 4 Jocelyn Turcotte 2014-02-03 03:50:52 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.