Changeset 64400 in webkit


Ignore:
Timestamp:
Jul 30, 2010 7:22:45 PM (14 years ago)
Author:
Joseph Pecoraro
Message:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by David Kilzer.

WebCore:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Part 4 - Client Notification when the Quota is Reached

Notify the WebKit client when the per-origin quota is reached
via a delegate method reachedApplicationCacheOriginQuota.

Call the delegate method when the quota is reached.

  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::ApplicationCacheGroup): (WebCore::ApplicationCacheGroup::didFinishLoading): (WebCore::ApplicationCacheGroup::didReachOriginQuota): (WebCore::ApplicationCacheGroup::cacheUpdateFailedDueToOriginQuota): (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): (WebCore::ApplicationCacheGroup::scheduleReachedOriginQuotaCallback):
  • loader/appcache/ApplicationCacheGroup.h:

Some minor refactoring to access more quota information
without repeating code. Such as origin usage, and creating
an origin record.

  • loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::usageForOrigin): (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::ensureOriginRecord):
  • loader/appcache/ApplicationCacheStorage.h:

Boilerplate. Exports and definition of the delegate method.

  • WebCore.OfflineWebApplications.exp:
  • loader/EmptyClients.h: (WebCore::EmptyChromeClient::reachedApplicationCacheOriginQuota):
  • page/ChromeClient.h:

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

WebKit:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebKit.xcodeproj/project.pbxproj:
  • efl/WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::reachedApplicationCacheOriginQuota):
  • efl/WebCoreSupport/ChromeClientEfl.h:

WebKit/chromium:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::reachedApplicationCacheOriginQuota):
  • src/ChromeClientImpl.h:

WebKit/gtk:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::reachedApplicationCacheOriginQuota):
  • WebCoreSupport/ChromeClientGtk.h:

WebKit/haiku:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebCoreSupport/ChromeClientHaiku.cpp: (WebCore::ChromeClientWx::reachedApplicationCacheOriginQuota):
  • WebCoreSupport/ChromeClientHaiku.h:

WebKit/mac:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Part 4 - Client Notification when the Quota is Reached

Notify the WebKit client when the per-origin quota is reached
via a delegate method reachedApplicationCacheOriginQuota.

Refactor the WebSecurityOrigin class to be generic enough to
allow quota management of both Databases or Application Caches
via subclasses.

  • Storage/WebDatabaseSecurityOrigin.h: Added.
  • Storage/WebDatabaseSecurityOrigin.mm: Added. (-[WebDatabaseSecurityOrigin quota]): (-[WebDatabaseSecurityOrigin setQuota:]):
  • WebCoreSupport/WebApplicationCacheSecurityOrigin.h: Added.
  • WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: Added. (-[WebApplicationCacheSecurityOrigin quota]): (-[WebApplicationCacheSecurityOrigin setQuota:]):
  • Storage/WebSecurityOrigin.mm: Removed. (Moved to WebCoreSupport)
  • Storage/WebSecurityOriginPrivate.h: Removed. (Moved to WebCoreSupport)
  • WebCoreSupport/WebSecurityOrigin.mm: Added. (-[WebSecurityOrigin usage]): to be implemented by subclasses. (-[WebSecurityOrigin quota]): to be implemented by subclasses. (-[WebSecurityOrigin setQuota:]): to be implemented by subclasses.
  • WebCoreSupport/WebSecurityOriginInternal.h: Renamed from WebKit/mac/Storage/WebSecurityOriginInternal.h.
  • WebCoreSupport/WebSecurityOriginPrivate.h: Added.

Turn the notification into a WebUI Delegate to call. Following
the example of Databases.

  • DefaultDelegates/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:]):
  • WebCoreSupport/WebChromeClient.h:
  • WebCoreSupport/WebChromeClient.mm: (WebChromeClient::exceededDatabaseQuota): use the Databases Security Origin subclass. (WebChromeClient::reachedApplicationCacheOriginQuota): use the Application Cache Security Origin subclass.
  • WebView/WebUIDelegatePrivate.h:

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

WebKit/qt:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota):
  • WebCoreSupport/ChromeClientQt.h:

WebKit/win:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::reachedApplicationCacheOriginQuota):
  • WebCoreSupport/WebChromeClient.h:

WebKit/wx:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebKitSupport/ChromeClientWx.cpp: (WebCore::ChromeClientWx::reachedApplicationCacheOriginQuota):
  • WebKitSupport/ChromeClientWx.h:

WebKit2:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
https://bugs.webkit.org/show_bug.cgi?id=40627

  • WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
  • WebProcess/WebCoreSupport/WebChromeClient.h:
