Document request not updated after willSendRequest is called for a redirect
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Oct 2016 08:35:18 +0000 (08:35 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Oct 2016 08:35:18 +0000 (08:35 +0000)
commit71c49f55d5900ad62e10a8809ea3861a6dbb3033
tree6fa4dbf35e4e1e178cb207c1574f53ee585c41b7
parent4f43a537f01f7c61be543f647eb7c5caaaf3f185
Document request not updated after willSendRequest is called for a redirect
https://bugs.webkit.org/show_bug.cgi?id=163436

Reviewed by Michael Catanzaro.

Source/WebCore:

The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.

Covered by GTK+ unit tests.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
* loader/DocumentLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
and called for a redirection.

Tools:

Update /webkit2/WebKitWebView/active-uri test to check the active URI also when modified by
WebKitPage::send-request signal in a web extension.

* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
(testWebViewActiveURI):
(serverCallback):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(sendRequestCallback):
* TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp:
(loadChangedCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/SubresourceLoader.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp
Tools/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp