Index: third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc |
diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc |
index 588fd5d1b9ebc617f40c7c95d724698bc12fdc97..9696a59f1f4c70b0e0eba5beb7ab420ff30513e0 100644 |
--- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc |
+++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc |
@@ -82,20 +82,17 @@ WebURLRequest WebURLLoaderMock::ServeRedirect( |
WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr(); |
- client_->willFollowRedirect(this, newRequest, redirectResponse, |
- kRedirectResponseOverheadBytes); |
+ bool follow = client_->willFollowRedirect(this, newRequest, redirectResponse, |
+ kRedirectResponseOverheadBytes); |
+ if (!follow) |
+ newRequest = WebURLRequest(); |
// |this| might be deleted in willFollowRedirect(). |
if (!self) |
return newRequest; |
- if (redirectURL != KURL(newRequest.url())) { |
- // Only follow the redirect if WebKit left the URL unmodified. |
- // We assume that WebKit only changes the URL to suppress a redirect, and we |
- // assume that it does so by setting it to be invalid. |
- DCHECK(!newRequest.url().isValid()); |
+ if (!follow) |
cancel(); |
- } |
return newRequest; |
} |