Commit eff3dea4 authored by chang.shu@nokia.com's avatar chang.shu@nokia.com

2010-12-10 Krithigassree Sambamurthy <krithigassree.sambamurthy@nokia.com>

        Reviewed by Joseph Pecoraro.

        Bug 43455 - [Qt]: Implement Application Cache Quotas
        https://bugs.webkit.org/show_bug.cgi?id=43455

        Added new signal to report ApplicationCache Database
        quota.

        * Api/qwebpage.cpp:
        * Api/qwebpage.h:

        Added new functions to accomodate new appcache layout
        test origin-quota.html.

        * Api/qwebsecurityorigin.cpp:
        (QWebSecurityOrigin::setApplicationCacheQuota):
        * Api/qwebsecurityorigin.h:
        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota):
        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
        (DumpRenderTreeSupportQt::clearAllApplicationCaches):
        * WebCoreSupport/DumpRenderTreeSupportQt.h:

2010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>

        Reviewed by Joseph Pecoraro.

        [Qt]: Implement Application Cache Quotas
        https://bugs.webkit.org/show_bug.cgi?id=43455

        * platform/qt/Skipped: Unskip now passing test origin-quota.html

2010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>

        Reviewed by Joseph Pecoraro.

        Bug 43455 - [Qt]: Implement Application Cache Quotas
        https://bugs.webkit.org/show_bug.cgi?id=43455

        Introduce functions to allow new appcache layout test origin-quota.html
        to work correctly under Qt.

        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
        (WebCore::DumpRenderTree::DumpRenderTree):
        (WebCore::DumpRenderTree::dumpApplicationCacheQuota):
        * DumpRenderTree/qt/DumpRenderTreeQt.h:

        Introduce functions to allow new appcache layout test origin-quota.html
        to be successful under qt. Changes required because LayoutTestControllerQt
        does not inherit from LayoutController.

        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::reset):
        (LayoutTestController::clearAllApplicationCaches):
        (LayoutTestController::setApplicationCacheOriginQuota):
        * DumpRenderTree/qt/LayoutTestControllerQt.h:
        (LayoutTestController::shouldDumpApplicationCacheDelegateCallbacks):
        (LayoutTestController::dumpApplicationCacheDelegateCallbacks):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0187ea8d
