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 523b3a83bb89184ba1c6ca3487118c3524b9a8f7..c72e9c6fa24465c79c8e1d3b3b02cab5db45ce2b 100644 |
--- a/third_party/WebKit/Source/core/fetch/RawResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/RawResource.cpp |
@@ -127,14 +127,22 @@ void RawResource::didAddClient(ResourceClient* c) |
Resource::didAddClient(client); |
} |
-void RawResource::willFollowRedirect(ResourceRequest& newRequest, const ResourceResponse& redirectResponse) |
+bool RawResource::willFollowRedirect(const ResourceRequest& newRequest, const ResourceResponse& redirectResponse) |
{ |
- Resource::willFollowRedirect(newRequest, redirectResponse); |
+ bool follow = Resource::willFollowRedirect(newRequest, redirectResponse); |
+ // The base class method takes a non const reference of a ResourceRequest |
+ // and returns bool just for allowing RawResource to reject redirect. It |
+ // must always return true. |
+ DCHECK(follow); |
DCHECK(!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; |
+ } |
+ |
+ return follow; |
} |
void RawResource::willNotFollowRedirect() |