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

Unified Diff: third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc

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, 2 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/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 3f00d667e931e1d8619c36bbeb2b11a2a85a4ffe..8e55250c55b8ec9a95cc202b4d49337bcfb2178c 100644
--- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
+++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
@@ -82,19 +82,16 @@ WebURLRequest WebURLLoaderMock::ServeRedirect(
WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr();
- client_->willFollowRedirect(this, newRequest, redirectResponse);
+ bool follow = client_->willFollowRedirect(this, newRequest, redirectResponse);
+ 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;
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/TextTrackLoader.cpp ('k') | third_party/WebKit/Source/web/AssociatedURLLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698