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

Side by Side Diff: content/child/web_url_loader_impl.cc

Issue 1910343006: Enable setting deferral state on ResourceDispatcher at request start (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/child/resource_dispatcher.h ('k') | content/child/web_url_loader_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/web_url_loader_impl.h" 5 #include "content/child/web_url_loader_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // contains the body of the response. The network request has already been 548 // contains the body of the response. The network request has already been
549 // made by the browser. 549 // made by the browser.
550 if (stream_override_.get()) { 550 if (stream_override_.get()) {
551 CHECK(IsBrowserSideNavigationEnabled()); 551 CHECK(IsBrowserSideNavigationEnabled());
552 DCHECK(!sync_load_response); 552 DCHECK(!sync_load_response);
553 DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType()); 553 DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType());
554 request_info.resource_body_stream_url = stream_override_->stream_url; 554 request_info.resource_body_stream_url = stream_override_->stream_url;
555 } 555 }
556 556
557 if (sync_load_response) { 557 if (sync_load_response) {
558 DCHECK(defers_loading_ == NOT_DEFERRING);
558 resource_dispatcher_->StartSync( 559 resource_dispatcher_->StartSync(
559 request_info, request_body.get(), sync_load_response); 560 request_info, request_body.get(), sync_load_response);
560 return; 561 return;
561 } 562 }
562 563
563 request_id_ = resource_dispatcher_->StartAsync( 564 request_id_ = resource_dispatcher_->StartAsync(
564 request_info, request_body.get(), 565 request_info, request_body.get(),
565 base::WrapUnique(new WebURLLoaderImpl::RequestPeerImpl(this))); 566 base::WrapUnique(new WebURLLoaderImpl::RequestPeerImpl(this)));
567
568 if (defers_loading_ != NOT_DEFERRING)
569 resource_dispatcher_->SetDefersLoading(request_id_, true);
566 } 570 }
567 571
568 void WebURLLoaderImpl::Context::SetWebTaskRunner( 572 void WebURLLoaderImpl::Context::SetWebTaskRunner(
569 std::unique_ptr<blink::WebTaskRunner> web_task_runner) { 573 std::unique_ptr<blink::WebTaskRunner> web_task_runner) {
570 web_task_runner_ = std::move(web_task_runner); 574 web_task_runner_ = std::move(web_task_runner);
571 } 575 }
572 576
573 void WebURLLoaderImpl::Context::OnUploadProgress(uint64_t position, 577 void WebURLLoaderImpl::Context::OnUploadProgress(uint64_t position,
574 uint64_t size) { 578 uint64_t size) {
575 if (client_) 579 if (client_)
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 response->clearHTTPHeaderField(webStringName); 1183 response->clearHTTPHeaderField(webStringName);
1180 while (response_headers->EnumerateHeader(&iterator, name, &value)) { 1184 while (response_headers->EnumerateHeader(&iterator, name, &value)) {
1181 response->addHTTPHeaderField(webStringName, 1185 response->addHTTPHeaderField(webStringName,
1182 WebString::fromLatin1(value)); 1186 WebString::fromLatin1(value));
1183 } 1187 }
1184 } 1188 }
1185 return true; 1189 return true;
1186 } 1190 }
1187 1191
1188 } // namespace content 1192 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.h ('k') | content/child/web_url_loader_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698