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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2591383003: Implement SetDefersLoading on content::URLLoaderClientImpl (Closed)
Patch Set: fix Created 4 years 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/child/resource_dispatcher.h ('k') | content/child/test_request_peer.h » ('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 3cbc9ff68c4277c46935b2f1bbe7f4f1c56c3019..24afd8a80414438645b5c575a23c3b166f4ab70b 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -483,9 +483,14 @@ void ResourceDispatcher::SetDefersLoading(int request_id, bool value) {
}
if (value) {
request_info->is_deferred = value;
+ if (request_info->url_loader_client)
+ request_info->url_loader_client->SetDefersLoading();
} else if (request_info->is_deferred) {
request_info->is_deferred = false;
+ if (request_info->url_loader_client)
+ request_info->url_loader_client->UnsetDefersLoading();
+
FollowPendingRedirect(request_id, request_info);
main_thread_task_runner_->PostTask(
@@ -553,6 +558,13 @@ void ResourceDispatcher::FlushDeferredMessages(int request_id) {
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info || request_info->is_deferred)
return;
+
+ if (request_info->url_loader) {
+ DCHECK(request_info->deferred_message_queue.empty());
+ request_info->url_loader_client->FlushDeferredMessages();
+ return;
+ }
+
// Because message handlers could result in request_info being destroyed,
// we need to work with a stack reference to the deferred queue.
MessageQueue q;
« no previous file with comments | « content/child/resource_dispatcher.h ('k') | content/child/test_request_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698