WebKit Bugzilla
Attachment 360882 Details for
Bug 193740
: REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193740-20190201121054.patch (text/plain), 26.04 KB, created by
Chris Dumez
on 2019-02-01 12:10:55 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-02-01 12:10:55 PST
Size:
26.04 KB
patch
obsolete
>Subversion Revision: 240817 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3849c9970edd9c8b4847ba6f2de3c3cf634351a6..0721b4ba81065261d304536cb8c67fe03b9ab5e6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2019-02-01 Chris Dumez <cdumez@apple.com> >+ >+ REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html >+ https://bugs.webkit.org/show_bug.cgi?id=193740 >+ <rdar://problem/47527267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * loader/DocumentLoader.cpp: >+ (WebCore::DocumentLoader::willSendRequest): >+ (WebCore::DocumentLoader::continueAfterContentPolicy): >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::loadURL): >+ (WebCore::FrameLoader::loadWithDocumentLoader): >+ (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): >+ * loader/FrameLoader.h: >+ * loader/FrameLoaderTypes.h: >+ * loader/PolicyChecker.cpp: >+ (WebCore::PolicyChecker::checkNavigationPolicy): >+ (WebCore::PolicyChecker::checkNewWindowPolicy): >+ * loader/PolicyChecker.h: >+ > 2019-01-31 Keith Rollin <krollin@apple.com> > > WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 65ddd17ceca764b1bac0ead00955141228a82fd1..39e7ba1ead70622454676cfad6132ca5ac27d4ef 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,26 @@ >+2019-02-01 Chris Dumez <cdumez@apple.com> >+ >+ REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html >+ https://bugs.webkit.org/show_bug.cgi?id=193740 >+ <rdar://problem/47527267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to >+ start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess. >+ Getting such IPC after a provisional load has started would mess up our state machine and trip assertions. >+ >+ This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame() >+ / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old >+ process when the load is continuing in a new process, instead of sending it "Ignore". >+ >+ * NetworkProcess/NetworkDataTaskBlob.cpp: >+ (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: >+ (toNSURLSessionResponseDisposition): >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::receivedNavigationPolicyDecision): >+ > 2019-01-31 Per Arne Vollan <pvollan@apple.com> > > [macOS] Disable permissive call logging in sandbox >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 135d29e4212ff1f01f4c7d34aff70673208adce1..eb6230434a3151c32134087afde9bbc11e7e6f00 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -645,13 +645,14 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc > if (!didReceiveRedirectResponse) > return completionHandler(WTFMove(newRequest)); > >- auto navigationPolicyCompletionHandler = [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request, WeakPtr<FormState>&&, ShouldContinue shouldContinue) mutable { >+ auto navigationPolicyCompletionHandler = [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request, WeakPtr<FormState>&&, NavigationPolicyDecision navigationPolicyDecision) mutable { > m_waitingForNavigationPolicy = false; >- switch (shouldContinue) { >- case ShouldContinue::No: >+ switch (navigationPolicyDecision) { >+ case NavigationPolicyDecision::IgnoreLoad: >+ case NavigationPolicyDecision::StopAllLoads: > stopLoadingForPolicyChange(); > break; >- case ShouldContinue::Yes: >+ case NavigationPolicyDecision::ContinueLoad: > break; > } > >@@ -935,6 +936,8 @@ void DocumentLoader::continueAfterContentPolicy(PolicyAction policy) > static_cast<ResourceLoader*>(mainResourceLoader())->didFail(interruptedForPolicyChangeError()); > return; > } >+ case PolicyAction::StopAllLoads: >+ ASSERT_NOT_REACHED(); > case PolicyAction::Ignore: > if (ResourceLoader* mainResourceLoader = this->mainResourceLoader()) > InspectorInstrumentation::continueWithPolicyIgnore(*m_frame, mainResourceLoader->identifier(), *this, m_response); >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 0a0d7e77f7b3259266ad593cbcce702920f81066..2efd1761ca074b27cb5549828beec1a3ee59b253 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -1398,8 +1398,8 @@ void FrameLoader::loadURL(FrameLoadRequest&& frameLoadRequest, const String& ref > oldDocumentLoader->setLastCheckedRequest(ResourceRequest()); > policyChecker().stopCheck(); > policyChecker().setLoadType(newLoadType); >- policyChecker().checkNavigationPolicy(WTFMove(request), ResourceResponse { } /* redirectResponse */, oldDocumentLoader.get(), WTFMove(formState), [this, protectedFrame = makeRef(m_frame)] (const ResourceRequest& request, WeakPtr<FormState>&&, ShouldContinue shouldContinue) { >- continueFragmentScrollAfterNavigationPolicy(request, shouldContinue == ShouldContinue::Yes); >+ policyChecker().checkNavigationPolicy(WTFMove(request), ResourceResponse { } /* redirectResponse */, oldDocumentLoader.get(), WTFMove(formState), [this, protectedFrame = makeRef(m_frame)] (const ResourceRequest& request, WeakPtr<FormState>&&, NavigationPolicyDecision navigationPolicyDecision) { >+ continueFragmentScrollAfterNavigationPolicy(request, navigationPolicyDecision == NavigationPolicyDecision::ContinueLoad); > }, PolicyDecisionMode::Synchronous); > return; > } >@@ -1595,8 +1595,8 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t > oldDocumentLoader->setTriggeringAction(WTFMove(action)); > oldDocumentLoader->setLastCheckedRequest(ResourceRequest()); > policyChecker().stopCheck(); >- policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, oldDocumentLoader.get(), WTFMove(formState), [this, protectedFrame = makeRef(m_frame)] (const ResourceRequest& request, WeakPtr<FormState>&&, ShouldContinue shouldContinue) { >- continueFragmentScrollAfterNavigationPolicy(request, shouldContinue == ShouldContinue::Yes); >+ policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, oldDocumentLoader.get(), WTFMove(formState), [this, protectedFrame = makeRef(m_frame)] (const ResourceRequest& request, WeakPtr<FormState>&&, NavigationPolicyDecision navigationPolicyDecision) { >+ continueFragmentScrollAfterNavigationPolicy(request, navigationPolicyDecision == NavigationPolicyDecision::ContinueLoad); > }, PolicyDecisionMode::Synchronous); > return; > } >@@ -1617,7 +1617,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t > // a new URL, the parent frame shouldn't learn the URL. > if (!m_stateMachine.committedFirstRealDocumentLoad() > && !ownerElement->dispatchBeforeLoadEvent(loader->request().url().string())) { >- continueLoadAfterNavigationPolicy(loader->request(), formState.get(), ShouldContinue::No, allowNavigationToInvalidURL); >+ continueLoadAfterNavigationPolicy(loader->request(), formState.get(), NavigationPolicyDecision::IgnoreLoad, allowNavigationToInvalidURL); > return; > } > } >@@ -1625,12 +1625,12 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t > m_frame.navigationScheduler().cancel(NewLoadInProgress::Yes); > > if (shouldTreatCurrentLoadAsContinuingLoad()) { >- continueLoadAfterNavigationPolicy(loader->request(), formState.get(), ShouldContinue::Yes, allowNavigationToInvalidURL); >+ continueLoadAfterNavigationPolicy(loader->request(), formState.get(), NavigationPolicyDecision::ContinueLoad, allowNavigationToInvalidURL); > return; > } > >- policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTFMove(formState), [this, protectedFrame = makeRef(m_frame), allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr<FormState>&& formState, ShouldContinue shouldContinue) mutable { >- continueLoadAfterNavigationPolicy(request, formState.get(), shouldContinue, allowNavigationToInvalidURL); >+ policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTFMove(formState), [this, protectedFrame = makeRef(m_frame), allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr<FormState>&& formState, NavigationPolicyDecision navigationPolicyDecision) mutable { >+ continueLoadAfterNavigationPolicy(request, formState.get(), navigationPolicyDecision, allowNavigationToInvalidURL); > completionHandler(); > }, PolicyDecisionMode::Asynchronous); > } >@@ -3357,7 +3357,7 @@ bool FrameLoader::dispatchBeforeUnloadEvent(Chrome& chrome, FrameLoader* frameLo > return chrome.runBeforeUnloadConfirmPanel(text, m_frame); > } > >-void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& request, FormState* formState, ShouldContinue shouldContinue, AllowNavigationToInvalidURL allowNavigationToInvalidURL) >+void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& request, FormState* formState, NavigationPolicyDecision navigationPolicyDecision, AllowNavigationToInvalidURL allowNavigationToInvalidURL) > { > // If we loaded an alternate page to replace an unreachableURL, we'll get in here with a > // nil policyDataSource because loading the alternate page will have passed >@@ -3367,7 +3367,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque > bool isTargetItem = history().provisionalItem() ? history().provisionalItem()->isTargetItem() : false; > > bool urlIsDisallowed = allowNavigationToInvalidURL == AllowNavigationToInvalidURL::No && !request.url().isValid(); >- bool canContinue = shouldContinue != ShouldContinue::No && shouldClose() && !urlIsDisallowed; >+ bool canContinue = navigationPolicyDecision == NavigationPolicyDecision::ContinueLoad && shouldClose() && !urlIsDisallowed; > > if (!canContinue) { > RELEASE_LOG_IF_ALLOWED("continueLoadAfterNavigationPolicy: can't continue loading frame due to the following reasons (" >@@ -3375,12 +3375,12 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque > "main = %d, " > "allowNavigationToInvalidURL = %d, " > "requestURLIsValid = %d, " >- "shouldContinue = %d)", >+ "navigationPolicyDecision = %d)", > &m_frame, > m_frame.isMainFrame(), > static_cast<int>(allowNavigationToInvalidURL), > request.url().isValid(), >- static_cast<int>(shouldContinue)); >+ static_cast<int>(navigationPolicyDecision)); > > // If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we > // need to report that the client redirect was cancelled. >@@ -3388,9 +3388,16 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque > if (m_quickRedirectComing) > clientRedirectCancelledOrFinished(NewLoadInProgress::No); > >+ if (navigationPolicyDecision == NavigationPolicyDecision::StopAllLoads) { >+ stopAllLoaders(); >+ m_checkTimer.stop(); >+ } >+ > setPolicyDocumentLoader(nullptr); > checkCompleted(); >- checkLoadComplete(); >+ >+ if (navigationPolicyDecision != NavigationPolicyDecision::StopAllLoads) >+ checkLoadComplete(); > > // If the navigation request came from the back/forward menu, and we punt on it, we have the > // problem that we have optimistically moved the b/f cursor already, so move it back. For sanity, >diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h >index c37c4403bc8596735e98aea60be202049e50d954..a5845670ccd58bd60644d1201f24335ae5793d57 100644 >--- a/Source/WebCore/loader/FrameLoader.h >+++ b/Source/WebCore/loader/FrameLoader.h >@@ -84,6 +84,7 @@ class SubstituteData; > > enum class NewLoadInProgress : bool; > enum class ShouldContinue; >+enum class NavigationPolicyDecision : uint8_t; > enum class ShouldTreatAsContinuingLoad : bool; > > struct WindowFeatures; >@@ -348,7 +349,7 @@ private: > bool dispatchBeforeUnloadEvent(Chrome&, FrameLoader* frameLoaderBeingNavigated); > void dispatchUnloadEvents(UnloadEventPolicy); > >- void continueLoadAfterNavigationPolicy(const ResourceRequest&, FormState*, ShouldContinue, AllowNavigationToInvalidURL); >+ void continueLoadAfterNavigationPolicy(const ResourceRequest&, FormState*, NavigationPolicyDecision, AllowNavigationToInvalidURL); > void continueLoadAfterNewWindowPolicy(const ResourceRequest&, FormState*, const String& frameName, const NavigationAction&, ShouldContinue, AllowNavigationToInvalidURL, NewFrameOpenerPolicy); > void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue); > >diff --git a/Source/WebCore/loader/FrameLoaderTypes.h b/Source/WebCore/loader/FrameLoaderTypes.h >index 1250239ca6145ac5df7bb5ba41c556799d6b969f..39192c9d63ee755e82f0db7503b1cca97257d262 100644 >--- a/Source/WebCore/loader/FrameLoaderTypes.h >+++ b/Source/WebCore/loader/FrameLoaderTypes.h >@@ -44,6 +44,7 @@ enum class PolicyAction : uint8_t { > Use, > Download, > Ignore, >+ StopAllLoads > }; > > enum class ReloadOption : uint8_t { >@@ -152,7 +153,8 @@ template<> struct EnumTraits<WebCore::PolicyAction> { > WebCore::PolicyAction, > WebCore::PolicyAction::Use, > WebCore::PolicyAction::Download, >- WebCore::PolicyAction::Ignore >+ WebCore::PolicyAction::Ignore, >+ WebCore::PolicyAction::StopAllLoads > >; > }; > >diff --git a/Source/WebCore/loader/PolicyChecker.cpp b/Source/WebCore/loader/PolicyChecker.cpp >index 1f4bd250a00c99c012764c300d5dc2562688dd3e..ecaf22e8f23ead668175f4cd9dfb575acc04169b 100644 >--- a/Source/WebCore/loader/PolicyChecker.cpp >+++ b/Source/WebCore/loader/PolicyChecker.cpp >@@ -113,7 +113,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > // Don't ask more than once for the same request or if we are loading an empty URL. > // This avoids confusion on the part of the client. > if (equalIgnoringHeaderFields(request, loader->lastCheckedRequest()) || (!request.isNull() && request.url().isEmpty())) { >- function(ResourceRequest(request), { }, ShouldContinue::Yes); >+ function(ResourceRequest(request), { }, NavigationPolicyDecision::ContinueLoad); > loader->setLastCheckedRequest(WTFMove(request)); > return; > } >@@ -128,7 +128,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > #endif > if (isBackForwardLoadType(m_loadType)) > m_loadType = FrameLoadType::Reload; >- function(WTFMove(request), { }, shouldContinue ? ShouldContinue::Yes : ShouldContinue::No); >+ function(WTFMove(request), { }, shouldContinue ? NavigationPolicyDecision::ContinueLoad : NavigationPolicyDecision::IgnoreLoad); > return; > } > >@@ -138,7 +138,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > // reveal that the frame was blocked. This way, it looks like any other cross-origin page load. > m_frame.ownerElement()->dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No)); > } >- function(WTFMove(request), { }, ShouldContinue::No); >+ function(WTFMove(request), { }, NavigationPolicyDecision::IgnoreLoad); > return; > } > >@@ -151,7 +151,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > #if USE(QUICK_LOOK) > // Always allow QuickLook-generated URLs based on the protocol scheme. > if (!request.isNull() && isQuickLookPreviewURL(request.url())) >- return function(WTFMove(request), makeWeakPtr(formState.get()), ShouldContinue::Yes); >+ return function(WTFMove(request), makeWeakPtr(formState.get()), NavigationPolicyDecision::ContinueLoad); > #endif > > #if ENABLE(CONTENT_FILTERING) >@@ -161,7 +161,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > if (unblocked) > frame->loader().reload(); > }); >- return function({ }, nullptr, ShouldContinue::No); >+ return function({ }, nullptr, NavigationPolicyDecision::IgnoreLoad); > } > m_contentFilterUnblockHandler = { }; > #endif >@@ -181,13 +181,16 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > m_frame.loader().client().startDownload(request, suggestedFilename); > FALLTHROUGH; > case PolicyAction::Ignore: >- return function({ }, nullptr, ShouldContinue::No); >+ return function({ }, nullptr, NavigationPolicyDecision::IgnoreLoad); >+ case PolicyAction::StopAllLoads: >+ function({ }, nullptr, NavigationPolicyDecision::StopAllLoads); >+ return; > case PolicyAction::Use: > if (!m_frame.loader().client().canHandleRequest(request)) { > handleUnimplementablePolicy(m_frame.loader().client().cannotShowURLError(request)); >- return function({ }, { }, ShouldContinue::No); >+ return function({ }, { }, NavigationPolicyDecision::IgnoreLoad); > } >- return function(WTFMove(request), makeWeakPtr(formState.get()), ShouldContinue::Yes); >+ return function(WTFMove(request), makeWeakPtr(formState.get()), NavigationPolicyDecision::ContinueLoad); > } > ASSERT_NOT_REACHED(); > }); >@@ -211,6 +214,10 @@ void PolicyChecker::checkNewWindowPolicy(NavigationAction&& navigationAction, Re > case PolicyAction::Ignore: > function({ }, nullptr, { }, { }, ShouldContinue::No); > return; >+ case PolicyAction::StopAllLoads: >+ ASSERT_NOT_REACHED(); >+ function({ }, nullptr, { }, { }, ShouldContinue::No); >+ return; > case PolicyAction::Use: > function(request, makeWeakPtr(formState.get()), frameName, navigationAction, ShouldContinue::Yes); > return; >diff --git a/Source/WebCore/loader/PolicyChecker.h b/Source/WebCore/loader/PolicyChecker.h >index d7fd7b3fb17a5821cd31457b298b502e26b0d73e..0ef1e6e5731cfa5cb6ed7eae5b27a29c5c93ae2a 100644 >--- a/Source/WebCore/loader/PolicyChecker.h >+++ b/Source/WebCore/loader/PolicyChecker.h >@@ -57,10 +57,16 @@ enum class ShouldContinue { > No > }; > >+enum class NavigationPolicyDecision : uint8_t { >+ ContinueLoad, >+ IgnoreLoad, >+ StopAllLoads, >+}; >+ > enum class PolicyDecisionMode { Synchronous, Asynchronous }; > > using NewWindowPolicyDecisionFunction = CompletionHandler<void(const ResourceRequest&, WeakPtr<FormState>&&, const String& frameName, const NavigationAction&, ShouldContinue)>; >-using NavigationPolicyDecisionFunction = CompletionHandler<void(ResourceRequest&&, WeakPtr<FormState>&&, ShouldContinue)>; >+using NavigationPolicyDecisionFunction = CompletionHandler<void(ResourceRequest&&, WeakPtr<FormState>&&, NavigationPolicyDecision)>; > > class PolicyChecker { > WTF_MAKE_NONCOPYABLE(PolicyChecker); >diff --git a/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp b/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >index 2427b1562bada47a8f5c7ec8281586c67b04e7b0..df2afec14457709e5e7095e5955bdbebf2ea3923 100644 >--- a/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >@@ -312,6 +312,9 @@ void NetworkDataTaskBlob::dispatchDidReceiveResponse(Error errorCode) > m_buffer.resize(bufferSize); > read(); > break; >+ case PolicyAction::StopAllLoads: >+ ASSERT_NOT_REACHED(); >+ break; > case PolicyAction::Ignore: > break; > case PolicyAction::Download: >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index ec523b6b188f0cd52944ad7bf53367fae06306c9..1ec14ccd71b0540e04666c1258a5e8df8a815cfb 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -61,6 +61,8 @@ CFStringRef const WebKit2HTTPSProxyDefaultsKey = static_cast<CFStringRef>(@"WebK > static NSURLSessionResponseDisposition toNSURLSessionResponseDisposition(WebCore::PolicyAction disposition) > { > switch (disposition) { >+ case WebCore::PolicyAction::StopAllLoads: >+ ASSERT_NOT_REACHED(); > case WebCore::PolicyAction::Ignore: > return NSURLSessionResponseCancel; > case WebCore::PolicyAction::Use: >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index c7e09d82166912f2561c82a38a631ed378c00127..68beb0428481a7dae49ed9441509742d2f99680a 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -2710,7 +2710,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, A > } > > if (processForNavigation.ptr() != &process()) { >- policyAction = PolicyAction::Ignore; >+ policyAction = PolicyAction::StopAllLoads; > RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "decidePolicyForNavigationAction, swapping process %i with process %i for navigation, reason: %{public}s", processIdentifier(), processForNavigation->processIdentifier(), reason.utf8().data()); > LOG(ProcessSwapping, "(ProcessSwapping) Switching from process %i to new process (%i) for navigation %" PRIu64 " '%s'", processIdentifier(), processForNavigation->processIdentifier(), navigation->navigationID(), navigation->loggingString()); > } else >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 94d62d51a48d32306973cee1efab792251bfa1e1..e4f2607266571b44af6c8e53ec9b12f40c087438 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-01 Chris Dumez <cdumez@apple.com> >+ >+ REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html >+ https://bugs.webkit.org/show_bug.cgi?id=193740 >+ <rdar://problem/47527267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add API test coverage. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: >+ > 2019-01-31 Alex Christensen <achristensen@webkit.org> > > Revert r238819 which is unneeded and caused a performance regression. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >index 7ee9eebb6ec4289e07e539c5194c26eff35dcbf4..f39e329e39ae8893d47d44fbad47ffa521101564 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >@@ -2491,6 +2491,53 @@ TEST(ProcessSwap, MainFramesOnly) > EXPECT_EQ(1u, seenPIDs.size()); > } > >+static const char* navigateBeforePageLoadEndBytes = R"PSONRESOURCE( >+<body> >+<a id="testLink" href="pson://www.apple.com/main.html">Link</a> >+<script> >+ testLink.click(); >+</script> >+<p>TEST</p> >+<script src="test.js"></script> >+<script src="test2.js"></script> >+<iframe src="subframe1.html></iframe> >+<iframe src="subframe2.html></iframe> >+<iframe src="subframe3.html></iframe> >+<iframe src="subframe4.html></iframe> >+</body> >+)PSONRESOURCE"; >+ >+TEST(ProcessSwap, NavigateCrossSiteBeforePageLoadEnd) >+{ >+ auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); >+ [processPoolConfiguration setProcessSwapsOnNavigation:YES]; >+ [processPoolConfiguration setPrewarmsProcessesAutomatically:YES]; >+ auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); >+ >+ auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ [webViewConfiguration setProcessPool:processPool.get()]; >+ auto handler = adoptNS([[PSONScheme alloc] init]); >+ [handler addMappingFromURLString:@"pson://www.webkit.org/main.html" toData:navigateBeforePageLoadEndBytes]; >+ [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; >+ >+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); >+ auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]); >+ [webView setNavigationDelegate:delegate.get()]; >+ >+ [webView configuration].preferences.safeBrowsingEnabled = NO; >+ >+ failed = false; >+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ EXPECT_FALSE(failed); >+ EXPECT_WK_STREQ(@"pson://www.apple.com/main.html", [[webView URL] absoluteString]); >+} >+ >+ > TEST(ProcessSwap, DoSameSiteNavigationAfterCrossSiteProvisionalLoadStarted) > { > auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193740
:
360882
|
360883