WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-159085-20160624124759.patch (text/plain), 19.72 KB, created by
youenn fablet
on 2016-06-24 03:48:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2016-06-24 03:48:11 PDT
Size:
19.72 KB
patch
obsolete
>Subversion Revision: 202419 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8ab2aa21ff7b3bfce55f39915198c964e988b415..0c004e1721021e9676b90f5eb9f5e0138ff5cefc 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2016-06-24 Youenn Fablet <youennf@gmail.com> >+ >+ Remove didFailRedirectCheck ThreadableLoaderClient callback >+ https://bugs.webkit.org/show_bug.cgi?id=159085 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Removing didFailRedirectCheck and using didFailAccessControlCheck instead. >+ The change in behavior is that additional error messages are outputted in the console. >+ These messages give additional debugging information. >+ >+ Covered by rebased tests. >+ >+ * Modules/fetch/FetchLoader.cpp: Removing didFailRedirectCheck. >+ * Modules/fetch/FetchLoader.h: Ditto. >+ * inspector/InspectorNetworkAgent.cpp: Ditto. >+ * loader/DocumentThreadableLoader.cpp: >+ (WebCore::DocumentThreadableLoader::redirectReceived): Calling didFailAccessControlCheck with information on failing >+ URL. >+ (WebCore::DocumentThreadableLoader::loadRequest): Ditto. >+ * loader/ThreadableLoaderClient.h: Removing didFailRedirectCheck. >+ * loader/ThreadableLoaderClientWrapper.h: Ditto. >+ * loader/WorkerThreadableLoader.cpp: Ditto. >+ * loader/WorkerThreadableLoader.h: Ditto. >+ * page/EventSource.cpp: Ditto. >+ * page/EventSource.h: Ditto. >+ * workers/WorkerScriptLoader.cpp: Ditto. >+ * workers/WorkerScriptLoader.h: Ditto. >+ * xml/XMLHttpRequest.cpp: Ditto. >+ * xml/XMLHttpRequest.h: Ditto. >+ > 2016-06-24 Gyuyoung Kim <gyuyoung.kim@webkit.org> > > Unreviewed EFL build fix. >diff --git a/Source/WebCore/Modules/fetch/FetchLoader.cpp b/Source/WebCore/Modules/fetch/FetchLoader.cpp >index 885fb22333ebc002fef3f7baa2c7e28867209523..df4a7e7675bd06f1ace62068168102d188871b2c 100644 >--- a/Source/WebCore/Modules/fetch/FetchLoader.cpp >+++ b/Source/WebCore/Modules/fetch/FetchLoader.cpp >@@ -144,11 +144,6 @@ void FetchLoader::didFail(const ResourceError&) > m_client.didFail(); > } > >-void FetchLoader::didFailRedirectCheck() >-{ >- m_client.didFail(); >-} >- > } // namespace WebCore > > #endif // ENABLE(FETCH_API) >diff --git a/Source/WebCore/Modules/fetch/FetchLoader.h b/Source/WebCore/Modules/fetch/FetchLoader.h >index b725e351aebf7969e6ce4ae52bba9ab53c6a9902..d473ff17451fca5c1a713fb543bd0b6a0b1de02b 100644 >--- a/Source/WebCore/Modules/fetch/FetchLoader.h >+++ b/Source/WebCore/Modules/fetch/FetchLoader.h >@@ -62,7 +62,6 @@ private: > void didReceiveData(const char*, int) final; > void didFinishLoading(unsigned long, double) final; > void didFail(const ResourceError&) final; >- void didFailRedirectCheck() final; > > Type type() const { return m_type; } > >diff --git a/Source/WebCore/inspector/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/InspectorNetworkAgent.cpp >index 918686ea32ef0fe0bc4185dbb82b8f071f8c46ef..c8397f0bbee49aee470f5d11c864f1ea2a122ba3 100644 >--- a/Source/WebCore/inspector/InspectorNetworkAgent.cpp >+++ b/Source/WebCore/inspector/InspectorNetworkAgent.cpp >@@ -128,9 +128,9 @@ public: > dispose(); > } > >- void didFailRedirectCheck() override >+ void didFailAccessControlCheck(const ResourceError&) final > { >- m_callback->sendFailure(ASCIILiteral("Loading resource for inspector failed redirect check")); >+ m_callback->sendFailure(ASCIILiteral("Loading resource for inspector failed access control check")); > dispose(); > } > >diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp >index 03b4bcb63c5fce7536b99661c4b24efe15b34a5b..57ac3bafcf04fa4170f4744a7da3b45cf7b3e783 100644 >--- a/Source/WebCore/loader/DocumentThreadableLoader.cpp >+++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp >@@ -199,7 +199,7 @@ void DocumentThreadableLoader::redirectReceived(CachedResource* resource, Resour > > Ref<DocumentThreadableLoader> protectedThis(*this); > if (!isAllowedByContentSecurityPolicy(request.url(), !redirectResponse.isNull())) { >- m_client->didFailRedirectCheck(); >+ m_client->didFailAccessControlCheck(ResourceError(errorDomainWebKitInternal, 0, redirectResponse.url(), "Failed CSP redirect check.")); > request = ResourceRequest(); > return; > } >@@ -245,7 +245,7 @@ void DocumentThreadableLoader::redirectReceived(CachedResource* resource, Resour > } > } > >- m_client->didFailRedirectCheck(); >+ m_client->didFailAccessControlCheck(ResourceError(errorDomainWebKitInternal, 0, redirectResponse.url(), "Failed redirection access control check.")); > request = ResourceRequest(); > } > >@@ -382,7 +382,7 @@ void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur > // requested. Also comparing the request and response URLs as strings will fail if the requestURL still has its credentials. > bool didRedirect = requestURL != response.url(); > if (didRedirect && (!isAllowedByContentSecurityPolicy(response.url(), didRedirect) || !isAllowedRedirect(response.url()))) { >- m_client->didFailRedirectCheck(); >+ m_client->didFailAccessControlCheck(ResourceError(errorDomainWebKitInternal, 0, requestURL, "Failed redirection access control check.")); > return; > } > >diff --git a/Source/WebCore/loader/ThreadableLoaderClient.h b/Source/WebCore/loader/ThreadableLoaderClient.h >index 7c06fb43ca922b57fc5e8ec1794eff15c8fa9a4f..629aa3d92aae644f1aae1bf9411667c6e8cdaa44 100644 >--- a/Source/WebCore/loader/ThreadableLoaderClient.h >+++ b/Source/WebCore/loader/ThreadableLoaderClient.h >@@ -47,7 +47,6 @@ namespace WebCore { > virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/) { } > virtual void didFail(const ResourceError&) { } > virtual void didFailAccessControlCheck(const ResourceError& error) { didFail(error); } >- virtual void didFailRedirectCheck() { } > > protected: > ThreadableLoaderClient() { } >diff --git a/Source/WebCore/loader/ThreadableLoaderClientWrapper.h b/Source/WebCore/loader/ThreadableLoaderClientWrapper.h >index bb73a4565f7f3503d17d4689699dd260fc364c4f..6c3ee5b3852c1de60848ed49c3d65cff2b752324 100644 >--- a/Source/WebCore/loader/ThreadableLoaderClientWrapper.h >+++ b/Source/WebCore/loader/ThreadableLoaderClientWrapper.h >@@ -95,13 +95,6 @@ public: > m_client->didFailAccessControlCheck(error); > } > >- void didFailRedirectCheck() >- { >- m_done = true; >- if (m_client) >- m_client->didFailRedirectCheck(); >- } >- > void didReceiveAuthenticationCancellation(unsigned long identifier, const ResourceResponse& response) > { > if (m_client) >diff --git a/Source/WebCore/loader/WorkerThreadableLoader.cpp b/Source/WebCore/loader/WorkerThreadableLoader.cpp >index 6602dced43681c358610d384bef390fcb68548b8..0bd8155da60b948c3a8434655918d080cd78d6b3 100644 >--- a/Source/WebCore/loader/WorkerThreadableLoader.cpp >+++ b/Source/WebCore/loader/WorkerThreadableLoader.cpp >@@ -206,14 +206,4 @@ void WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck(const R > }, m_taskMode); > } > >-void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() >-{ >- m_loadingFinished = true; >- Ref<ThreadableLoaderClientWrapper> protectedWorkerClientWrapper = *m_workerClientWrapper; >- m_loaderProxy.postTaskForModeToWorkerGlobalScope([protectedWorkerClientWrapper = WTFMove(protectedWorkerClientWrapper)] (ScriptExecutionContext& context) mutable { >- ASSERT_UNUSED(context, context.isWorkerGlobalScope()); >- protectedWorkerClientWrapper->didFailRedirectCheck(); >- }, m_taskMode); >-} >- > } // namespace WebCore >diff --git a/Source/WebCore/loader/WorkerThreadableLoader.h b/Source/WebCore/loader/WorkerThreadableLoader.h >index 66be0e852e9b953f86238ab05e01079e6c47a3a7..90bf90dbe87d8184576246c439e3706ea3a05e4f 100644 >--- a/Source/WebCore/loader/WorkerThreadableLoader.h >+++ b/Source/WebCore/loader/WorkerThreadableLoader.h >@@ -105,7 +105,6 @@ namespace WebCore { > void didFinishLoading(unsigned long identifier, double finishTime) override; > void didFail(const ResourceError&) override; > void didFailAccessControlCheck(const ResourceError&) override; >- void didFailRedirectCheck() override; > > // Only to be used on the main thread. > RefPtr<ThreadableLoader> m_mainThreadLoader; >diff --git a/Source/WebCore/page/EventSource.cpp b/Source/WebCore/page/EventSource.cpp >index a8dd30d3df1de438cd6734180cf0fff22202a158..77152e58ae244eb050264c74dfccde51f19a4ac0 100644 >--- a/Source/WebCore/page/EventSource.cpp >+++ b/Source/WebCore/page/EventSource.cpp >@@ -261,11 +261,6 @@ void EventSource::didFailAccessControlCheck(const ResourceError& error) > abortConnectionAttempt(); > } > >-void EventSource::didFailRedirectCheck() >-{ >- abortConnectionAttempt(); >-} >- > void EventSource::abortConnectionAttempt() > { > ASSERT(m_state == CONNECTING); >diff --git a/Source/WebCore/page/EventSource.h b/Source/WebCore/page/EventSource.h >index ac42191c72fbb2199edd64b7a124b278b7ff57d6..6b4f7676bc9e966ecd69ce33beb1fee7fe5628dd 100644 >--- a/Source/WebCore/page/EventSource.h >+++ b/Source/WebCore/page/EventSource.h >@@ -82,7 +82,6 @@ private: > void didFinishLoading(unsigned long, double) final; > void didFail(const ResourceError&) final; > void didFailAccessControlCheck(const ResourceError&) final; >- void didFailRedirectCheck() final; > > void stop() final; > const char* activeDOMObjectName() const final; >diff --git a/Source/WebCore/workers/WorkerScriptLoader.cpp b/Source/WebCore/workers/WorkerScriptLoader.cpp >index 95e0738459c29a1a3df3c221e9d8317547fbcdde..9547da2e232e945a03c2269d224c8a234dae11f3 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.cpp >+++ b/Source/WebCore/workers/WorkerScriptLoader.cpp >@@ -161,11 +161,6 @@ void WorkerScriptLoader::didFail(const ResourceError&) > notifyError(); > } > >-void WorkerScriptLoader::didFailRedirectCheck() >-{ >- notifyError(); >-} >- > void WorkerScriptLoader::notifyError() > { > m_failed = true; >diff --git a/Source/WebCore/workers/WorkerScriptLoader.h b/Source/WebCore/workers/WorkerScriptLoader.h >index ea6556d37ba3fd26be752607a6be37fceb27b44a..4b15b79b83aaf0d80b9f5b7bfa62b216cca66291 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.h >+++ b/Source/WebCore/workers/WorkerScriptLoader.h >@@ -69,7 +69,6 @@ namespace WebCore { > void didReceiveData(const char* data, int dataLength) override; > void didFinishLoading(unsigned long identifier, double) override; > void didFail(const ResourceError&) override; >- void didFailRedirectCheck() override; > > private: > friend class WTF::RefCounted<WorkerScriptLoader>; >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index 87cdfa7b1a28f361548f0c13adad8e67a62190de..81c63d7bf193ddb078caa95560e5fd9a348b2b43 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -1038,11 +1038,6 @@ void XMLHttpRequest::didFail(const ResourceError& error) > networkError(); > } > >-void XMLHttpRequest::didFailRedirectCheck() >-{ >- networkError(); >-} >- > void XMLHttpRequest::didFinishLoading(unsigned long identifier, double) > { > if (m_error) >diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h >index b880872c2cc18b6a5b467e4f60b32a536c6a1584..9b33fb6190f5ad7facd548211678897b193bd978 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.h >+++ b/Source/WebCore/xml/XMLHttpRequest.h >@@ -151,7 +151,6 @@ private: > void didReceiveData(const char* data, int dataLength) override; > void didFinishLoading(unsigned long identifier, double finishTime) override; > void didFail(const ResourceError&) override; >- void didFailRedirectCheck() override; > > bool responseIsXML() const; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 238eb1bcfa022905ac2bb55da0df103f4e7e9edf..7d5f4af26d1df7eb3cc1b5334ff4667c84809315 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2016-06-24 Youenn Fablet <youennf@gmail.com> >+ >+ Remove didFailRedirectCheck ThreadableLoaderClient callback >+ https://bugs.webkit.org/show_bug.cgi?id=159085 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt: >+ * http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt: >+ * http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt: >+ * http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt: >+ * http/tests/xmlhttprequest/access-control-and-redirects-expected.txt: >+ > 2016-06-23 Benjamin Poulain <bpoulain@apple.com> > > OOM Assertion failure in Array.prototype.toString >diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt b/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt >index 5cacf95f8388429b7c0258298d213a0b6a782935..2580873dee1d9d3c6a9ef3a39f5618f7042eefc6 100644 >--- a/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt >+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt >@@ -1,4 +1,5 @@ > CONSOLE MESSAGE: Refused to connect to http://localhost:8000/eventsource/resources/simple-event-stream.asis because it does not appear in the connect-src directive of the Content Security Policy. >+CONSOLE MESSAGE: EventSource cannot load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php?url=http://localhost:8000/eventsource/resources/simple-event-stream.asis. Failed CSP redirect check. > PASS EventSource() did not follow the disallowed redirect. > PASS successfullyParsed is true > >diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt b/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt >index 5506a01d51e16ba2e1c09c3d63fe0461c084d81a..cc1b337ffa6b58bdc0c53c4dda857d2b879622ff 100644 >--- a/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt >+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt >@@ -1,4 +1,5 @@ > CONSOLE MESSAGE: Refused to connect to http://localhost:8000/security/contentSecurityPolicy/resources/xhr-redirect-not-allowed.pl because it does not appear in the connect-src directive of the Content Security Policy. >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php?url=http://localhost:8000/security/contentSecurityPolicy/resources/xhr-redirect-not-allowed.pl. Failed CSP redirect check. > PASS XMLHttpRequest.send() did not follow the disallowed redirect. > PASS successfullyParsed is true > >diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt b/LayoutTests/http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt >index 707536f1851b446de032baadbf6926b25449fd96..3dd0c033a6481d8cff6f2cf73a364a509d43d465 100644 >--- a/LayoutTests/http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt >+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt >@@ -1,3 +1,4 @@ >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi. Failed CSP redirect check. > This tests an XHR request made from a worker is blocked if it redirects to a cross-origin resource that is not listed as a connect-src in the CSP of the worker. > > PASS threw exception Error: NetworkError: DOM Exception 19. >diff --git a/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt b/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt >index 6637e2bd38bfbbabd15ca83c65ee22a3205d7370..2b6af50798176e4e2aa5eca86a049389b0831154 100644 >--- a/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt >+++ b/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt >@@ -1,4 +1,9 @@ >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi. Failed redirection access control check. >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi&%20%20access-control-allow-origin=http://localhost:8000. Failed redirection access control check. >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=http://username:password@localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi&%20%20access-control-allow-origin=http://localhost:8000. Failed redirection access control check. >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=foo://bar.cgi&%20%20access-control-allow-origin=http://localhost:8000. Failed redirection access control check. > CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?redirect-preflight=true&%20%20url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi&%20%20access-control-allow-origin=*. Preflight response is not successful >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?redirect-preflight=false&%20%20url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi&%20%20access-control-allow-origin=*&%20%20access-control-allow-headers=x-webkit. Failed redirection access control check. > Tests that asynchronous XMLHttpRequests handle redirects according to the CORS standard. > > Testing http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi without credentials >diff --git a/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt b/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt >index e5b2fe750faf90c80253d8e6ec5bc77020a49040..76b8b8087be2f63f3a854a611fc4cb23dfdb83a0 100644 >--- a/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt >+++ b/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt >@@ -1,3 +1,6 @@ >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/resources/redirect.php?url=http://127.0.0.1:8000/xmlhttprequest/resources/access-control-basic-allow.cgi. Failed redirection access control check. >+CONSOLE MESSAGE: line 25: XMLHttpRequest cannot load http://localhost:8000/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi. Failed redirection access control check. >+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi. Failed redirection access control check. > Tests that redirects between origins are never allowed, even when access control is involved. > > Per the spec, these test cases should be allowed, but cross-origin redirects are currently unsupported in WebCore.
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 159085
:
281966
|
282108