2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2009 13:49:29 +0000 (13:49 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2009 13:49:29 +0000 (13:49 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Enable Page Cache if setMaximumPagesInCache needs it.
        This fixes https://bugs.webkit.org/show_bug.cgi?id=31266.

        * Api/qwebsettings.cpp:
        (QWebSettingsPrivate::apply):
        (QWebSettings::setMaximumPagesInCache):
2009-11-13  Andras Becsi  <becsi.andras@stud.u-szeged.hu>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Add WebKitUsesPageCachePreferenceKey overriding support to DRT's LayoutTestController.

        * DumpRenderTree/qt/DumpRenderTree.cpp:
        (WebCore::WebPage::resetSettings):
        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::overridePreference):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50938 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/qt/Api/qwebsettings.cpp
WebKit/qt/ChangeLog
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

index 490fe92f7af969caea68b786cb00861b5af531a5..905980f2694377ddcd415d50855209f1f050abbb 100644 (file)
@@ -198,6 +198,7 @@ void QWebSettingsPrivate::apply()
         value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls,
                                       global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
         settings->setAllowUniversalAccessFromFileURLs(value);
+        settings->setUsesPageCache(WebCore::pageCache()->capacity());
     } else {
         QList<QWebSettingsPrivate*> settings = *::allSettings();
         for (int i = 0; i < settings.count(); ++i)
@@ -640,7 +641,9 @@ void QWebSettings::clearMemoryCaches()
 */
 void QWebSettings::setMaximumPagesInCache(int pages)
 {
+    QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
     WebCore::pageCache()->setCapacity(qMax(0, pages));
+    global->apply();
 }
 
 /*!
index 886ec287fa6e19ec0865971062275da34d6053c7..611b123eb04090bfb9e07b2f9cd570f4c11c6f51 100644 (file)
@@ -1,3 +1,14 @@
+2009-11-13  Andras Becsi  <becsi.andras@stud.u-szeged.hu>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Enable Page Cache if setMaximumPagesInCache needs it.
+        This fixes https://bugs.webkit.org/show_bug.cgi?id=31266.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        (QWebSettings::setMaximumPagesInCache):
+
 2009-11-13  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 61dbe311f1850fe3bcbedf9f9405f899a5d889d2..d9de3fe7977004b838d9a13f3ddfba9fa2246971 100644 (file)
@@ -1,3 +1,14 @@
+2009-11-13  Andras Becsi  <becsi.andras@stud.u-szeged.hu>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Add WebKitUsesPageCachePreferenceKey overriding support to DRT's LayoutTestController.
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+        (WebCore::WebPage::resetSettings):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::overridePreference):
+
 2009-11-13  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Adam Barth.
index 94ed867e8e9113e4ad057dc5c59c6073108e64ff..9b6b985fedcb4239b97d326c6902743700bb2d2c 100644 (file)
@@ -140,12 +140,12 @@ void WebPage::resetSettings()
     // layoutTestController.overridePreference() or similar.
 
     settings()->resetFontSize(QWebSettings::DefaultFontSize);
-
     settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows);
     settings()->resetAttribute(QWebSettings::JavascriptEnabled);
     settings()->resetAttribute(QWebSettings::PrivateBrowsingEnabled);
     settings()->resetAttribute(QWebSettings::LinksIncludedInFocusChain);
     settings()->resetAttribute(QWebSettings::OfflineWebApplicationCacheEnabled);
+    QWebSettings::setMaximumPagesInCache(0); // reset to default
 }
 
 QWebPage *WebPage::createWindow(QWebPage::WebWindowType)
index 8311d919539c52e5ea6392a829ded6575252484a..ef574bde17fa98db778891e7589d8a485cedeffb 100644 (file)
@@ -326,4 +326,6 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian
         settings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, value.toBool());
     else if (name == "WebKitDefaultFontSize")
         settings->setFontSize(QWebSettings::DefaultFontSize, value.toInt());
+    else if (name == "WebKitUsesPageCachePreferenceKey")
+        QWebSettings::setMaximumPagesInCache(value.toInt());
 }