2010-12-10 Krithigassree Sambamurthy <krithigassree.sambamurthy@nokia.com>
Reviewed by Joseph Pecoraro.
[Qt]: Implement Application Cache Quotas
https://bugs.webkit.org/show_bug.cgi?id=43455
* platform/qt/Skipped: Unskip now passing test origin-quota.html
2010-12-09 Jenn Braithwaite <jennb@chromium.org>
Reviewed by Adam Barth.
......
......@@ -1507,11 +1507,6 @@ svg/hixie/mixed/007.xml
animations/animation-drt-api.html
animations/animation-drt-api-multiple-keyframes.html
# ============================================================================= #
# failing application cache quota tests
# ============================================================================= #
http/tests/appcache/origin-quota.html
# ============================================================================= #
# Failing CSS Tests
# ============================================================================= #
......
......@@ -4121,6 +4121,13 @@ quint64 QWebPage::bytesReceived() const
\sa QWebDatabase
*/
/*!
\fn void QWebPage::applicationCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 defaultOriginQuota);
This signal is emitted whenever the web site is asking to store data to the application cache
database databaseName and the quota allocated to that web site is exceeded.
*/
/*!
\since 4.5
......
......@@ -48,6 +48,7 @@ class QWebHitTestResult;
class QWebNetworkInterface;
class QWebPagePrivate;
class QWebPluginFactory;
class QWebSecurityOrigin;
class QtViewportAttributesPrivate;
namespace WebCore {
......@@ -387,6 +388,7 @@ Q_SIGNALS:
void microFocusChanged();
void contentsChanged();
void databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
void applicationCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 defaultOriginQuota);
void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
void restoreFrameStateRequested(QWebFrame* frame);
......
......@@ -19,14 +19,15 @@
#include "config.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
#include "qwebdatabase.h"
#include "qwebdatabase_p.h"
#include "ApplicationCacheStorage.h"
#include "DatabaseTracker.h"
#include "KURL.h"
#include "SchemeRegistry.h"
#include "SecurityOrigin.h"
#include "qwebdatabase.h"
#include "qwebdatabase_p.h"
#include "qwebsecurityorigin_p.h"
#include <QStringList>
using namespace WebCore;
......@@ -152,6 +153,12 @@ void QWebSecurityOrigin::setDatabaseQuota(qint64 quota)
#endif
}
void QWebSecurityOrigin::setApplicationCacheQuota(qint64 quota)
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
WebCore::cacheStorage().storeUpdatedQuotaForOrigin(d->origin.get(), quota);
#endif
}
/*!
Destroys the security origin.
*/
......
......@@ -51,6 +51,7 @@ public:
qint64 databaseQuota() const;
void setDatabaseQuota(qint64 quota);
void setApplicationCacheQuota(qint64 quota);
QList<QWebDatabase> databases() const;
......
2010-12-10 Krithigassree Sambamurthy <krithigassree.sambamurthy@nokia.com>
Reviewed by Joseph Pecoraro.
Bug 43455 - [Qt]: Implement Application Cache Quotas
https://bugs.webkit.org/show_bug.cgi?id=43455
Added new signal to report ApplicationCache Database
quota.
* Api/qwebpage.cpp:
* Api/qwebpage.h:
Added new functions to accomodate new appcache layout
test origin-quota.html.
* Api/qwebsecurityorigin.cpp:
(QWebSecurityOrigin::setApplicationCacheQuota):
* Api/qwebsecurityorigin.h:
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota):
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::clearAllApplicationCaches):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
2010-12-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -30,6 +30,7 @@
#include "config.h"
#include "ChromeClientQt.h"
#include "ApplicationCacheStorage.h"
#include "DatabaseTracker.h"
#include "FileChooser.h"
#include "Frame.h"
......@@ -518,9 +519,18 @@ void ChromeClientQt::reachedMaxAppCacheSize(int64_t)
notImplemented();
}
void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin*)
void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin* origin)
{
notImplemented();
int64_t quota;
quint64 defaultOriginQuota = WebCore::cacheStorage().defaultOriginQuota();
QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(origin);
QWebSecurityOrigin* securityOrigin = new QWebSecurityOrigin(priv);
if (!WebCore::cacheStorage().quotaForOrigin(origin, quota))
WebCore::cacheStorage().storeUpdatedQuotaForOrigin(origin, defaultOriginQuota);
emit m_webPage->applicationCacheQuotaExceeded(securityOrigin, defaultOriginQuota);
}
#endif
......
......@@ -23,6 +23,7 @@
#include "config.h"
#include "DumpRenderTreeSupportQt.h"
#include "ApplicationCacheStorage.h"
#include "CSSComputedStyleDeclaration.h"
#include "ChromeClientQt.h"
#include "ContextMenu.h"
......@@ -585,6 +586,14 @@ void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString&
corePage->settings()->setEditingBehaviorType(coreEditingBehavior);
}
void DumpRenderTreeSupportQt::clearAllApplicationCaches()
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
WebCore::cacheStorage().empty();
WebCore::cacheStorage().vacuumDatabaseFile();
#endif
}
void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
{
FrameLoaderClientQt::dumpFrameLoaderCallbacks = b;
......
......@@ -88,6 +88,8 @@ public:
static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId);
static void setEditingBehavior(QWebPage* page, const QString& editingBehavior);
static void clearAllApplicationCaches();
static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
static void removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
static void resetOriginAccessWhiteLists();
......
2010-12-10 Krithigassree Sambamurthy <krithigassree.sambamurthy@nokia.com>
Reviewed by Joseph Pecoraro.
Bug 43455 - [Qt]: Implement Application Cache Quotas
https://bugs.webkit.org/show_bug.cgi?id=43455
Introduce functions to allow new appcache layout test origin-quota.html
to work correctly under Qt.
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::dumpApplicationCacheQuota):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
Introduce functions to allow new appcache layout test origin-quota.html
to be successful under qt. Changes required because LayoutTestControllerQt
does not inherit from LayoutController.
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::reset):
(LayoutTestController::clearAllApplicationCaches):
(LayoutTestController::setApplicationCacheOriginQuota):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
(LayoutTestController::shouldDumpApplicationCacheDelegateCallbacks):
(LayoutTestController::dumpApplicationCacheDelegateCallbacks):
2010-12-10 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
......
......@@ -480,6 +480,8 @@ DumpRenderTree::DumpRenderTree()
SLOT(titleChanged(const QString&)));
connect(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)),
this, SLOT(dumpDatabaseQuota(QWebFrame*,QString)));
connect(m_page, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin *, quint64)),
this, SLOT(dumpApplicationCacheQuota(QWebSecurityOrigin *, quint64)));
connect(m_page, SIGNAL(statusBarMessage(const QString&)),
this, SLOT(statusBarMessage(const QString&)));
......@@ -1022,6 +1024,19 @@ void DumpRenderTree::dumpDatabaseQuota(QWebFrame* frame, const QString& dbName)
origin.setDatabaseQuota(5 * 1024 * 1024);
}
void DumpRenderTree::dumpApplicationCacheQuota(QWebSecurityOrigin* origin, quint64 defaultOriginQuota)
{
if (!m_controller->shouldDumpApplicationCacheDelegateCallbacks())
return;
printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i}\n",
origin->scheme().toUtf8().data(),
origin->host().toUtf8().data(),
origin->port()
);
origin->setApplicationCacheQuota(defaultOriginQuota);
}
void DumpRenderTree::statusBarMessage(const QString& message)
{
if (!m_controller->shouldDumpStatusCallbacks())
......
......@@ -116,6 +116,7 @@ public Q_SLOTS:
void titleChanged(const QString &s);
void connectFrame(QWebFrame *frame);
void dumpDatabaseQuota(QWebFrame* frame, const QString& dbName);
void dumpApplicationCacheQuota(QWebSecurityOrigin* origin, quint64 defaultOriginQuota);
void statusBarMessage(const QString& message);
void windowCloseRequested();
......
......@@ -58,6 +58,7 @@ void LayoutTestController::reset()
m_waitForDone = false;
m_dumpTitleChanges = false;
m_dumpDatabaseCallbacks = false;
m_dumpApplicationCacheDelegateCallbacks = false;
m_dumpStatusCallbacks = false;
m_timeoutTimer.stop();
m_topLoadingFrame = 0;
......@@ -541,12 +542,14 @@ void LayoutTestController::dispatchPendingLoadRequests()
void LayoutTestController::clearAllApplicationCaches()
{
// FIXME: implement to support Application Cache quotas.
DumpRenderTreeSupportQt::clearAllApplicationCaches();
}
void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
{
// FIXME: implement to support Application Cache quotas.
if (!m_topLoadingFrame)
return;
m_topLoadingFrame->securityOrigin().setApplicationCacheQuota(quota);
}
void LayoutTestController::setDatabaseQuota(int size)
......
......@@ -64,6 +64,7 @@ public:
bool shouldDumpChildrenAsText() const { return m_dumpChildrenAsText; }
bool shouldDumpChildFrameScrollPositions() const { return m_dumpChildFrameScrollPositions; }
bool shouldDumpDatabaseCallbacks() const { return m_dumpDatabaseCallbacks; }
bool shouldDumpApplicationCacheDelegateCallbacks() const { return m_dumpApplicationCacheDelegateCallbacks; }
bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
bool shouldWaitUntilDone() const { return m_waitForDone; }
bool shouldHandleErrorPages() const { return m_handleErrorPages; }
......@@ -94,6 +95,7 @@ public slots:
void dumpChildFramesAsText() { m_dumpChildrenAsText = true; }
void dumpChildFrameScrollPositions() { m_dumpChildFrameScrollPositions = true; }
void dumpDatabaseCallbacks() { m_dumpDatabaseCallbacks = true; }
void dumpApplicationCacheDelegateCallbacks() { m_dumpApplicationCacheDelegateCallbacks = true;}
void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
void setCanOpenWindows() { m_canOpenWindows = true; }
void setPrinting() { m_isPrinting = true; }
......@@ -263,6 +265,7 @@ private:
bool m_waitForDone;
bool m_dumpTitleChanges;
bool m_dumpDatabaseCallbacks;
bool m_dumpApplicationCacheDelegateCallbacks;
bool m_dumpStatusCallbacks;
bool m_waitForPolicy;
bool m_handleErrorPages;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment