WebKit Bugzilla
Attachment 371562 Details for
Bug 196930
: process-swap-on-navigation error when loading blocked websites
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Part 1
bug-196930-20190606223800.patch (text/plain), 6.59 KB, created by
Andy Estes
on 2019-06-06 22:38:00 PDT
(
hide
)
Description:
Part 1
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2019-06-06 22:38:00 PDT
Size:
6.59 KB
patch
obsolete
>Subversion Revision: 246154 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8fc6d372cdd63bad4c46895b67ba9fe8d316d235..912b7aac7f936f4c53d1dd2361907dd3ee062d2b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2019-06-06 Andy Estes <aestes@apple.com> >+ >+ process-swap-on-navigation error when loading blocked website on iOS 12.2 only. >+ https://bugs.webkit.org/show_bug.cgi?id=196930 >+ <rdar://problem/47819301> >+ >+ Reviewed by Chris Dumez. >+ >+ When the content filter blocks a navigation, it will continue to load the content filter >+ error page in the provisional web process. When dispatching didFailProvisionalLoad, we need >+ to specify WillContinueLoading::Yes so that WebKit presents the error page rather than >+ switching back to the committed web process. >+ >+ Testing blocked by <https://webkit.org/b/198626>. >+ >+ * loader/ContentFilter.cpp: >+ (WebCore::ContentFilter::willHandleProvisionalLoadFailure): >+ (WebCore::ContentFilter::handleProvisionalLoadFailure): >+ * loader/ContentFilter.h: >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::dispatchDidFailProvisionalLoad): >+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame): >+ * loader/FrameLoader.h: >+ > 2019-06-06 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Layout and preferred width computation should both call placeInlineItems(). >diff --git a/Source/WebCore/loader/ContentFilter.cpp b/Source/WebCore/loader/ContentFilter.cpp >index 628d51d2024cf079515c9cc5e8faa3b16aa22227..51d77e4af1dbddf045a92c1c8ad3b99eaceb97b5 100644 >--- a/Source/WebCore/loader/ContentFilter.cpp >+++ b/Source/WebCore/loader/ContentFilter.cpp >@@ -274,15 +274,21 @@ bool ContentFilter::continueAfterSubstituteDataRequest(const DocumentLoader& act > return true; > } > >-void ContentFilter::handleProvisionalLoadFailure(const ResourceError& error) >+bool ContentFilter::willHandleProvisionalLoadFailure(const ResourceError& error) const > { > if (m_state != State::Blocked) >- return; >+ return false; > > if (m_blockedError.errorCode() != error.errorCode() || m_blockedError.domain() != error.domain()) >- return; >+ return false; > > ASSERT(m_blockedError.failingURL() == error.failingURL()); >+ return true; >+} >+ >+void ContentFilter::handleProvisionalLoadFailure(const ResourceError& error) >+{ >+ ASSERT(willHandleProvisionalLoadFailure(error)); > > RefPtr<SharedBuffer> replacementData { m_blockingContentFilter->replacementData() }; > ResourceResponse response { URL(), "text/html"_s, static_cast<long long>(replacementData->size()), "UTF-8"_s }; >diff --git a/Source/WebCore/loader/ContentFilter.h b/Source/WebCore/loader/ContentFilter.h >index 23ed0482e2b391c9947b4ece3ebc7590edce8536..81e87b3327b9ca078e000dbecb55b89ef0564063 100644 >--- a/Source/WebCore/loader/ContentFilter.h >+++ b/Source/WebCore/loader/ContentFilter.h >@@ -62,6 +62,7 @@ public: > bool continueAfterNotifyFinished(CachedResource&); > > static bool continueAfterSubstituteDataRequest(const DocumentLoader& activeLoader, const SubstituteData&); >+ bool willHandleProvisionalLoadFailure(const ResourceError&) const; > void handleProvisionalLoadFailure(const ResourceError&); > > private: >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index af88cd7aa469c4b44dc149e5acff4bf8ff0779a7..8f49ee2237a120acc8766a54a94641766eea1e99 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -2427,6 +2427,35 @@ CachePolicy FrameLoader::subresourceCachePolicy(const URL& url) const > return CachePolicyVerify; > } > >+void FrameLoader::dispatchDidFailProvisionalLoad(DocumentLoader& provisionalDocumentLoader, const ResourceError& error) >+{ >+ m_provisionalLoadErrorBeingHandledURL = provisionalDocumentLoader.url(); >+ >+#if ENABLE(CONTENT_FILTERING) >+ auto contentFilter = provisionalDocumentLoader.contentFilter(); >+ auto contentFilterWillContinueLoading = false; >+#endif >+ >+ auto willContinueLoading = WillContinueLoading::No; >+ if (history().provisionalItem()) >+ willContinueLoading = WillContinueLoading::Yes; >+#if ENABLE(CONTENT_FILTERING) >+ if (contentFilter && contentFilter->willHandleProvisionalLoadFailure(error)) { >+ willContinueLoading = WillContinueLoading::Yes; >+ contentFilterWillContinueLoading = true; >+ } >+#endif >+ >+ m_client.dispatchDidFailProvisionalLoad(error, willContinueLoading); >+ >+#if ENABLE(CONTENT_FILTERING) >+ if (contentFilterWillContinueLoading) >+ contentFilter->handleProvisionalLoadFailure(error); >+#endif >+ >+ m_provisionalLoadErrorBeingHandledURL = { }; >+} >+ > void FrameLoader::checkLoadCompleteForThisFrame() > { > ASSERT(m_client.hasWebView()); >@@ -2465,15 +2494,8 @@ void FrameLoader::checkLoadCompleteForThisFrame() > bool shouldReset = !history().provisionalItem(); > if (!pdl->isLoadingInAPISense() || pdl->isStopping()) { > RELEASE_LOG_IF_ALLOWED("checkLoadCompleteForThisFrame: Failed provisional load (frame = %p, main = %d, isTimeout = %d, isCancellation = %d, errorCode = %d)", &m_frame, m_frame.isMainFrame(), error.isTimeout(), error.isCancellation(), error.errorCode()); >- m_provisionalLoadErrorBeingHandledURL = m_provisionalDocumentLoader->url(); >- >- m_client.dispatchDidFailProvisionalLoad(error, history().provisionalItem() ? WillContinueLoading::Yes : WillContinueLoading::No); >-#if ENABLE(CONTENT_FILTERING) >- if (auto contentFilter = pdl->contentFilter()) >- contentFilter->handleProvisionalLoadFailure(error); >-#endif >- m_provisionalLoadErrorBeingHandledURL = { }; > >+ dispatchDidFailProvisionalLoad(*pdl, error); > ASSERT(!pdl->isLoading()); > > // If we're in the middle of loading multipart data, we need to restore the document loader. >diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h >index 1efaa12e3dc952771b5b0c06106daf66e0631a57..f8d4da6cc46642a8a773140433bbaf16d22833a4 100644 >--- a/Source/WebCore/loader/FrameLoader.h >+++ b/Source/WebCore/loader/FrameLoader.h >@@ -361,6 +361,7 @@ private: > bool shouldPerformFragmentNavigation(bool isFormSubmission, const String& httpMethod, FrameLoadType, const URL&); > void scrollToFragmentWithParentBoundary(const URL&, bool isNewNavigation = true); > >+ void dispatchDidFailProvisionalLoad(DocumentLoader& provisionalDocumentLoader, const ResourceError&); > void checkLoadCompleteForThisFrame(); > > void setDocumentLoader(DocumentLoader*);
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 196930
:
367477
|
367537
|
367541
|
367542
|
367559
|
367584
|
371531
| 371562 |
371563