Changeset 76701 in webkit
- Timestamp:
- Jan 26, 2011 11:07:15 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76700 r76701 1 2011-01-25 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed byAntti Koivisto. 4 5 Crashes loading pages when cancelling subresource loads through WebKit 6 https://bugs.webkit.org/show_bug.cgi?id=53123 7 <rdar://problem/8914361> 8 9 Add tests for crashing when cancelling subresource loads through WebKit via setWillSendRequestReturnsNull. 10 11 * fast/loader/willSendRequest-null-for-preload-expected.txt: Added. 12 * fast/loader/willSendRequest-null-for-preload.html: Added. 13 1 14 2011-01-26 Ryosuke Niwa <rniwa@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r76699 r76701 1 2011-01-25 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Antti Koivisto. 4 5 Crashes loading pages when cancelling subresource loads through WebKit 6 https://bugs.webkit.org/show_bug.cgi?id=53123 7 <rdar://problem/8914361> 8 9 Fix a crash that happened when cancelling subresource loads through WebKit. 10 11 When a load is cancelled synchronously (via the WebKit client), CachedResourceLoader::requestResource 12 can be called recursively on the same function, either leading to infinite recursion, or deleting 13 an object when it is not done being used. 14 15 The fix for this was to call checkForPendingPreloads and servePendingRequests asynchronously when 16 CachedResourceLoader::loadDone was called synchronously (due to the load being cancelled synchronously). 17 18 Test: fast/loader/willSendRequest-null-for-preload.html 19 20 * loader/DocumentLoader.cpp: 21 (WebCore::DocumentLoader::setRequest): Only dispatch didReceiveServerRedirectForProvisionalLoadForFrame 22 if our new URL is non-null. 23 * loader/cache/CachedResourceLoader.cpp: 24 (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize our timer. 25 (WebCore::CachedResourceLoader::loadDone): If the CachedResource we were passed in was 0, that means this 26 function was called synchronously 27 from CachedResourceRequest::load, and we don't want to call into checkForPendingPreloads synchronously, 28 so put it on a 0-delay timer to make the calls to checkForPendingPreloads and servePendingRequests asynchronous. 29 (WebCore::CachedResourceLoader::loadDonePendingActionTimerFired): Call checkForPendingPreloads and servePendingRequests. 30 (WebCore::CachedResourceLoader::checkForPendingPreloads): m_pendingPreloads is now a Deque instead of a Vector, 31 so use Deque methods. 32 * loader/cache/CachedResourceLoader.h: Add the timer, the timer callback function, and make m_pendingPreloads a Deque. 33 1 34 2011-01-25 Pavel Podivilov <podivilov@chromium.org> 2 35 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r73436 r76701 169 169 m_request = req; 170 170 171 // Only send webView:didReceiveServerRedirectForProvisionalLoadForFrame: if URL changed .171 // Only send webView:didReceiveServerRedirectForProvisionalLoadForFrame: if URL changed (and is non-null). 172 172 // Also, don't send it when replacing unreachable URLs with alternate content. 173 if (!handlingUnreachableURL && oldURL != req.url())173 if (!handlingUnreachableURL && !req.url().isNull() && oldURL != req.url()) 174 174 frameLoader()->didReceiveServerRedirectForProvisionalLoadForFrame(); 175 175 } -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r75912 r76701 81 81 : m_document(document) 82 82 , m_requestCount(0) 83 , m_loadDoneActionTimer(this, &CachedResourceLoader::loadDoneActionTimerFired) 83 84 , m_autoLoadImages(true) 84 85 , m_loadFinishing(false) … … 520 521 if (frame()) 521 522 frame()->loader()->loadDone(); 523 524 if (!request) { 525 // If the request passed to this function is null, loadDone finished synchronously from when 526 // the load was started, so we want to kick off our next set of loads (via checkForPendingPreloads 527 // and servePendingRequests) asynchronously. 528 m_loadDoneActionTimer.startOneShot(0); 529 return; 530 } 531 532 performPostLoadActions(); 533 } 534 535 void CachedResourceLoader::loadDoneActionTimerFired(Timer<CachedResourceLoader>*) 536 { 537 performPostLoadActions(); 538 } 539 540 void CachedResourceLoader::performPostLoadActions() 541 { 522 542 checkForPendingPreloads(); 523 543 resourceLoadScheduler()->servePendingRequests(); … … 584 604 void CachedResourceLoader::checkForPendingPreloads() 585 605 { 586 unsigned count = m_pendingPreloads.size(); 587 if (!count || !m_document->body() || !m_document->body()->renderer()) 588 return; 589 for (unsigned i = 0; i < count; ++i) { 590 PendingPreload& preload = m_pendingPreloads[i]; 606 if (m_pendingPreloads.isEmpty() || !m_document->body() || !m_document->body()->renderer()) 607 return; 608 while (!m_pendingPreloads.isEmpty()) { 609 PendingPreload preload = m_pendingPreloads.takeFirst(); 591 610 // Don't request preload if the resource already loaded normally (this will result in double load if the page is being reloaded with cached results ignored). 592 611 if (!cachedResource(m_document->completeURL(preload.m_url))) -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.h
r76248 r76701 31 31 #include "CachePolicy.h" 32 32 #include "ResourceLoadPriority.h" 33 #include "Timer.h" 34 #include <wtf/Deque.h> 33 35 #include <wtf/HashMap.h> 34 36 #include <wtf/HashSet.h> … … 118 120 void notifyLoadedFromMemoryCache(CachedResource*); 119 121 bool canRequest(CachedResource::Type, const KURL&); 122 123 void loadDoneActionTimerFired(Timer<CachedResourceLoader>*); 124 125 void performPostLoadActions(); 120 126 121 127 HashSet<String> m_validatedURLs; … … 134 140 String m_charset; 135 141 }; 136 Vector<PendingPreload> m_pendingPreloads; 142 Deque<PendingPreload> m_pendingPreloads; 143 144 Timer<CachedResourceLoader> m_loadDoneActionTimer; 137 145 138 146 //29 bits left -
trunk/Source/WebKit2/ChangeLog
r76657 r76701 1 2011-01-25 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Antti Koivisto. 4 5 Crashes loading pages when cancelling subresource loads through WebKit 6 https://bugs.webkit.org/show_bug.cgi?id=53123 7 <rdar://problem/8914361> 8 9 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 10 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): If our URL is null, return early instead of dispatching 11 a message. 12 1 13 2011-01-25 Chris Fleizach <cfleizach@apple.com> 2 14 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r76608 r76701 618 618 uint64_t listenerID = m_frame->setUpPolicyListener(function); 619 619 const String& url = request.url().string(); // FIXME: Pass entire request. 620 if (!url) 621 return; 620 622 621 623 bool receivedPolicyAction;
Note: See TracChangeset
for help on using the changeset viewer.