Changeset 73789 in webkit


Ignore:
Timestamp:
Dec 10, 2010 1:01:31 PM (13 years ago)
Author:
chang.shu@nokia.com
Message:

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):
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r73756 r73789  
     12010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>
     2
     3        Reviewed by Joseph Pecoraro.
     4
     5        [Qt]: Implement Application Cache Quotas
     6        https://bugs.webkit.org/show_bug.cgi?id=43455
     7
     8        * platform/qt/Skipped: Unskip now passing test origin-quota.html
     9
    1102010-12-09  Jenn Braithwaite  <jennb@chromium.org>
    211
  • trunk/LayoutTests/platform/qt/Skipped

    r73642 r73789  
    15071507animations/animation-drt-api.html
    15081508animations/animation-drt-api-multiple-keyframes.html
    1509 
    1510 # ============================================================================= #
    1511 # failing application cache quota tests
    1512 # ============================================================================= #
    1513 http/tests/appcache/origin-quota.html
    15141509
    15151510# ============================================================================= #
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r73535 r73789  
    41224122    \sa QWebDatabase
    41234123*/
     4124/*!
     4125    \fn void QWebPage::applicationCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 defaultOriginQuota);
     4126
     4127    This signal is emitted whenever the web site is asking to store data to the application cache
     4128    database databaseName and the quota allocated to that web site is exceeded.
     4129
     4130*/
    41244131
    41254132/*!
  • trunk/WebKit/qt/Api/qwebpage.h

    r72603 r73789  
    4949class QWebPagePrivate;
    5050class QWebPluginFactory;
     51class QWebSecurityOrigin;
    5152class QtViewportAttributesPrivate;
    5253
     
    388389    void contentsChanged();
    389390    void databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
     391    void applicationCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 defaultOriginQuota);
    390392
    391393    void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
  • trunk/WebKit/qt/Api/qwebsecurityorigin.cpp

    r73002 r73789  
    2020#include "config.h"
    2121#include "qwebsecurityorigin.h"
    22 #include "qwebsecurityorigin_p.h"
    23 #include "qwebdatabase.h"
    24 #include "qwebdatabase_p.h"
    25 
     22
     23#include "ApplicationCacheStorage.h"
    2624#include "DatabaseTracker.h"
    2725#include "KURL.h"
    2826#include "SchemeRegistry.h"
    2927#include "SecurityOrigin.h"
     28#include "qwebdatabase.h"
     29#include "qwebdatabase_p.h"
     30#include "qwebsecurityorigin_p.h"
    3031#include <QStringList>
    3132
     
    153154}
    154155
     156void QWebSecurityOrigin::setApplicationCacheQuota(qint64 quota)
     157{
     158#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     159    WebCore::cacheStorage().storeUpdatedQuotaForOrigin(d->origin.get(), quota);
     160#endif
     161}
    155162/*!
    156163    Destroys the security origin.
  • trunk/WebKit/qt/Api/qwebsecurityorigin.h

    r50166 r73789  
    5252
    5353    void setDatabaseQuota(qint64 quota);
     54    void setApplicationCacheQuota(qint64 quota);
    5455
    5556    QList<QWebDatabase> databases() const;
  • trunk/WebKit/qt/ChangeLog

    r73710 r73789  
     12010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>
     2
     3        Reviewed by Joseph Pecoraro.
     4
     5        Bug 43455 - [Qt]: Implement Application Cache Quotas
     6        https://bugs.webkit.org/show_bug.cgi?id=43455
     7
     8        Added new signal to report ApplicationCache Database
     9        quota.
     10
     11        * Api/qwebpage.cpp:
     12        * Api/qwebpage.h:
     13
     14        Added new functions to accomodate new appcache layout
     15        test origin-quota.html.
     16
     17        * Api/qwebsecurityorigin.cpp:
     18        (QWebSecurityOrigin::setApplicationCacheQuota):
     19        * Api/qwebsecurityorigin.h:
     20        * WebCoreSupport/ChromeClientQt.cpp:
     21        (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota):
     22        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     23        (DumpRenderTreeSupportQt::clearAllApplicationCaches):
     24        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     25
    1262010-12-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    227
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r72954 r73789  
    3131#include "ChromeClientQt.h"
    3232
     33#include "ApplicationCacheStorage.h"
    3334#include "DatabaseTracker.h"
    3435#include "FileChooser.h"
     
    519520}
    520521
    521 void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin*)
    522 {
    523     notImplemented();
     522void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin* origin)
     523{
     524    int64_t quota;
     525    quint64 defaultOriginQuota = WebCore::cacheStorage().defaultOriginQuota();
     526
     527    QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(origin);
     528    QWebSecurityOrigin* securityOrigin = new QWebSecurityOrigin(priv);
     529
     530    if (!WebCore::cacheStorage().quotaForOrigin(origin, quota))
     531       WebCore::cacheStorage().storeUpdatedQuotaForOrigin(origin, defaultOriginQuota);
     532
     533    emit m_webPage->applicationCacheQuotaExceeded(securityOrigin, defaultOriginQuota);
    524534}
    525535#endif
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r73007 r73789  
    2424#include "DumpRenderTreeSupportQt.h"
    2525
     26#include "ApplicationCacheStorage.h"
    2627#include "CSSComputedStyleDeclaration.h"
    2728#include "ChromeClientQt.h"
     
    586587}
    587588
     589void DumpRenderTreeSupportQt::clearAllApplicationCaches()
     590{
     591#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     592    WebCore::cacheStorage().empty();
     593    WebCore::cacheStorage().vacuumDatabaseFile();
     594#endif
     595}
     596
    588597void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
    589598{
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r73007 r73789  
    8989    static void setEditingBehavior(QWebPage* page, const QString& editingBehavior);
    9090
     91    static void clearAllApplicationCaches();
     92
    9193    static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
    9294    static void removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
  • trunk/WebKitTools/ChangeLog

    r73776 r73789  
     12010-12-10  Krithigassree Sambamurthy  <krithigassree.sambamurthy@nokia.com>
     2
     3        Reviewed by Joseph Pecoraro.
     4
     5        Bug 43455 - [Qt]: Implement Application Cache Quotas
     6        https://bugs.webkit.org/show_bug.cgi?id=43455
     7
     8        Introduce functions to allow new appcache layout test origin-quota.html
     9        to work correctly under Qt.
     10
     11        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     12        (WebCore::DumpRenderTree::DumpRenderTree):
     13        (WebCore::DumpRenderTree::dumpApplicationCacheQuota):
     14        * DumpRenderTree/qt/DumpRenderTreeQt.h:
     15
     16        Introduce functions to allow new appcache layout test origin-quota.html
     17        to be successful under qt. Changes required because LayoutTestControllerQt
     18        does not inherit from LayoutController.
     19
     20        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     21        (LayoutTestController::reset):
     22        (LayoutTestController::clearAllApplicationCaches):
     23        (LayoutTestController::setApplicationCacheOriginQuota):
     24        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     25        (LayoutTestController::shouldDumpApplicationCacheDelegateCallbacks):
     26        (LayoutTestController::dumpApplicationCacheDelegateCallbacks):
     27
    1282010-12-10  Eric Seidel  <eric@webkit.org>
    229
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r73341 r73789  
    481481    connect(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)),
    482482            this, SLOT(dumpDatabaseQuota(QWebFrame*,QString)));
     483    connect(m_page, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin *, quint64)),
     484            this, SLOT(dumpApplicationCacheQuota(QWebSecurityOrigin *, quint64)));
    483485    connect(m_page, SIGNAL(statusBarMessage(const QString&)),
    484486            this, SLOT(statusBarMessage(const QString&)));
     
    10231025}
    10241026
     1027void DumpRenderTree::dumpApplicationCacheQuota(QWebSecurityOrigin* origin, quint64 defaultOriginQuota)
     1028{
     1029    if (!m_controller->shouldDumpApplicationCacheDelegateCallbacks())
     1030        return;
     1031
     1032    printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i}\n",
     1033           origin->scheme().toUtf8().data(),
     1034           origin->host().toUtf8().data(),
     1035           origin->port()
     1036           );
     1037    origin->setApplicationCacheQuota(defaultOriginQuota);
     1038}
     1039
    10251040void DumpRenderTree::statusBarMessage(const QString& message)
    10261041{
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h

    r72601 r73789  
    117117    void connectFrame(QWebFrame *frame);
    118118    void dumpDatabaseQuota(QWebFrame* frame, const QString& dbName);
     119    void dumpApplicationCacheQuota(QWebSecurityOrigin* origin, quint64 defaultOriginQuota);
    119120    void statusBarMessage(const QString& message);
    120121    void windowCloseRequested();
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r73007 r73789  
    5959    m_dumpTitleChanges = false;
    6060    m_dumpDatabaseCallbacks = false;
     61    m_dumpApplicationCacheDelegateCallbacks = false;
    6162    m_dumpStatusCallbacks = false;
    6263    m_timeoutTimer.stop();
     
    542543void LayoutTestController::clearAllApplicationCaches()
    543544{
    544     // FIXME: implement to support Application Cache quotas.
     545    DumpRenderTreeSupportQt::clearAllApplicationCaches();
    545546}
    546547
    547548void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
    548549{
    549     // FIXME: implement to support Application Cache quotas.
     550    if (!m_topLoadingFrame)
     551        return;
     552    m_topLoadingFrame->securityOrigin().setApplicationCacheQuota(quota);
    550553}
    551554
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r73007 r73789  
    6565    bool shouldDumpChildFrameScrollPositions() const { return m_dumpChildFrameScrollPositions; }
    6666    bool shouldDumpDatabaseCallbacks() const { return m_dumpDatabaseCallbacks; }
     67    bool shouldDumpApplicationCacheDelegateCallbacks() const { return m_dumpApplicationCacheDelegateCallbacks; }
    6768    bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
    6869    bool shouldWaitUntilDone() const { return m_waitForDone; }
     
    9596    void dumpChildFrameScrollPositions() { m_dumpChildFrameScrollPositions = true; }
    9697    void dumpDatabaseCallbacks() { m_dumpDatabaseCallbacks = true; }
     98    void dumpApplicationCacheDelegateCallbacks() { m_dumpApplicationCacheDelegateCallbacks = true;}
    9799    void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
    98100    void setCanOpenWindows() { m_canOpenWindows = true; }
     
    264266    bool m_dumpTitleChanges;
    265267    bool m_dumpDatabaseCallbacks;
     268    bool m_dumpApplicationCacheDelegateCallbacks;
    266269    bool m_dumpStatusCallbacks;
    267270    bool m_waitForPolicy;
Note: See TracChangeset for help on using the changeset viewer.