diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-13 16:23:34 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-14 10:37:21 +0000 |
commit | 38a9a29f4f9436cace7f0e7abf9c586057df8a4e (patch) | |
tree | c4e8c458dc595bc0ddb435708fa2229edfd00bd4 /chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc | |
parent | e684a3455bcc29a6e3e66a004e352dea4e1141e7 (diff) | |
download | qtwebengine-chromium-38a9a29f4f9436cace7f0e7abf9c586057df8a4e.tar.gz |
BASELINE: Update Chromium to 73.0.3683.37
Change-Id: I08c9af2948b645f671e5d933aca1f7a90ea372f2
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc b/chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc index 93d1e97824b..b61d4c922a2 100644 --- a/chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc +++ b/chromium/third_party/blink/renderer/platform/testing/weburl_loader_mock.cc @@ -8,6 +8,7 @@ #include "third_party/blink/public/platform/url_conversion.h" #include "third_party/blink/public/platform/web_data.h" +#include "third_party/blink/public/platform/web_security_origin.h" #include "third_party/blink/public/platform/web_url_error.h" #include "third_party/blink/public/platform/web_url_loader_client.h" #include "third_party/blink/renderer/platform/shared_buffer.h" @@ -55,6 +56,11 @@ void WebURLLoaderMock::ServeAsynchronousRequest( delegate = default_delegate.get(); } + if (error) { + delegate->DidFail(client_, *error, data.size(), 0, 0); + return; + } + // didReceiveResponse() and didReceiveData() might end up getting ::cancel() // to be called which will make the ResourceLoader to delete |this|. base::WeakPtr<WebURLLoaderMock> self = weak_factory_.GetWeakPtr(); @@ -63,11 +69,6 @@ void WebURLLoaderMock::ServeAsynchronousRequest( if (!self) return; - if (error) { - delegate->DidFail(client_, *error, data.size(), 0, 0); - return; - } - data.ForEachSegment([this, &delegate, &self](const char* segment, size_t segment_size, size_t segment_offset) { @@ -93,7 +94,8 @@ WebURL WebURLLoaderMock::ServeRedirect( bool report_raw_headers = false; bool follow = client_->WillFollowRedirect( - redirect_url, redirect_url, WebString(), + redirect_url, redirect_url, + WebSecurityOrigin::Create(WebURL(redirect_url)), WebString(), network::mojom::ReferrerPolicy::kDefault, request.HttpMethod(), redirect_response, report_raw_headers); // |this| might be deleted in willFollowRedirect(). |