Changeset 90948 in webkit
- Timestamp:
- Jul 13, 2011 2:40:54 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90947 r90948 1 2011-07-13 Joseph Pecoraro <joepeck@webkit.org> 2 3 Improve names of some ApplicationCacheStorage accessor methods 4 https://bugs.webkit.org/show_bug.cgi?id=64433 5 6 Reviewed by Alexey Proskuryakov. 7 8 Some methods returned a bool for success/failure and 9 actually returned a value as an out parameter so their 10 name was confusing. Rename these methods to make them 11 more clear. 12 13 (WebCore::ApplicationCache::diskUsageForOrigin): 14 * loader/appcache/ApplicationCacheGroup.cpp: 15 (WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota): 16 * loader/appcache/ApplicationCacheStorage.cpp: 17 (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): 18 (WebCore::ApplicationCacheStorage::calculateUsageForOrigin): 19 (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache): 20 (WebCore::ApplicationCacheStorage::checkOriginQuota): 21 * loader/appcache/ApplicationCacheStorage.h: 22 * loader/appcache/ApplicationCache.cpp: 23 Rename the methods. 24 25 * WebCore.exp.in: 26 Replaced old versions. Also, calculateRemaining wasn't needed 27 outside WebCore, so no longer export it. 28 1 29 2011-07-13 Joseph Pecoraro <joepeck@webkit.org> 2 30 -
trunk/Source/WebCore/WebCore.exp.in
r90734 r90948 1869 1869 __ZN7WebCore16ApplicationCache18diskUsageForOriginEPNS_14SecurityOriginE 1870 1870 __ZN7WebCore16ApplicationCache20deleteCacheForOriginEPNS_14SecurityOriginE 1871 __ZN7WebCore23ApplicationCacheStorage14quotaForOriginEPKNS_14SecurityOriginERx1872 1871 __ZN7WebCore23ApplicationCacheStorage14setMaximumSizeEx 1873 __ZN7WebCore23ApplicationCacheStorage14usageForOriginEPKNS_14SecurityOriginERx1874 1872 __ZN7WebCore23ApplicationCacheStorage16deleteAllEntriesEv 1875 1873 __ZN7WebCore23ApplicationCacheStorage16storeCopyOfCacheERKN3WTF6StringEPNS_20ApplicationCacheHostE … … 1878 1876 __ZN7WebCore23ApplicationCacheStorage19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE 1879 1877 __ZN7WebCore23ApplicationCacheStorage21setDefaultOriginQuotaEx 1878 __ZN7WebCore23ApplicationCacheStorage23calculateQuotaForOriginEPKNS_14SecurityOriginERx 1879 __ZN7WebCore23ApplicationCacheStorage23calculateUsageForOriginEPKNS_14SecurityOriginERx 1880 1880 __ZN7WebCore23ApplicationCacheStorage26storeUpdatedQuotaForOriginEPKNS_14SecurityOriginEx 1881 __ZN7WebCore23ApplicationCacheStorage36remainingSizeForOriginExcludingCacheEPKNS_14SecurityOriginEPNS_16ApplicationCacheERx1882 1881 __ZN7WebCore23ApplicationCacheStorage5emptyEv 1883 1882 __ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv -
trunk/Source/WebCore/loader/appcache/ApplicationCache.cpp
r86204 r90948 211 211 { 212 212 int64_t usage = 0; 213 cacheStorage(). usageForOrigin(origin, usage);213 cacheStorage().calculateUsageForOrigin(origin, usage); 214 214 return usage; 215 215 } -
trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
r90947 r90948 810 810 void ApplicationCacheGroup::recalculateAvailableSpaceInQuota() 811 811 { 812 if (!cacheStorage(). remainingSizeForOriginExcludingCache(m_origin.get(), m_newestCache.get(), m_availableSpaceInQuota)) {812 if (!cacheStorage().calculateRemainingSizeForOriginExcludingCache(m_origin.get(), m_newestCache.get(), m_availableSpaceInQuota)) { 813 813 // Failed to determine what is left in the quota. Fallback to allowing anything. 814 814 m_availableSpaceInQuota = ApplicationCacheStorage::noQuota(); -
trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
r90856 r90948 434 434 } 435 435 436 bool ApplicationCacheStorage:: quotaForOrigin(const SecurityOrigin* origin, int64_t& quota)436 bool ApplicationCacheStorage::calculateQuotaForOrigin(const SecurityOrigin* origin, int64_t& quota) 437 437 { 438 438 // If an Origin record doesn't exist, then the COUNT will be 0 and quota will be 0. … … 457 457 } 458 458 459 bool ApplicationCacheStorage:: usageForOrigin(const SecurityOrigin* origin, int64_t& usage)459 bool ApplicationCacheStorage::calculateUsageForOrigin(const SecurityOrigin* origin, int64_t& usage) 460 460 { 461 461 // If an Origins record doesn't exist, then the SUM will be null, … … 481 481 } 482 482 483 bool ApplicationCacheStorage:: remainingSizeForOriginExcludingCache(const SecurityOrigin* origin, ApplicationCache* cache, int64_t& remainingSize)483 bool ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache(const SecurityOrigin* origin, ApplicationCache* cache, int64_t& remainingSize) 484 484 { 485 485 openDatabase(false); … … 520 520 int64_t numberOfCaches = statement.getColumnInt64(0); 521 521 if (numberOfCaches == 0) 522 quotaForOrigin(origin, remainingSize);522 calculateQuotaForOrigin(origin, remainingSize); 523 523 else 524 524 remainingSize = statement.getColumnInt64(1); … … 961 961 int64_t remainingSpaceInOrigin; 962 962 const SecurityOrigin* origin = group->origin(); 963 if ( remainingSizeForOriginExcludingCache(origin, oldCache, remainingSpaceInOrigin)) {963 if (calculateRemainingSizeForOriginExcludingCache(origin, oldCache, remainingSpaceInOrigin)) { 964 964 if (remainingSpaceInOrigin < newCache->estimatedSizeInStorage()) { 965 965 int64_t quota; 966 if ( quotaForOrigin(origin, quota)) {966 if (calculateQuotaForOrigin(origin, quota)) { 967 967 totalSpaceNeeded = quota - remainingSpaceInOrigin + newCache->estimatedSizeInStorage(); 968 968 return false; -
trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.h
r90856 r90948 66 66 int64_t defaultOriginQuota() const { return m_defaultOriginQuota; } 67 67 void setDefaultOriginQuota(int64_t quota); 68 bool usageForOrigin(const SecurityOrigin*, int64_t& usage);69 bool quotaForOrigin(const SecurityOrigin*, int64_t& quota);70 bool remainingSizeForOriginExcludingCache(const SecurityOrigin*, ApplicationCache*, int64_t& remainingSize);68 bool calculateUsageForOrigin(const SecurityOrigin*, int64_t& usage); 69 bool calculateQuotaForOrigin(const SecurityOrigin*, int64_t& quota); 70 bool calculateRemainingSizeForOriginExcludingCache(const SecurityOrigin*, ApplicationCache*, int64_t& remainingSize); 71 71 bool storeUpdatedQuotaForOrigin(const SecurityOrigin*, int64_t quota); 72 72 bool checkOriginQuota(ApplicationCacheGroup*, ApplicationCache* oldCache, ApplicationCache* newCache, int64_t& totalSpaceNeeded); -
trunk/Source/WebKit/mac/ChangeLog
r90856 r90948 1 2011-07-13 Joseph Pecoraro <joepeck@webkit.org> 2 3 Improve names of some ApplicationCacheStorage accessor methods 4 https://bugs.webkit.org/show_bug.cgi?id=64433 5 6 Reviewed by Alexey Proskuryakov. 7 8 * WebCoreSupport/WebApplicationCacheQuotaManager.mm: 9 (-[WebApplicationCacheQuotaManager usage]): 10 (-[WebApplicationCacheQuotaManager quota]): 11 Renamed methods. 12 1 13 2011-07-12 Joseph Pecoraro <joepeck@webkit.org> 2 14 -
trunk/Source/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm
r64612 r90948 52 52 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 53 53 long long usage; 54 if (cacheStorage(). usageForOrigin([_origin _core], usage))54 if (cacheStorage().calculateUsageForOrigin([_origin _core], usage)) 55 55 return usage; 56 56 return 0; … … 64 64 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 65 65 long long quota; 66 if (cacheStorage(). quotaForOrigin([_origin _core], quota))66 if (cacheStorage().calculateQuotaForOrigin([_origin _core], quota)) 67 67 return quota; 68 68 return 0; -
trunk/Source/WebKit/qt/ChangeLog
r90856 r90948 1 2011-07-13 Joseph Pecoraro <joepeck@webkit.org> 2 3 Improve names of some ApplicationCacheStorage accessor methods 4 https://bugs.webkit.org/show_bug.cgi?id=64433 5 6 Reviewed by Alexey Proskuryakov. 7 8 * WebCoreSupport/ChromeClientQt.cpp: 9 (WebCore::ChromeClientQt::reachedApplicationCacheOriginQuota): 10 Renamed method. 11 1 12 2011-07-12 Joseph Pecoraro <joepeck@webkit.org> 2 13 -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r90856 r90948 564 564 QWebSecurityOrigin* securityOrigin = new QWebSecurityOrigin(priv); 565 565 566 if (!WebCore::cacheStorage(). quotaForOrigin(origin, quota))566 if (!WebCore::cacheStorage().calculateQuotaForOrigin(origin, quota)) 567 567 WebCore::cacheStorage().storeUpdatedQuotaForOrigin(origin, defaultOriginQuota); 568 568
Note: See TracChangeset
for help on using the changeset viewer.