Changeset 64613 in webkit
- Timestamp:
- Aug 3, 2010 6:50:29 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64611 r64613 1 2010-08-03 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 6 - LayoutTest and Cleanup 9 10 * http/tests/appcache/origin-quota-expected.txt: Added. 11 * http/tests/appcache/origin-quota.html: Added. 12 * http/tests/appcache/resources/quota-origin-iframe-1.html: Added. 13 * http/tests/appcache/resources/quota-origin-iframe-1.manifest: Added. 14 * http/tests/appcache/resources/quota-origin-iframe-2.html: Added. 15 * http/tests/appcache/resources/quota-origin-iframe-2.manifest: Added. 16 * http/tests/appcache/resources/quota-origin-iframe-3.html: Added. 17 * http/tests/appcache/resources/quota-origin-iframe-3.manifest: Added. 18 1 19 2010-08-03 Eric Seidel <eric@webkit.org> 2 20 -
trunk/WebCore/ChangeLog
r64610 r64613 1 2010-08-03 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 6 - LayoutTest and Cleanup 9 10 Test: http/tests/appcache/origin-quota.html 11 12 * loader/appcache/ApplicationCacheGroup.cpp: 13 (WebCore::ApplicationCacheGroup::scheduleReachedOriginQuotaCallback): made synchronous, as asynchronously the cache group was deleted too soon. 14 * loader/appcache/ApplicationCacheStorage.cpp: 15 (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin): all storing operations should force the database to be created if needed. 16 1 17 2010-08-03 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/WebCore/loader/appcache/ApplicationCacheGroup.cpp
r64400 r64613 1080 1080 }; 1081 1081 1082 class OriginQuotaReachedCallbackTimer: public TimerBase {1083 public:1084 OriginQuotaReachedCallbackTimer(ApplicationCacheGroup* cacheGroup, Frame* frame)1085 : m_cacheGroup(cacheGroup)1086 , m_frame(frame)1087 {1088 }1089 1090 private: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 1101 1082 void ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback() 1102 1083 { … … 1109 1090 void ApplicationCacheGroup::scheduleReachedOriginQuotaCallback() 1110 1091 { 1111 ASSERT(isMainThread()); 1112 RefPtr<Frame> frameProtector = m_frame; 1113 OriginQuotaReachedCallbackTimer* timer = new OriginQuotaReachedCallbackTimer(this, frameProtector.get()); 1114 timer->startOneShot(0); 1115 // The timer will delete itself once it fires. 1092 // FIXME: it might be nice to run this asynchronously, because there is no return value to wait for. 1093 didReachOriginQuota(m_frame); 1116 1094 } 1117 1095 -
trunk/WebCore/loader/appcache/ApplicationCacheStorage.cpp
r64400 r64613 519 519 bool ApplicationCacheStorage::storeUpdatedQuotaForOrigin(const SecurityOrigin* origin, int64_t quota) 520 520 { 521 openDatabase( false);521 openDatabase(true); 522 522 if (!m_database.isOpen()) 523 523 return false; -
trunk/WebKit/mac/ChangeLog
r64612 r64613 1 2010-08-03 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 6 - LayoutTest and Cleanup 9 10 * WebCoreSupport/WebApplicationCache.h: 11 * WebCoreSupport/WebApplicationCache.mm: 12 (+[WebApplicationCache setMaximumSize:]): refactor out deleting the application caches. 13 (+[WebApplicationCache deleteAllApplicationCaches]): delete application caches. 14 1 15 2010-08-03 Joseph Pecoraro <joepeck@webkit.org> 2 16 -
trunk/WebKit/mac/WebCoreSupport/WebApplicationCache.h
r64400 r64613 34 34 + (void)setDefaultOriginQuota:(long long)size; 35 35 36 + (void)deleteAllApplicationCaches; 37 36 38 @end -
trunk/WebKit/mac/WebCoreSupport/WebApplicationCache.mm
r64397 r64613 40 40 + (void)setMaximumSize:(long long)size 41 41 { 42 cacheStorage().empty(); 43 cacheStorage().vacuumDatabaseFile(); 42 [WebApplicationCache deleteAllApplicationCaches]; 44 43 cacheStorage().setMaximumSize(size); 45 44 } … … 55 54 } 56 55 56 + (void)deleteAllApplicationCaches 57 { 58 cacheStorage().empty(); 59 cacheStorage().vacuumDatabaseFile(); 60 } 61 57 62 @end 58 63 -
trunk/WebKitTools/ChangeLog
r64612 r64613 1 2010-08-03 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 6 - LayoutTest and Cleanup 9 10 Allow tests to delete application caches and set application cache 11 origin quotas, so they can be tested. 12 13 * DumpRenderTree/LayoutTestController.cpp: 14 (LayoutTestController::LayoutTestController): 15 (dumpApplicationCacheDelegateCallbacksCallback): JavaScript callback, delegates to the controller. 16 (clearAllApplicationCachesCallback): should delete all application caches. 17 (setApplicationCacheOriginQuotaCallback): should set the origin quota for the localhost tests. 18 (LayoutTestController::staticFunctions): 19 * DumpRenderTree/LayoutTestController.h: 20 (LayoutTestController::dumpApplicationCacheDelegateCallbacks): accessor to see if application cache callbacks should be output. 21 (LayoutTestController::setDumpApplicationCacheDelegateCallbacks): enable or disable debug output when the application cache quota is reached. 22 23 Mac implementation. 24 25 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 26 (LayoutTestController::clearAllApplicationCaches): delete application caches. 27 (LayoutTestController::setApplicationCacheOriginQuota): set the quota for localhost. 28 * DumpRenderTree/mac/UIDelegate.mm: 29 (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): style fix. 30 (-[UIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:]): reset the quota. 31 32 Stub implementations for other platforms. 33 34 * DumpRenderTree/chromium/LayoutTestController.cpp: 35 (LayoutTestController::LayoutTestController): 36 (LayoutTestController::clearAllApplicationCaches): 37 (LayoutTestController::setApplicationCacheOriginQuota): 38 * DumpRenderTree/chromium/LayoutTestController.h: 39 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 40 (LayoutTestController::clearAllApplicationCaches): 41 (LayoutTestController::setApplicationCacheOriginQuota): 42 * DumpRenderTree/qt/LayoutTestControllerQt.cpp: 43 (LayoutTestController::clearAllApplicationCaches): 44 (LayoutTestController::setApplicationCacheOriginQuota): 45 * DumpRenderTree/qt/LayoutTestControllerQt.h: 46 * DumpRenderTree/win/LayoutTestControllerWin.cpp: 47 (LayoutTestController::clearAllApplicationCaches): 48 (LayoutTestController::setApplicationCacheOriginQuota): 49 * DumpRenderTree/wx/LayoutTestControllerWx.cpp: 50 (LayoutTestController::clearAllApplicationCaches): 51 (LayoutTestController::setApplicationCacheOriginQuota): 52 1 53 2010-08-03 Joseph Pecoraro <joepeck@webkit.org> 2 54 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r64356 r64613 42 42 43 43 LayoutTestController::LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash) 44 : m_dumpAsPDF(false) 44 : m_dumpApplicationCacheDelegateCallbacks(false) 45 , m_dumpAsPDF(false) 45 46 , m_dumpAsText(false) 46 47 , m_dumpBackForwardList(false) … … 93 94 // Static Functions 94 95 96 static JSValueRef dumpApplicationCacheDelegateCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 97 { 98 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 99 controller->setDumpApplicationCacheDelegateCallbacks(true); 100 return JSValueMakeUndefined(context); 101 } 102 95 103 static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 96 104 { … … 309 317 310 318 return JSValueMakeBoolean(context, controller->callShouldCloseOnWebView()); 319 } 320 321 static JSValueRef clearAllApplicationCachesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 322 { 323 // Has mac implementation 324 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 325 controller->clearAllApplicationCaches(); 326 327 return JSValueMakeUndefined(context); 311 328 } 312 329 … … 843 860 844 861 return JSValueMakeUndefined(context); 845 862 } 863 864 static JSValueRef setApplicationCacheOriginQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 865 { 866 // Has mac implementation 867 if (argumentCount < 1) 868 return JSValueMakeUndefined(context); 869 870 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 871 872 double size = JSValueToNumber(context, arguments[0], NULL); 873 if (!isnan(size)) 874 controller->setApplicationCacheOriginQuota(static_cast<unsigned long long>(size)); 875 876 return JSValueMakeUndefined(context); 846 877 } 847 878 … … 1764 1795 { "apiTestGoToCurrentBackForwardItem", apiTestGoToCurrentBackForwardItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1765 1796 { "callShouldCloseOnWebView", callShouldCloseOnWebViewCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1797 { "clearAllApplicationCaches", clearAllApplicationCachesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1766 1798 { "clearAllDatabases", clearAllDatabasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1767 1799 { "clearBackForwardList", clearBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, … … 1773 1805 { "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1774 1806 { "display", displayCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1807 { "dumpApplicationCacheDelegateCallbacks", dumpApplicationCacheDelegateCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1775 1808 { "dumpAsText", dumpAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1776 1809 { "dumpBackForwardList", dumpBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, … … 1827 1860 { "setAllowFileAccessFromFileURLs", setAllowFileAccessFromFileURLsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1828 1861 { "setAlwaysAcceptCookies", setAlwaysAcceptCookiesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1829 { "setAppCacheMaximumSize", setAppCacheMaximumSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1862 { "setAppCacheMaximumSize", setAppCacheMaximumSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1863 { "setApplicationCacheOriginQuota", setApplicationCacheOriginQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1830 1864 { "setAuthenticationPassword", setAuthenticationPasswordCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1831 1865 { "setAuthenticationUsername", setAuthenticationUsernameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r64356 r64613 46 46 47 47 void addDisallowedURL(JSStringRef url); 48 void clearAllApplicationCaches(); 48 49 void clearAllDatabases(); 49 50 void clearBackForwardList(); … … 80 81 void setAllowFileAccessFromFileURLs(bool); 81 82 void setAppCacheMaximumSize(unsigned long long quota); 83 void setApplicationCacheOriginQuota(unsigned long long quota); 82 84 void setAuthorAndUserStylesEnabled(bool); 83 85 void setCacheModel(int); … … 127 129 void setGeneratePixelResults(bool generatePixelResults) { m_generatePixelResults = generatePixelResults; } 128 130 131 bool dumpApplicationCacheDelegateCallbacks() const { return m_dumpApplicationCacheDelegateCallbacks; } 132 void setDumpApplicationCacheDelegateCallbacks(bool dumpCallbacks) { m_dumpApplicationCacheDelegateCallbacks = dumpCallbacks; } 133 129 134 bool dumpBackForwardList() const { return m_dumpBackForwardList; } 130 135 void setDumpBackForwardList(bool dumpBackForwardList) { m_dumpBackForwardList = dumpBackForwardList; } … … 288 293 LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); 289 294 295 bool m_dumpApplicationCacheDelegateCallbacks; 290 296 bool m_dumpAsPDF; 291 297 bool m_dumpAsText; -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
r64451 r64613 155 155 bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled); 156 156 bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); 157 bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches); 158 bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota); 157 159 158 160 bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard); … … 646 648 { 647 649 // We have no need to support Dashboard Compatibility Mode (mac-only) 650 result->setNull(); 651 } 652 653 void LayoutTestController::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result) 654 { 655 // FIXME: implement to support Application Cache Quotas. 656 result->setNull(); 657 } 658 659 void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) 660 { 661 // FIXME: implement to support Application Cache Quotas. 648 662 result->setNull(); 649 663 } -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
r64356 r64613 251 251 void removeOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*); 252 252 253 // Clears all Application Caches. 254 void clearAllApplicationCaches(const CppArgumentList&, CppVariant*); 255 // Sets the Application Quota for the localhost origin. 256 void setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant*); 257 253 258 // Clears all databases. 254 259 void clearAllDatabases(const CppArgumentList&, CppVariant*); -
trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r64524 r64613 543 543 } 544 544 545 void LayoutTestController::clearAllApplicationCaches() 546 { 547 // FIXME: implement to support Application Cache quotas. 548 } 549 550 void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) 551 { 552 // FIXME: implement to support Application Cache quotas. 553 } 554 545 555 void LayoutTestController::clearAllDatabases() 546 556 { -
trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r64612 r64613 125 125 } 126 126 127 void LayoutTestController::clearAllApplicationCaches() 128 { 129 [WebApplicationCache deleteAllApplicationCaches]; 130 } 131 127 132 void LayoutTestController::clearAllDatabases() 128 133 { … … 293 298 { 294 299 [WebApplicationCache setMaximumSize:size]; 300 } 301 302 void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) 303 { 304 WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"http://127.0.0.1:8000"]]; 305 [[origin applicationCacheQuotaManager] setQuota:quota]; 306 [origin release]; 295 307 } 296 308 -
trunk/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
r64612 r64613 34 34 #import "EventSendingController.h" 35 35 #import "LayoutTestController.h" 36 #import <WebKit/WebApplicationCache.h> 36 37 #import <WebKit/WebFramePrivate.h> 37 38 #import <WebKit/WebHTMLViewPrivate.h> … … 157 158 - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier 158 159 { 159 if (!done && gLayoutTestController->dumpDatabaseCallbacks()) 160 if (!done && gLayoutTestController->dumpDatabaseCallbacks()) { 160 161 printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String], 161 162 [origin port], [databaseIdentifier UTF8String]); 163 } 162 164 163 165 static const unsigned long long defaultQuota = 5 * 1024 * 1024; 164 166 [[origin databaseQuotaManager] setQuota:defaultQuota]; 167 } 168 169 - (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin 170 { 171 if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) { 172 printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i}\n", 173 [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port]); 174 } 175 176 static const unsigned long long defaultOriginQuota = [WebApplicationCache defaultOriginQuota]; 177 [[origin applicationCacheQuotaManager] setQuota:defaultOriginQuota]; 165 178 } 166 179 -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
r64356 r64613 495 495 } 496 496 497 void LayoutTestController::clearAllApplicationCaches() 498 { 499 // FIXME: implement to support Application Cache quotas. 500 } 501 502 void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) 503 { 504 // FIXME: implement to support Application Cache quotas. 505 } 506 497 507 void LayoutTestController::setDatabaseQuota(int size) 498 508 { -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
r64356 r64613 175 175 void disableImageLoading(); 176 176 177 void clearAllApplicationCaches(); 178 void setApplicationCacheOriginQuota(unsigned long long quota); 179 177 180 void setDatabaseQuota(int size); 178 181 void clearAllDatabases(); -
trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r64356 r64613 889 889 } 890 890 891 void LayoutTestController::clearAllApplicationCaches() 892 { 893 // FIXME: implement to support Application Cache quotas. 894 } 895 896 void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) 897 { 898 // FIXME: implement to support Application Cache quotas. 899 } 900 891 901 void LayoutTestController::clearAllDatabases() 892 902 { -
trunk/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
r64356 r64613 229 229 } 230 230 231 void LayoutTestController::clearAllApplicationCaches() 232 { 233 // FIXME: implement to support Application Cache quotas. 234 } 235 236 void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) 237 { 238 // FIXME: implement to support Application Cache quotas. 239 } 240 231 241 void LayoutTestController::clearAllDatabases() 232 242 {
Note: See TracChangeset
for help on using the changeset viewer.