Location:
trunk
Files:
4 added
39 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64399 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        Part 4 - Client Notification when the Quota is Reached
     9
     10        Notify the WebKit client when the per-origin quota is reached
     11        via a delegate method reachedApplicationCacheOriginQuota.
     12
     13          Call the delegate method when the quota is reached.
     14
     15        * loader/appcache/ApplicationCacheGroup.cpp:
     16        (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
     17        (WebCore::ApplicationCacheGroup::didFinishLoading):
     18        (WebCore::ApplicationCacheGroup::didReachOriginQuota):
     19        (WebCore::ApplicationCacheGroup::cacheUpdateFailedDueToOriginQuota):
     20        (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
     21        (WebCore::ApplicationCacheGroup::scheduleReachedOriginQuotaCallback):
     22        * loader/appcache/ApplicationCacheGroup.h:
     23
     24          Some minor refactoring to access more quota information
     25          without repeating code. Such as origin usage, and creating
     26          an origin record.
     27
     28        * loader/appcache/ApplicationCacheStorage.cpp:
     29        (WebCore::ApplicationCacheStorage::usageForOrigin):
     30        (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
     31        (WebCore::ApplicationCacheStorage::store):
     32        (WebCore::ApplicationCacheStorage::ensureOriginRecord):
     33        * loader/appcache/ApplicationCacheStorage.h:
     34
     35          Boilerplate. Exports and definition of the delegate method.
     36
     37        * WebCore.OfflineWebApplications.exp:
     38        * loader/EmptyClients.h:
     39        (WebCore::EmptyChromeClient::reachedApplicationCacheOriginQuota):
     40        * page/ChromeClient.h:
     41
    1422010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
    243
  • trunk/WebCore/WebCore.exp.in

    r64397 r64400  
    14661466
    14671467#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     1468__ZN7WebCore23ApplicationCacheStorage14quotaForOriginEPKNS_14SecurityOriginERx
    14681469__ZN7WebCore23ApplicationCacheStorage14setMaximumSizeEx
     1470__ZN7WebCore23ApplicationCacheStorage14usageForOriginEPKNS_14SecurityOriginERx
    14691471__ZN7WebCore23ApplicationCacheStorage16storeCopyOfCacheERKNS_6StringEPNS_20ApplicationCacheHostE
    14701472__ZN7WebCore23ApplicationCacheStorage17setCacheDirectoryERKNS_6StringE
    14711473__ZN7WebCore23ApplicationCacheStorage18vacuumDatabaseFileEv
    14721474__ZN7WebCore23ApplicationCacheStorage21setDefaultOriginQuotaEx
     1475__ZN7WebCore23ApplicationCacheStorage26storeUpdatedQuotaForOriginEPKNS_14SecurityOriginEx
     1476__ZN7WebCore23ApplicationCacheStorage36remainingSizeForOriginExcludingCacheEPKNS_14SecurityOriginEPNS_16ApplicationCacheERx
    14731477__ZN7WebCore23ApplicationCacheStorage5emptyEv
    14741478__ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv
  • trunk/WebCore/loader/EmptyClients.h

    r64389 r64400  
    2929
    3030#include "ChromeClient.h"
     31#include "Console.h"
    3132#include "ContextMenuClient.h"
    32 #include "Console.h"
    3333#include "DocumentLoader.h"
    3434#include "DragClient.h"
     
    142142#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    143143    virtual void reachedMaxAppCacheSize(int64_t) { }
     144    virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*) { }
    144145#endif
    145146
  • trunk/WebCore/loader/appcache/ApplicationCacheGroup.cpp

    r64399 r64400  
    7272    , m_loadedSize(0)
    7373    , m_availableSpaceInQuota(ApplicationCacheStorage::unknownQuota())
     74    , m_originQuotaReached(false)
    7475{
    7576}
     
    625626    if (m_availableSpaceInQuota < m_loadedSize) {
    626627        m_currentResource = 0;
    627         cacheUpdateFailed();
     628        cacheUpdateFailedDueToOriginQuota();
    628629        return;
    629630    }
     
    793794}
    794795
     796void ApplicationCacheGroup::didReachOriginQuota(PassRefPtr<Frame> frame)
     797{
     798    // Inform the client the origin quota has been reached,
     799    // they may decide to increase the quota.
     800    frame->page()->chrome()->client()->reachedApplicationCacheOriginQuota(m_origin.get());
     801}
     802
    795803void ApplicationCacheGroup::cacheUpdateFailed()
    796804{
     
    801809    m_completionType = Failure;
    802810    deliverDelayedMainResources();
     811}
     812
     813void ApplicationCacheGroup::cacheUpdateFailedDueToOriginQuota()
     814{
     815    if (!m_originQuotaReached) {
     816        m_originQuotaReached = true;
     817        scheduleReachedOriginQuotaCallback();
     818    }
     819
     820    cacheUpdateFailed();
    803821}
    804822   
     
    895913            // Fire the success event.
    896914            postListenerTask(isUpgradeAttempt ? ApplicationCacheHost::UPDATEREADY_EVENT : ApplicationCacheHost::CACHED_EVENT, m_associatedDocumentLoaders);
     915            // It is clear that the origin quota was not reached, so clear the flag if it was set.
     916            m_originQuotaReached = false;
    897917        } else {
    898918            if (failureReason == ApplicationCacheStorage::OriginQuotaReached) {
     
    900920                if (oldNewestCache)
    901921                    setNewestCache(oldNewestCache.release());
    902                 cacheUpdateFailed();
     922                cacheUpdateFailedDueToOriginQuota();
    903923                return;
    904924            }
     
    10601080};
    10611081
     1082class OriginQuotaReachedCallbackTimer: public TimerBase {
     1083public:
     1084    OriginQuotaReachedCallbackTimer(ApplicationCacheGroup* cacheGroup, Frame* frame)
     1085        : m_cacheGroup(cacheGroup)
     1086        , m_frame(frame)
     1087    {
     1088    }
     1089
     1090private:
     1091    virtual void fired()
     1092    {
     1093        m_cacheGroup->didReachOriginQuota(m_frame.release());
     1094        delete this;
     1095    }
     1096
     1097    ApplicationCacheGroup* m_cacheGroup;
     1098    RefPtr<Frame> m_frame;
     1099};
     1100
    10621101void ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback()
    10631102{
    10641103    ASSERT(isMainThread());
    10651104    ChromeClientCallbackTimer* timer = new ChromeClientCallbackTimer(this);
     1105    timer->startOneShot(0);
     1106    // The timer will delete itself once it fires.
     1107}
     1108
     1109void ApplicationCacheGroup::scheduleReachedOriginQuotaCallback()
     1110{
     1111    ASSERT(isMainThread());
     1112    RefPtr<Frame> frameProtector = m_frame;
     1113    OriginQuotaReachedCallbackTimer* timer = new OriginQuotaReachedCallbackTimer(this, frameProtector.get());
    10661114    timer->startOneShot(0);
    10671115    // The timer will delete itself once it fires.
  • trunk/WebCore/loader/appcache/ApplicationCacheGroup.h

    r64398 r64400  
    101101
    102102    void scheduleReachedMaxAppCacheSizeCallback();
     103    void scheduleReachedOriginQuotaCallback();
    103104
    104105    PassRefPtr<ResourceHandle> createResourceHandle(const KURL&, ApplicationCacheResource* newestCachedResource);
     
    120121    void didFinishLoadingManifest();
    121122    void didReachMaxAppCacheSize();
     123    void didReachOriginQuota(PassRefPtr<Frame> frame);
    122124   
    123125    void startLoadingEntry();
     
    125127    void checkIfLoadIsComplete();
    126128    void cacheUpdateFailed();
     129    void cacheUpdateFailedDueToOriginQuota();
    127130    void manifestNotFound();
    128131   
     
    200203    int64_t m_loadedSize;
    201204    int64_t m_availableSpaceInQuota;
     205    bool m_originQuotaReached;
    202206
    203207    friend class ChromeClientCallbackTimer;
     208    friend class OriginQuotaReachedCallbackTimer;
    204209};
    205210
  • trunk/WebCore/loader/appcache/ApplicationCacheStorage.cpp

    r64399 r64400  
    444444}
    445445
     446bool ApplicationCacheStorage::usageForOrigin(const SecurityOrigin* origin, int64_t& usage)
     447{
     448    // If an Origins record doesn't exist, then the SUM will be null,
     449    // which will become 0, as expected, when converting to a number.
     450    SQLiteStatement statement(m_database, "SELECT SUM(Caches.size)"
     451                                          "  FROM CacheGroups"
     452                                          " INNER JOIN Origins ON CacheGroups.origin = Origins.origin"
     453                                          " INNER JOIN Caches ON CacheGroups.id = Caches.cacheGroup"
     454                                          " WHERE Origins.origin=?");
     455    if (statement.prepare() != SQLResultOk)
     456        return false;
     457
     458    statement.bindText(1, origin->databaseIdentifier());
     459    int result = statement.step();
     460
     461    if (result == SQLResultRow) {
     462        usage = statement.getColumnInt64(0);
     463        return true;
     464    }
     465
     466    LOG_ERROR("Could not get the quota of an origin, error \"%s\"", m_database.lastErrorMsg());
     467    return false;
     468}
     469
    446470bool ApplicationCacheStorage::remainingSizeForOriginExcludingCache(const SecurityOrigin* origin, ApplicationCache* cache, int64_t& remainingSize)
    447471{
     
    499523        return false;
    500524
     525    if (!ensureOriginRecord(origin))
     526        return false;
     527
    501528    SQLiteStatement updateStatement(m_database, "UPDATE Origins SET quota=? WHERE origin=?");
    502529    if (updateStatement.prepare() != SQLResultOk)
     
    626653        return false;
    627654
    628     String originIdentifier = group->origin()->databaseIdentifier();
    629 
    630655    statement.bindInt64(1, urlHostHash(group->manifestURL()));
    631656    statement.bindText(2, group->manifestURL());
    632     statement.bindText(3, originIdentifier);
     657    statement.bindText(3, group->origin()->databaseIdentifier());
    633658
    634659    if (!executeStatement(statement))
    635660        return false;
    636661
    637     // Create Origin if needed.
    638     {
    639         SQLiteStatement insertOriginStatement(m_database, "INSERT INTO Origins (origin, quota) VALUES (?, ?)");
    640         if (insertOriginStatement.prepare() != SQLResultOk)
    641             return false;
    642 
    643         insertOriginStatement.bindText(1, originIdentifier);
    644         insertOriginStatement.bindInt64(2, m_defaultOriginQuota);
    645         if (!executeStatement(insertOriginStatement))
    646             return false;
    647     }
     662    if (!ensureOriginRecord(group->origin()))
     663        return false;
    648664
    649665    group->setStorageID(static_cast<unsigned>(m_database.lastInsertRowID()));
     
    859875}
    860876
     877bool ApplicationCacheStorage::ensureOriginRecord(const SecurityOrigin* origin)
     878{
     879    SQLiteStatement insertOriginStatement(m_database, "INSERT INTO Origins (origin, quota) VALUES (?, ?)");
     880    if (insertOriginStatement.prepare() != SQLResultOk)
     881        return false;
     882
     883    insertOriginStatement.bindText(1, origin->databaseIdentifier());
     884    insertOriginStatement.bindInt64(2, m_defaultOriginQuota);
     885    if (!executeStatement(insertOriginStatement))
     886        return false;
     887
     888    return true;
     889}
     890
    861891bool ApplicationCacheStorage::storeNewestCache(ApplicationCacheGroup* group, ApplicationCache* oldCache, FailureReason& failureReason)
    862892{
  • trunk/WebCore/loader/appcache/ApplicationCacheStorage.h

    r64399 r64400  
    6464    int64_t defaultOriginQuota() const { return m_defaultOriginQuota; }
    6565    void setDefaultOriginQuota(int64_t quota);
     66    bool usageForOrigin(const SecurityOrigin*, int64_t& usage);
    6667    bool quotaForOrigin(const SecurityOrigin*, int64_t& quota);
    6768    bool remainingSizeForOriginExcludingCache(const SecurityOrigin*, ApplicationCache*, int64_t& remainingSize);
     
    106107    bool store(ApplicationCacheResource*, unsigned cacheStorageID);
    107108
     109    bool ensureOriginRecord(const SecurityOrigin*);
     110
    108111    void loadManifestHostHashes();
    109112   
  • trunk/WebCore/page/ChromeClient.h

    r64389 r64400  
    5454    class Node;
    5555    class Page;
     56    class SecurityOrigin;
    5657    class String;
    5758    class Widget;
     
    168169        // old caches.
    169170        virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0;
     171
     172        // Callback invoked when the application cache origin quota is reached. This
     173        // means that the resources attempting to be cached via the manifest are
     174        // more than allowed on this origin. This callback allows the chrome client
     175        // to take action, such as prompting the user to ask to increase the quota
     176        // for this origin.
     177        virtual void reachedApplicationCacheOriginQuota(SecurityOrigin* origin) = 0;
    170178#endif
    171179
  • trunk/WebKit/ChangeLog

    r64357 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebKit.xcodeproj/project.pbxproj:
     9        * efl/WebCoreSupport/ChromeClientEfl.cpp:
     10        (WebCore::ChromeClientEfl::reachedApplicationCacheOriginQuota):
     11        * efl/WebCoreSupport/ChromeClientEfl.h:
     12
    1132010-07-30  Rafael Antognolli  <antognolli@profusion.mobi>
    214
  • trunk/WebKit/WebKit.xcodeproj/project.pbxproj

    r63417 r64400  
    9494                4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; };
    9595                4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
    96                 51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51079D140CED11B00077247D /* WebSecurityOrigin.mm */; };
    97                 51079D180CED11B00077247D /* WebSecurityOriginInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51079D150CED11B00077247D /* WebSecurityOriginInternal.h */; };
    98                 51079D190CED11B00077247D /* WebSecurityOriginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51079D160CED11B00077247D /* WebSecurityOriginPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    9996                511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */; };
    10097                511F3FD60CECC88F00852565 /* WebDatabaseManagerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    317314                93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; };
    318315                93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; };
     316                A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */; };
     317                A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */; };
     318                A5DEFC0C11D5331C00885273 /* WebSecurityOriginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */; };
     319                A5DEFC0F11D5343E00885273 /* WebDatabaseSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0D11D5343E00885273 /* WebDatabaseSecurityOrigin.h */; };
     320                A5DEFC1011D5343E00885273 /* WebDatabaseSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC0E11D5343E00885273 /* WebDatabaseSecurityOrigin.mm */; };
     321                A5DEFC1311D5344B00885273 /* WebApplicationCacheSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC1111D5344B00885273 /* WebApplicationCacheSecurityOrigin.h */; };
     322                A5DEFC1411D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC1211D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm */; };
    319323                A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A70936AD0B5608DC00CDB48E /* WebDragClient.h */; };
    320324                A70936B00B5608DC00CDB48E /* WebDragClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = A70936AE0B5608DC00CDB48E /* WebDragClient.mm */; };
     
    473477                4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
    474478                4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
    475                 51079D140CED11B00077247D /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; };
    476                 51079D150CED11B00077247D /* WebSecurityOriginInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginInternal.h; sourceTree = "<group>"; };
    477                 51079D160CED11B00077247D /* WebSecurityOriginPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginPrivate.h; sourceTree = "<group>"; };
    478479                511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseManager.mm; sourceTree = "<group>"; };
    479480                511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerPrivate.h; sourceTree = "<group>"; };
     
    608609                9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageRendererFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    609610                9CF0E249021361B00ECA16EA /* WebFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFramePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     611                A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; };
     612                A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginInternal.h; sourceTree = "<group>"; };
     613                A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginPrivate.h; sourceTree = "<group>"; };
     614                A5DEFC0D11D5343E00885273 /* WebDatabaseSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseSecurityOrigin.h; sourceTree = "<group>"; };
     615                A5DEFC0E11D5343E00885273 /* WebDatabaseSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseSecurityOrigin.mm; sourceTree = "<group>"; };
     616                A5DEFC1111D5344B00885273 /* WebApplicationCacheSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebApplicationCacheSecurityOrigin.h; sourceTree = "<group>"; };
     617                A5DEFC1211D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebApplicationCacheSecurityOrigin.mm; sourceTree = "<group>"; };
    610618                A70936AD0B5608DC00CDB48E /* WebDragClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDragClient.h; sourceTree = "<group>"; };
    611619                A70936AE0B5608DC00CDB48E /* WebDragClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDragClient.mm; sourceTree = "<group>"; };
     
    10131021                                51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */,
    10141022                                511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */,
     1023                                A5DEFC0D11D5343E00885273 /* WebDatabaseSecurityOrigin.h */,
     1024                                A5DEFC0E11D5343E00885273 /* WebDatabaseSecurityOrigin.mm */,
    10151025                                511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */,
    10161026                                511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */,
    1017                                 51079D140CED11B00077247D /* WebSecurityOrigin.mm */,
    1018                                 51079D150CED11B00077247D /* WebSecurityOriginInternal.h */,
    1019                                 51079D160CED11B00077247D /* WebSecurityOriginPrivate.h */,
    10201027                        );
    10211028                        name = Storage;
     
    12321239                                B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */,
    12331240                                B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */,
     1241                                A5DEFC1111D5344B00885273 /* WebApplicationCacheSecurityOrigin.h */,
     1242                                A5DEFC1211D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm */,
    12341243                                51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */,
    12351244                                14D8252D0AF955090004F057 /* WebChromeClient.h */,
     
    12611270                                0A2D87FB107AF52B00CDDEE3 /* WebPluginHalterClient.h */,
    12621271                                0A2D87FC107AF52B00CDDEE3 /* WebPluginHalterClient.mm */,
     1272                                A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */,
     1273                                A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */,
     1274                                A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */,
    12631275                                93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
    12641276                                93EB178C09F88D460091F8FF /* WebSystemInterface.mm */,
     
    15361548                                C0B1F7E810AC8E3100C925D9 /* WebScriptWorld.h in Headers */,
    15371549                                C0B1F7EA10AC8E3100C925D9 /* WebScriptWorldInternal.h in Headers */,
    1538                                 51079D180CED11B00077247D /* WebSecurityOriginInternal.h in Headers */,
    1539                                 51079D190CED11B00077247D /* WebSecurityOriginPrivate.h in Headers */,
    15401550                                BC26C69E10B743F400B687ED /* WebSerializedJSValue.h in Headers */,
    15411551                                939810270824BF01008DF038 /* WebStringTruncator.h in Headers */,
     
    15581568                                0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */,
    15591569                                41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
     1570                                A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */,
     1571                                A5DEFC0C11D5331C00885273 /* WebSecurityOriginPrivate.h in Headers */,
     1572                                A5DEFC0F11D5343E00885273 /* WebDatabaseSecurityOrigin.h in Headers */,
     1573                                A5DEFC1311D5344B00885273 /* WebApplicationCacheSecurityOrigin.h in Headers */,
    15601574                        );
    15611575                        runOnlyForDeploymentPostprocessing = 0;
     
    19001914                                C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */,
    19011915                                C0B1F7E910AC8E3100C925D9 /* WebScriptWorld.mm in Sources */,
    1902                                 51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */,
    19031916                                BC26C6A510B7447A00B687ED /* WebSerializedJSValue.mm in Sources */,
    19041917                                939810CC0824BF01008DF038 /* WebStringTruncator.mm in Sources */,
     
    19171930                                0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */,
    19181931                                41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
     1932                                A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */,
     1933                                A5DEFC1011D5343E00885273 /* WebDatabaseSecurityOrigin.mm in Sources */,
     1934                                A5DEFC1411D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm in Sources */,
    19191935                        );
    19201936                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit/chromium/ChangeLog

    r64391 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * src/ChromeClientImpl.cpp:
     9        (WebKit::ChromeClientImpl::reachedApplicationCacheOriginQuota):
     10        * src/ChromeClientImpl.h:
     11
    1122010-07-30  James Robinson  <jamesr@chromium.org>
    213
  • trunk/WebKit/chromium/src/ChromeClientImpl.cpp

    r64391 r64400  
    5757#include "PopupMenuChromium.h"
    5858#include "ScriptController.h"
     59#include "SecurityOrigin.h"
    5960#include "WebGeolocationService.h"
    6061#if USE(V8)
     
    580581    ASSERT_NOT_REACHED();
    581582}
     583
     584void ChromeClientImpl::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     585{
     586    ASSERT_NOT_REACHED();
     587}
    582588#endif
    583589
  • trunk/WebKit/chromium/src/ChromeClientImpl.h

    r64391 r64400  
    119119#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    120120    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     121    virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
    121122#endif
    122123#if ENABLE(NOTIFICATIONS)
  • trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r63978 r64400  
    4848#include "NotImplemented.h"
    4949#include "PlatformString.h"
     50#include "SecurityOrigin.h"
    5051#include "ViewportArguments.h"
    5152#include "WindowFeatures.h"
     
    377378    notImplemented();
    378379}
     380
     381void ChromeClientEfl::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     382{
     383    notImplemented();
     384}
    379385#endif
    380386
  • trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.h

    r63339 r64400  
    112112#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    113113    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     114    virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*);
    114115#endif
    115116
  • trunk/WebKit/gtk/ChangeLog

    r64208 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebCoreSupport/ChromeClientGtk.cpp:
     9        (WebKit::ChromeClient::reachedApplicationCacheOriginQuota):
     10        * WebCoreSupport/ChromeClientGtk.h:
     11
    1122010-07-26  Steve Block  <steveblock@google.com>
    213
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r63339 r64400  
    3131#include "GtkVersioning.h"
    3232#include "IntRect.h"
    33 #include "PlatformString.h"
    3433#include "HitTestResult.h"
    3534#include "Icon.h"
    3635#include "KURL.h"
     36#include "PlatformString.h"
     37#include "SecurityOrigin.h"
    3738#include "webkitgeolocationpolicydecision.h"
    3839#include "webkitwebview.h"
     
    548549{
    549550    // FIXME: Free some space.
     551    notImplemented();
     552}
     553
     554void ChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     555{
    550556    notImplemented();
    551557}
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h

    r63339 r64400  
    109109#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    110110        virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     111        virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
    111112#endif
    112113        virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
  • trunk/WebKit/haiku/ChangeLog

    r63602 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebCoreSupport/ChromeClientHaiku.cpp:
     9        (WebCore::ChromeClientWx::reachedApplicationCacheOriginQuota):
     10        * WebCoreSupport/ChromeClientHaiku.h:
     11
    1122010-07-16  Zhe Su  <suzhe@chromium.org>
    213
  • trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp

    r63339 r64400  
    3636#include "NotImplemented.h"
    3737#include "PlatformString.h"
     38#include "SecurityOrigin.h"
    3839
    3940#include <Alert.h>
     
    343344#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    344345void ChromeClientWx::reachedMaxAppCacheSize(int64_t spaceNeeded)
     346{
     347    notImplemented();
     348}
     349
     350void ChromeClientWx::reachedApplicationCacheOriginQuota(SecurityOrigin*)
    345351{
    346352    notImplemented();
  • trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h

    r63339 r64400  
    131131#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    132132        virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     133        virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*);
    133134#endif
    134135
  • trunk/WebKit/mac/ChangeLog

    r64397 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        Part 4 - Client Notification when the Quota is Reached
     9
     10        Notify the WebKit client when the per-origin quota is reached
     11        via a delegate method reachedApplicationCacheOriginQuota.
     12
     13          Refactor the WebSecurityOrigin class to be generic enough to
     14          allow quota management of both Databases or Application Caches
     15          via subclasses.
     16
     17        * Storage/WebDatabaseSecurityOrigin.h: Added.
     18        * Storage/WebDatabaseSecurityOrigin.mm: Added.
     19        (-[WebDatabaseSecurityOrigin quota]):
     20        (-[WebDatabaseSecurityOrigin setQuota:]):
     21        * WebCoreSupport/WebApplicationCacheSecurityOrigin.h: Added.
     22        * WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: Added.
     23        (-[WebApplicationCacheSecurityOrigin quota]):
     24        (-[WebApplicationCacheSecurityOrigin setQuota:]):
     25        * Storage/WebSecurityOrigin.mm: Removed. (Moved to WebCoreSupport)
     26        * Storage/WebSecurityOriginPrivate.h: Removed. (Moved to WebCoreSupport)
     27        * WebCoreSupport/WebSecurityOrigin.mm: Added.
     28        (-[WebSecurityOrigin usage]): to be implemented by subclasses.
     29        (-[WebSecurityOrigin quota]): to be implemented by subclasses.
     30        (-[WebSecurityOrigin setQuota:]): to be implemented by subclasses.
     31        * WebCoreSupport/WebSecurityOriginInternal.h: Renamed from WebKit/mac/Storage/WebSecurityOriginInternal.h.
     32        * WebCoreSupport/WebSecurityOriginPrivate.h: Added.
     33
     34          Turn the notification into a WebUI Delegate to call. Following
     35          the example of Databases.
     36
     37        * DefaultDelegates/WebDefaultUIDelegate.m:
     38        (-[WebDefaultUIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:]):
     39        * WebCoreSupport/WebChromeClient.h:
     40        * WebCoreSupport/WebChromeClient.mm:
     41        (WebChromeClient::exceededDatabaseQuota): use the Databases Security Origin subclass.
     42        (WebChromeClient::reachedApplicationCacheOriginQuota): use the Application Cache Security Origin subclass.
     43        * WebView/WebUIDelegatePrivate.h:
     44
    1452010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
    246
  • trunk/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m

    r40363 r64400  
    228228}
    229229
     230- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin
     231{
     232}
     233
    230234- (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename
    231235{
  • trunk/WebKit/mac/WebCoreSupport/WebApplicationCache.h

    r64397 r64400  
    2626#import <Foundation/Foundation.h>
    2727
    28 @interface WebApplicationCache: NSObject {
    29 }
     28@interface WebApplicationCache: NSObject
    3029
    3130+ (long long)maximumSize;
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h

    r63339 r64400  
    118118#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    119119    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     120    virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
    120121#endif
    121122    virtual void populateVisitedLinks();
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r63339 r64400  
    3131
    3232#import "DOMNodeInternal.h"
     33#import "WebApplicationCacheSecurityOrigin.h"
     34#import "WebDatabaseSecurityOrigin.h"
    3335#import "WebDefaultUIDelegate.h"
    3436#import "WebDelegateImplementationCaching.h"
     
    554556    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    555557
    556     WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()];
     558    WebDatabaseSecurityOrigin *webOrigin = [[WebDatabaseSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()];
    557559    // FIXME: remove this workaround once shipping Safari has the necessary delegate implemented.
    558560    if (WKAppVersionCheckLessThan(@"com.apple.Safari", -1, 3.1)) {
     
    571573{
    572574    // FIXME: Free some space.
     575}
     576
     577void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin)
     578{
     579    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     580
     581    WebApplicationCacheSecurityOrigin *webOrigin = [[WebApplicationCacheSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin];
     582    CallUIDelegate(m_webView, @selector(webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:), webOrigin);
     583    [webOrigin release];
     584
     585    END_BLOCK_OBJC_EXCEPTIONS;
    573586}
    574587#endif
  • trunk/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm

    r64399 r64400  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#import "WebSecurityOriginInternal.h"
    3030
    31 #import <WebCore/DatabaseTracker.h>
    3231#import <WebCore/KURL.h>
    3332#import <WebCore/SecurityOrigin.h>
     
    7069}
    7170
    72 - (unsigned long long)usage
     71// Meant to be implemented in a subclass.
     72- (long long)usage
    7373{
    74 #if ENABLE(DATABASE)
    75     return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
    76 #else
    7774    return 0;
    78 #endif
    7975}
    8076
    81 - (unsigned long long)quota
     77// Meant to be implemented in a subclass.
     78- (long long)quota
    8279{
    83 #if ENABLE(DATABASE)
    84     return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
    85 #else
    8680    return 0;
    87 #endif
    8881}
    8982
    90 // Sets the storage quota (in bytes)
    91 // If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota. 
    92 // This will simply prevent new data from being added to databases in that origin
    93 - (void)setQuota:(unsigned long long)quota
     83// Meant to be implemented in a subclass.
     84- (void)setQuota:(long long)quota
    9485{
    95 #if ENABLE(DATABASE)
    96     DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota);
    97 #endif
    9886}
    9987
  • trunk/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h

    r64399 r64400  
    3838- (NSString*)host;
    3939
    40 // Returns zero if the port is the default port for the protocol, non-zero otherwise
     40// Returns zero if the port is the default port for the protocol, non-zero otherwise.
    4141- (unsigned short)port;
    4242
    43 // Returns the current total usage of all databases in this security origin in bytes
    44 - (unsigned long long)usage;
     43// Meant to be implemented in a subclass.
     44// Returns the current total usage of all relevant items in this security origin in bytes.
     45- (long long)usage;
    4546
    46 - (unsigned long long)quota;
    47 // Sets the storage quota (in bytes)
    48 // If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota. 
    49 // This will simply prevent new data from being added to databases in that origin
    50 - (void)setQuota:(unsigned long long)quota;
     47// Meant to be implemented in a subclass.
     48// Returns the quota of this security origin in bytes.
     49- (long long)quota;
    5150
     51// Meant to be implemented in a subclass.
     52// Sets the storage quota in bytes.
     53- (void)setQuota:(long long)quota;
    5254
    5355@end
  • trunk/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r62451 r64400  
    11/*
    2  * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    126126- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier;
    127127
     128/*!
     129    @method webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:
     130    @param sender The WebView sending the delegate method.
     131    @param origin The security origin that needs a larger quota
     132    @discussion This method is called when a page attempts to store more in the Application Cache
     133    for an origin than was allowed by the quota (or default) set for the origin. This allows the
     134    quota to be increased for the security origin.
     135*/
     136- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin;
     137
    128138- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features;
    129139
  • trunk/WebKit/qt/ChangeLog

    r64284 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebCoreSupport/ChromeClientQt.cpp:
     9        (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota):
     10        * WebCoreSupport/ChromeClientQt.h:
     11
    1122010-07-29  Alexis Menard  <alexis.menard@nokia.com>
    213
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r63339 r64400  
    484484    notImplemented();
    485485}
     486
     487void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     488{
     489    notImplemented();
     490}
    486491#endif
    487492
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r63339 r64400  
    132132#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    133133        virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     134        virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*);
    134135#endif
    135136
  • trunk/WebKit/win/ChangeLog

    r64208 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebCoreSupport/WebChromeClient.cpp:
     9        (WebChromeClient::reachedApplicationCacheOriginQuota):
     10        * WebCoreSupport/WebChromeClient.h:
     11
    1122010-07-26  Steve Block  <steveblock@google.com>
    213
  • trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r63339 r64400  
    5656#include <WebCore/NotImplemented.h>
    5757#include <WebCore/Page.h>
     58#include <WebCore/SecurityOrigin.h>
    5859#include <WebCore/WindowFeatures.h>
    5960#pragma warning(pop)
     
    616617{
    617618    // FIXME: Free some space.
     619    notImplemented();
     620}
     621
     622void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     623{
    618624    notImplemented();
    619625}
  • trunk/WebKit/win/WebCoreSupport/WebChromeClient.h

    r63339 r64400  
    119119#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    120120    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     121    virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
    121122#endif
    122123
  • trunk/WebKit/wx/ChangeLog

    r64288 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebKitSupport/ChromeClientWx.cpp:
     9        (WebCore::ChromeClientWx::reachedApplicationCacheOriginQuota):
     10        * WebKitSupport/ChromeClientWx.h:
     11
    1122010-07-29  Kevin Ollivier  <kevino@theolliviers.com>
    213
  • trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp

    r63339 r64400  
    3939#include "NotImplemented.h"
    4040#include "PlatformString.h"
     41#include "SecurityOrigin.h"
    4142#include "WindowFeatures.h"
    4243
     
    430431    notImplemented();
    431432}
     433
     434void ChromeClientWx::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     435{
     436    notImplemented();
     437}
    432438#endif
    433439
  • trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h

    r63339 r64400  
    126126#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    127127    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     128    virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*);
    128129#endif
    129130
  • trunk/WebKit2/ChangeLog

    r64396 r64400  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
     6        https://bugs.webkit.org/show_bug.cgi?id=40627
     7
     8        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     9        (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
     10        * WebProcess/WebCoreSupport/WebChromeClient.h:
     11
    1122010-07-30  Sam Weinig  <sam@webkit.org>
    213
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r64247 r64400  
    4141#include <WebCore/Frame.h>
    4242#include <WebCore/FrameLoader.h>
     43#include <WebCore/SecurityOrigin.h>
    4344
    4445using namespace WebCore;
     
    376377    notImplemented();
    377378}
     379
     380void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*)
     381{
     382    notImplemented();
     383}
    378384#endif
    379385
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r63339 r64400  
    124124#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    125125    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     126    virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
    126127#endif
    127128
Note: See TracChangeset for help on using the changeset viewer.