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

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 | « no previous file | content/child/url_loader_client_impl.h » ('j') | content/child/url_loader_client_impl.cc » ('J')
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..cf5d047bc4cbeccc6b9e1a42b595719f578e8353 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,10 @@ 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)
+ request_info->url_loader_client->FlushDeferredMessages();
kinuko 2016/12/23 13:11:23 Having two pending queues is confusing, it seems i
yhirano 2016/12/26 05:08:35 I've just noticed that |request_info| can be broke
+
// 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 | « no previous file | content/child/url_loader_client_impl.h » ('j') | content/child/url_loader_client_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698