Changeset 118631 in webkit
- Timestamp:
- May 27, 2012, 2:31:54 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/appcache/load-from-appcache-defer-resume-crash-expected.txt (added)
-
LayoutTests/http/tests/appcache/load-from-appcache-defer-resume-crash.html (added)
-
LayoutTests/http/tests/appcache/resources/load-from-appcache-defer-resume-bounce-back.html (added)
-
LayoutTests/http/tests/appcache/resources/load-from-appcache-defer-resume-crash.manifest (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/MainResourceLoader.cpp (modified) (4 diffs)
-
Source/WebCore/loader/MainResourceLoader.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/LayoutTestController.cpp (modified) (3 diffs)
-
Tools/DumpRenderTree/LayoutTestController.h (modified) (2 diffs)
-
Tools/DumpRenderTree/mac/DumpRenderTree.mm (modified) (1 diff)
-
Tools/DumpRenderTree/mac/FrameLoadDelegate.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r118630 r118631 1 2012-05-27 Benjamin Poulain <bpoulain@apple.com> 2 3 When pages are loaded from AppCache with DeferredLoading, willSendRequest() is never called 4 https://bugs.webkit.org/show_bug.cgi?id=87582 5 6 Reviewed by Darin Adler. 7 8 * http/tests/appcache/load-from-appcache-defer-resume-crash-expected.txt: Added. 9 * http/tests/appcache/load-from-appcache-defer-resume-crash.html: Added. 10 * http/tests/appcache/resources/load-from-appcache-defer-resume-bounce-back.html: Added. 11 * http/tests/appcache/resources/load-from-appcache-defer-resume-crash.manifest: Added. 12 1 13 2012-05-27 Zan Dobersek <zandobersek@gmail.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r118624 r118631 1 2012-05-27 Benjamin Poulain <bpoulain@apple.com> 2 3 When pages are loaded from AppCache with DeferredLoading, willSendRequest() is never called 4 https://bugs.webkit.org/show_bug.cgi?id=87582 5 6 Reviewed by Darin Adler. 7 8 Previously, there was a shortcut when a deferred MainResourceLoader is resumed: If the data 9 was coming from AppCache we could jump directly to startDataLoadTimer(). 10 11 The problem with the shortcut is willSendRequest() is never called in that particular case 12 (substituteData + deferred-resume). The imbalance between willSendRequest() and didReceiveResponse() 13 causes problems. 14 15 This patch removes the shortcut so that MainResourceLoader::loadNow() is used regardless of 16 the deferred loading. The method MainResourceLoader::loadNow() handle the substituteData as if the loading 17 was not deferred. 18 19 Test: http/tests/appcache/load-from-appcache-defer-resume-crash.html 20 21 * loader/MainResourceLoader.cpp: 22 (WebCore::MainResourceLoader::continueAfterNavigationPolicy): 23 (WebCore::MainResourceLoader::handleSubstituteDataLoadSoon): 24 Rename the method to be consistent with the attribute it uses, making the naming more explicit. 25 (WebCore::MainResourceLoader::loadNow): 26 (WebCore::MainResourceLoader::setDefersLoading): 27 * loader/MainResourceLoader.h: 28 (MainResourceLoader): 29 1 30 2012-05-27 David Kilzer <ddkilzer@apple.com> 2 31 -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r118402 r118631 168 168 ASSERT(documentLoader()->timing()->redirectCount()); 169 169 handle()->cancel(); 170 handle DataLoadSoon(request);170 handleSubstituteDataLoadSoon(request); 171 171 } 172 172 … … 607 607 } 608 608 609 void MainResourceLoader::handle DataLoadSoon(const ResourceRequest& r)609 void MainResourceLoader::handleSubstituteDataLoadSoon(const ResourceRequest& r) 610 610 { 611 611 m_initialRequest = r; … … 643 643 resourceLoadScheduler()->addMainResourceLoad(this); 644 644 if (m_substituteData.isValid()) 645 handle DataLoadSoon(r);645 handleSubstituteDataLoadSoon(r); 646 646 else if (shouldLoadEmpty || frameLoader()->client()->representationExistsForURLScheme(url.protocol())) 647 647 handleEmptyLoad(url, !shouldLoadEmpty); … … 697 697 return; 698 698 699 if (m_substituteData.isValid() && m_documentLoader->deferMainResourceDataLoad()) 700 startDataLoadTimer(); 701 else { 702 ResourceRequest r(m_initialRequest); 703 m_initialRequest = ResourceRequest(); 704 loadNow(r); 705 } 706 } 707 } 708 709 } 699 ResourceRequest initialRequest(m_initialRequest); 700 m_initialRequest = ResourceRequest(); 701 loadNow(initialRequest); 702 } 703 } 704 705 } -
trunk/Source/WebCore/loader/MainResourceLoader.h
r117181 r118631 85 85 86 86 void handleEmptyLoad(const KURL&, bool forURLScheme); 87 void handle DataLoadSoon(const ResourceRequest& r);87 void handleSubstituteDataLoadSoon(const ResourceRequest&); 88 88 89 89 void startDataLoadTimer(); -
trunk/Tools/ChangeLog
r118628 r118631 1 2012-05-27 Benjamin Poulain <bpoulain@apple.com> 2 3 When pages are loaded from AppCache with DeferredLoading, willSendRequest() is never called 4 https://bugs.webkit.org/show_bug.cgi?id=87582 5 6 Reviewed by Darin Adler. 7 8 Extend DumpRenderTree to support loading the main resource deferred with a delay. This makes it 9 possible to test pages in a similar way as they are loaded in Browsers. 10 11 * DumpRenderTree/LayoutTestController.cpp: 12 (LayoutTestController::LayoutTestController): 13 (setUseDeferredFrameLoadingCallback): 14 (LayoutTestController::staticFunctions): 15 * DumpRenderTree/LayoutTestController.h: 16 (LayoutTestController::useDeferredFrameLoading): 17 (LayoutTestController::setUseDeferredFrameLoading): 18 (LayoutTestController): 19 * DumpRenderTree/mac/FrameLoadDelegate.mm: 20 (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): 21 1 22 2012-05-27 David Barton <dbarton@mathscribe.com> 2 23 -
trunk/Tools/DumpRenderTree/LayoutTestController.cpp
r118331 r118631 90 90 , m_isPrinting(false) 91 91 , m_deferMainResourceDataLoad(true) 92 , m_useDeferredFrameLoading(false) 92 93 , m_shouldPaintBrokenImage(true) 93 94 , m_shouldStayOnPageAfterHandlingBeforeUnload(false) … … 1228 1229 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 1229 1230 controller->setDefersLoading(JSValueToBoolean(context, arguments[0])); 1231 1232 return JSValueMakeUndefined(context); 1233 } 1234 1235 static JSValueRef setUseDeferredFrameLoadingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1236 { 1237 if (argumentCount < 1) 1238 return JSValueMakeUndefined(context); 1239 1240 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 1241 controller->setUseDeferredFrameLoading(JSValueToBoolean(context, arguments[0])); 1230 1242 1231 1243 return JSValueMakeUndefined(context); … … 2373 2385 { "setDeferMainResourceDataLoad", setDeferMainResourceDataLoadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2374 2386 { "setDefersLoading", setDefersLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2387 { "setUseDeferredFrameLoading", setUseDeferredFrameLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2375 2388 { "setDomainRelaxationForbiddenForURLScheme", setDomainRelaxationForbiddenForURLSchemeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2376 2389 { "setFrameFlatteningEnabled", setFrameFlatteningEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/LayoutTestController.h
r118331 r118631 283 283 void setDeferMainResourceDataLoad(bool flag) { m_deferMainResourceDataLoad = flag; } 284 284 285 bool useDeferredFrameLoading() const { return m_useDeferredFrameLoading; } 286 void setUseDeferredFrameLoading(bool flag) { m_useDeferredFrameLoading = flag; } 287 285 288 const std::string& testPathOrURL() const { return m_testPathOrURL; } 286 289 const std::string& expectedPixelHash() const { return m_expectedPixelHash; } … … 413 416 bool m_isPrinting; 414 417 bool m_deferMainResourceDataLoad; 418 bool m_useDeferredFrameLoading; 415 419 bool m_shouldPaintBrokenImage; 416 420 bool m_shouldStayOnPageAfterHandlingBeforeUnload; -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r118018 r118631 526 526 527 527 [webView setContinuousSpellCheckingEnabled:YES]; 528 [webView setDefersCallbacks:NO]; 528 529 [webView setGrammarCheckingEnabled:YES]; 529 530 [webView setInteractiveFormValidationEnabled:YES]; -
trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
r110032 r118631 174 174 [frame stopLoading]; 175 175 } 176 177 if (!done && gLayoutTestController->useDeferredFrameLoading()) { 178 [sender setDefersCallbacks:YES]; 179 NSTimeInterval deferredWaitTime = 5 * NSEC_PER_MSEC; 180 dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, deferredWaitTime); 181 dispatch_after(when, dispatch_get_main_queue(), ^{ 182 [sender setDefersCallbacks:NO]; 183 }); 184 } 176 185 } 177 186
Note:
See TracChangeset
for help on using the changeset viewer.