Changeset 191636 in webkit
- Timestamp:
- Oct 27, 2015 1:41:34 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r191635 r191636 1 2015-10-27 Alex Christensen <achristensen@webkit.org> 2 3 Cancel navigation policy checks like we do content policy checks. 4 https://bugs.webkit.org/show_bug.cgi?id=150582 5 rdar://problem/22077579 6 7 Reviewed by Brent Fulgham. 8 9 This was verified manually and I'll write a layout test for it soon. 10 11 * loader/DocumentLoader.cpp: 12 (WebCore::DocumentLoader::DocumentLoader): 13 (WebCore::DocumentLoader::~DocumentLoader): 14 (WebCore::DocumentLoader::willSendRequest): 15 (WebCore::DocumentLoader::continueAfterNavigationPolicy): 16 (WebCore::DocumentLoader::cancelPolicyCheckIfNeeded): 17 * loader/DocumentLoader.h: 18 Add a bool to keep track of whether we are waiting for navigation policy checks, like we do with content policy checks. 19 Without this check, sometimes callbacks are made to DocumentLoaders that do not exist any more because they do not get 20 cancelled by cancelPolicyCheckIfNeeded when detaching from the frame. 21 1 22 2015-10-27 Brady Eidson <beidson@apple.com> 2 23 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r191369 r191636 143 143 , m_identifierForLoadWithoutResourceLoader(0) 144 144 , m_dataLoadTimer(*this, &DocumentLoader::handleSubstituteDataLoadNow) 145 , m_waitingForContentPolicy(false)146 145 , m_subresourceLoadersArePageCacheAcceptable(false) 147 146 , m_applicationCacheHost(std::make_unique<ApplicationCacheHost>(*this)) … … 168 167 ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || !isLoading()); 169 168 ASSERT_WITH_MESSAGE(!m_waitingForContentPolicy, "The content policy callback should never outlive its DocumentLoader."); 169 ASSERT_WITH_MESSAGE(!m_waitingForNavigationPolicy, "The navigation policy callback should never outlive its DocumentLoader."); 170 170 if (m_iconLoadDecisionCallback) 171 171 m_iconLoadDecisionCallback->invalidate(); … … 571 571 return; 572 572 573 ASSERT(!m_waitingForNavigationPolicy); 574 m_waitingForNavigationPolicy = true; 573 575 frameLoader()->policyChecker().checkNavigationPolicy(newRequest, [this](const ResourceRequest& request, PassRefPtr<FormState>, bool shouldContinue) { 574 576 continueAfterNavigationPolicy(request, shouldContinue); … … 578 580 void DocumentLoader::continueAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue) 579 581 { 582 ASSERT(m_waitingForNavigationPolicy); 583 m_waitingForNavigationPolicy = false; 580 584 if (!shouldContinue) 581 585 stopLoadingForPolicyChange(); … … 1486 1490 RELEASE_ASSERT(frameLoader()); 1487 1491 1488 if (m_waitingForContentPolicy ) {1492 if (m_waitingForContentPolicy || m_waitingForNavigationPolicy) { 1489 1493 frameLoader()->policyChecker().cancelCheck(); 1490 1494 m_waitingForContentPolicy = false; 1495 m_waitingForNavigationPolicy = false; 1491 1496 } 1492 1497 } -
trunk/Source/WebCore/loader/DocumentLoader.h
r190510 r191636 321 321 322 322 void continueAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue); 323 324 323 void continueAfterContentPolicy(PolicyAction); 325 324 … … 433 432 434 433 DocumentLoaderTimer m_dataLoadTimer; 435 bool m_waitingForContentPolicy; 434 bool m_waitingForContentPolicy { false }; 435 bool m_waitingForNavigationPolicy { false }; 436 436 437 437 RefPtr<IconLoadDecisionCallback> m_iconLoadDecisionCallback;
Note: See TracChangeset
for help on using the changeset viewer.