Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: third_party/WebKit/Source/core/fetch/RawResource.cpp

Issue 2230173002: Change WebURLLoaderClient::willFollowRedirect() API to return bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/RawResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/RawResource.cpp b/third_party/WebKit/Source/core/fetch/RawResource.cpp
index 4aec26459642a659fa5082df00c08e86779320d9..0605f7a2bca05e8ef86bdb911e09e2edb11e7fa6 100644
--- a/third_party/WebKit/Source/core/fetch/RawResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/RawResource.cpp
@@ -122,14 +122,22 @@ void RawResource::didAddClient(ResourceClient* c)
Resource::didAddClient(client);
}
-void RawResource::willFollowRedirect(ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
+bool RawResource::willFollowRedirect(ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
{
- Resource::willFollowRedirect(newRequest, redirectResponse);
+ bool follow = Resource::willFollowRedirect(newRequest, redirectResponse);
+ if (!follow)
+ newRequest = ResourceRequest();
Nate Chapin 2016/09/06 16:46:14 Why is blanking the ResourceRequest needed?
tyoshino (SeeGerritForStatus) 2016/09/07 10:52:28 Ah, yeah. It's unnecessary. I just tried to make t
ASSERT(!redirectResponse.isNull());
ResourceClientWalker<RawResourceClient> w(clients());
- while (RawResourceClient* c = w.next())
- c->redirectReceived(this, newRequest, redirectResponse);
+ while (RawResourceClient* c = w.next()) {
+ if (!c->redirectReceived(this, newRequest, redirectResponse)) {
+ follow = false;
+ newRequest = ResourceRequest();
tyoshino (SeeGerritForStatus) 2016/09/07 10:52:28 This is to keep the clients see the same (possibly
Nate Chapin 2016/09/07 17:05:45 How much trouble would it be to change the behavio
tyoshino (SeeGerritForStatus) 2016/09/14 14:53:47 We need some clean - one is https://codereview.chr
Nate Chapin 2016/09/14 22:25:27 OK.
+ }
+ }
+
+ return follow;
}
void RawResource::willNotFollowRedirect()

Powered by Google App Engine
This is Rietveld 408576698