[Webkit-unassigned] [Bug 31266] [Qt] QWebSettings::setMaximumPagesInCache(int pages) does not enable the Page Cache

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 11 13:05:22 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=31266





--- Comment #13 from Simon Hausmann <hausmann at webkit.org>  2009-11-11 13:05:21 PST ---
(In reply to comment #11)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > Created an attachment (id=42961)
 --> (https://bugs.webkit.org/attachment.cgi?id=42961) [details] [details] [details]
> > > proposed patch
> > > 
> > > Without adding a new QWebSetting enum value it did not enable the global cache,
> > > so I needed to add one, but there are no new functions so no API change.
> > 
> > Unfortunately adding a new enum is an API change (although admitadely not on a
> > binary level).
> > 
> > Can't we simply enable the cache if there is a maximum set and disable it if
> > the maximum is zero?
> 
> Well, I experimented with it for two days now and the only way we can access
> the platform independent global Settings object now is through
> QWebSettings::globalSettings()->d which is a QWebSettingsPrivate* and has a
> WebCore::Settings* member named settings. I tried to set the page cache
> directly with QWebSettings::globalSettings()->d->settings->setUsesPage(qMax(0,
> pages)) but this caused DRT to crash on tests which want to override the usage
> of the cache, because setMaximumPagesInCache is static and the settings member
> of the singleton didn't get initialized. So I suppose settings was not meant to
> be called directly but indirectly through d->apply(). This probably will need a
> refactoring soon since it seems to be much of hiding which might cause
> performance issues. 
> I will try to work around this for Qt 4.6, it will probably be ugly but policy
> is policy.
> After release I will try to refactor this apply in a more elegant way.

Thanks Andras!

I agree it's ugly. I would suggest in apply() to simply look at
WebCore::pageCache()->capacity() to decide whether to enable or disable the
page cache in the WebCore::Settings object.

Then you can call apply() from setMaximumPagesInCache.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list