WebKit Bugzilla
Attachment 343726 Details for
Bug 187083
: Disable content blockers in NetworkLoadChecker except for ping loads
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-187083-20180627104430.patch (text/plain), 9.73 KB, created by
youenn fablet
on 2018-06-27 10:44:31 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-06-27 10:44:31 PDT
Size:
9.73 KB
patch
obsolete
>Subversion Revision: 233256 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bedae4ed85eff1a9009ccce18cdb03d0df476231..f784544dc6fe08b8f7b76a117115b460ec5f6111 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-27 Youenn Fablet <youenn@apple.com> >+ >+ Disable content blockers in NetworkLoadChecker except for ping loads >+ https://bugs.webkit.org/show_bug.cgi?id=187083 >+ <rdar://problem/41440083> >+ >+ Reviewed by Chris Dumez. >+ >+ Add internals API to reload a frame without content extensions. >+ >+ Test: http/tests/contentextensions/reload-without-contentextensions.html >+ >+ * testing/Internals.cpp: >+ (WebCore::Internals::reloadWithoutContentExtensions): >+ * testing/Internals.h: >+ * testing/Internals.idl: >+ > 2018-06-21 Emilio Cobos Ãlvarez <emilio@crisal.io> > > Move clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index dfd8848916637e45207cf62fcaf518b075a4c06c..a2309da5048b69f93453c3b8e58e1a8c65d50826 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-27 Youenn Fablet <youenn@apple.com> >+ >+ Disable content blockers in NetworkLoadChecker except for ping loads >+ https://bugs.webkit.org/show_bug.cgi?id=187083 >+ <rdar://problem/41440083> >+ >+ Reviewed by Chris Dumez. >+ >+ * NetworkProcess/NetworkLoadChecker.cpp: >+ (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): >+ * NetworkProcess/NetworkLoadChecker.h: >+ (WebKit::NetworkLoadChecker::enableContentExtensionsCheck): >+ * NetworkProcess/PingLoad.cpp: >+ > 2018-06-27 Tim Horton <timothy_horton@apple.com> > > When trying to print a very long email on iOS, the print preview is blank >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 080896b8c0853a42c7422862b133676f7812707a..9597b4aa01f82fe21d99f6cc033a695d77b94543 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -4608,5 +4608,11 @@ String Internals::ongoingLoadsDescriptions() const > builder.append(']'); > return builder.toString(); > } >+ >+void Internals::reloadWithoutContentExtensions() >+{ >+ if (auto* frame = this->frame()) >+ frame->loader().reload(ReloadOption::DisableContentBlockers); >+} > > } // namespace WebCore >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index 14e1b5729ffd126d12e60f81148e9c30395a1bf8..24bc810812649666955ecc1c46dda7b0c2f89c14 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -705,6 +705,8 @@ public: > void setCaptureExtraNetworkLoadMetricsEnabled(bool); > String ongoingLoadsDescriptions() const; > >+ void reloadWithoutContentExtensions(); >+ > private: > explicit Internals(Document&); > Document* contextDocument() const; >diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl >index 33e8aa5a1a1b3951456fa27e1b3e8e76d80bf552..827ee1257d74d692df90be232b12e09df2dcdaa0 100644 >--- a/Source/WebCore/testing/Internals.idl >+++ b/Source/WebCore/testing/Internals.idl >@@ -638,4 +638,6 @@ enum EventThrottlingBehavior { > > DOMString ongoingLoadsDescriptions(); > void setCaptureExtraNetworkLoadMetricsEnabled(boolean value); >+ >+ void reloadWithoutContentExtensions(); > }; >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp b/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp >index a6f96a68b1c534b576d259d3fc8b6a489f57a58d..b5c98f369676c6627f8bbe019255b86e4fece600 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp >@@ -384,7 +384,7 @@ ContentSecurityPolicy* NetworkLoadChecker::contentSecurityPolicy() > void NetworkLoadChecker::processContentExtensionRulesForLoad(ResourceRequest&& request, ContentExtensionCallback&& callback) > { > // FIXME: Enable content blockers for navigation loads. >- if (!m_userContentControllerIdentifier || m_options.mode == FetchOptions::Mode::Navigate) { >+ if (!m_checkContentExtensions || !m_userContentControllerIdentifier || m_options.mode == FetchOptions::Mode::Navigate) { > ContentExtensions::BlockedStatus status; > callback(ContentExtensionResult { WTFMove(request), status }); > return; >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >index b41910f00bb1435192b9586e76ccabc41522ece9..629373bba0c7d7bf37ff67da9ea5dabb645b2718 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >+++ b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >@@ -72,6 +72,8 @@ public: > WebCore::NetworkLoadInformation takeNetworkLoadInformation() { return WTFMove(m_loadInformation); } > void storeRedirectionIfNeeded(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); > >+ void enableContentExtensionsCheck() { m_checkContentExtensions = true; } >+ > private: > WebCore::ContentSecurityPolicy* contentSecurityPolicy(); > bool isChecking() const { return !!m_corsPreflightChecker; } >@@ -133,6 +135,7 @@ private: > WebCore::PreflightPolicy m_preflightPolicy; > String m_dntHeaderValue; > String m_referrer; >+ bool m_checkContentExtensions { false }; > bool m_shouldCaptureExtraNetworkLoadMetrics { false }; > WebCore::NetworkLoadInformation m_loadInformation; > }; >diff --git a/Source/WebKit/NetworkProcess/PingLoad.cpp b/Source/WebKit/NetworkProcess/PingLoad.cpp >index 0ef51416769d26b23e05ba6966ef43a9356dfca3..10ca19fe82cd33ebc698d25aabcfe34919c20416 100644 >--- a/Source/WebKit/NetworkProcess/PingLoad.cpp >+++ b/Source/WebKit/NetworkProcess/PingLoad.cpp >@@ -44,7 +44,7 @@ PingLoad::PingLoad(NetworkResourceLoadParameters&& parameters, NetworkConnection > , m_timeoutTimer(*this, &PingLoad::timeoutTimerFired) > , m_networkLoadChecker(makeUniqueRef<NetworkLoadChecker>(connection, m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier, FetchOptions { m_parameters.options}, m_parameters.sessionID, WTFMove(m_parameters.originalRequestHeaders), URL { m_parameters.request.url() }, m_parameters.sourceOrigin.copyRef(), m_parameters.preflightPolicy, m_parameters.request.httpReferrer())) > { >- >+ m_networkLoadChecker->enableContentExtensionsCheck(); > if (m_parameters.cspResponseHeaders) > m_networkLoadChecker->setCSPResponseHeaders(WTFMove(m_parameters.cspResponseHeaders.value())); > #if ENABLE(CONTENT_EXTENSIONS) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 0ef9b8a7f1a2390350a04e18c779249929c361ee..48dc967a61e6bd574c6b87956f748b0fcc95355a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-27 Youenn Fablet <youenn@apple.com> >+ >+ Disable content blockers in NetworkLoadChecker except for ping loads >+ https://bugs.webkit.org/show_bug.cgi?id=187083 >+ <rdar://problem/41440083> >+ >+ Reviewed by Chris Dumez. >+ >+ * http/tests/contentextensions/reload-without-contentextensions-expected.txt: Added. >+ * http/tests/contentextensions/reload-without-contentextensions.html: Added. >+ * http/tests/contentextensions/reload-without-contentextensions.html.json: Added. >+ > 2018-06-26 Youenn Fablet <youenn@apple.com> > > Import wpt CORP tests >diff --git a/LayoutTests/http/tests/contentextensions/reload-without-contentextensions-expected.txt b/LayoutTests/http/tests/contentextensions/reload-without-contentextensions-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..072a31a4ebfa9d7961aa71f93151cfa77f8ebdc7 >--- /dev/null >+++ b/LayoutTests/http/tests/contentextensions/reload-without-contentextensions-expected.txt >@@ -0,0 +1,2 @@ >+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/reload-without-contentextensions.html from loading a resource from http://localhost:8000/resources/square128.png >+PASS >diff --git a/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html b/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dd0b23dce4fa51befdbec7079a4511fbe68001f1 >--- /dev/null >+++ b/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html >@@ -0,0 +1,39 @@ >+<body> >+<script> >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} >+ >+function done(message) >+{ >+ document.body.innerHTML = message; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+} >+ >+if (!window.internals) >+ done("FAIL: need internals API"); >+ >+async function doTest(shouldFail) >+{ >+ const result = await fetch("resources/subresource-redirect.php", { mode : "no-cors" }).then(() => { >+ return !shouldFail; >+ }, () => { >+ return shouldFail; >+ }); >+ if (!result) { >+ done("FAIL: reloaded = " + localStorage.reloaded); >+ return; >+ } >+ if (!!localStorage.reloaded) { >+ done("PASS"); >+ return; >+ } >+ localStorage.reloaded = true; >+ internals.reloadWithoutContentExtensions(); >+} >+ >+doTest(!localStorage.reloaded); >+</script> >+</body> >diff --git a/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html.json b/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html.json >new file mode 100644 >index 0000000000000000000000000000000000000000..8549148678e70e261bcb4f888a2265b48958f8cf >--- /dev/null >+++ b/LayoutTests/http/tests/contentextensions/reload-without-contentextensions.html.json >@@ -0,0 +1,10 @@ >+[ >+ { >+ "action": { >+ "type": "block" >+ }, >+ "trigger": { >+ "url-filter": ".*square" >+ } >+ } >+]
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 187083
:
343689
| 343726