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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2467833002: Implement redirect handling on MojoAsyncResourceHandler (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « content/browser/service_worker/service_worker_fetch_dispatcher.cc ('k') | content/common/typemaps.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 8b7f0e2f27fd621786e8e18d393b4f7dec216642..e242b5eda9421e57bec96e99eb7c88e344dd1d98 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -98,6 +98,14 @@ class URLLoaderClientImpl final : public mojom::URLLoaderClient {
ResourceMsg_ReceivedResponse(request_id_, response_head));
}
+ void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
+ const ResourceResponseHead& response_head) override {
+ DCHECK(!has_received_response_);
+ DCHECK(!body_consumer_);
+ resource_dispatcher_->OnMessageReceived(ResourceMsg_ReceivedRedirect(
+ request_id_, redirect_info, response_head));
+ }
+
void OnDataDownloaded(int64_t data_len, int64_t encoded_data_len) override {
resource_dispatcher_->OnMessageReceived(
ResourceMsg_DataDownloaded(request_id_, data_len, encoded_data_len));
@@ -410,8 +418,14 @@ void ResourceDispatcher::FollowPendingRedirect(
int request_id,
PendingRequestInfo* request_info) {
IPC::Message* msg = request_info->pending_redirect_message.release();
- if (msg)
- message_sender_->Send(msg);
+ if (msg) {
+ if (request_info->url_loader) {
+ request_info->url_loader->FollowRedirect();
+ delete msg;
+ } else {
+ message_sender_->Send(msg);
+ }
+ }
}
void ResourceDispatcher::OnRequestComplete(
« no previous file with comments | « content/browser/service_worker/service_worker_fetch_dispatcher.cc ('k') | content/common/typemaps.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698