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

Unified Diff: content/child/resource_dispatcher.cc

Issue 1366883002: [Reland] Post loading tasks on the appropriate WebFrameScheduler's queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index baf79aece718232c05fc097c35ff775116d35817..7dbfe9eea22865598b67f4e4b770f8b409f259bb 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -114,7 +114,15 @@ bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) {
}
}
- DispatchMessage(message);
+ // If the request is associated with a specific loading task queue then
+ // dispatch the message there, otherwise dispatch it here.
Sami 2015/09/25 13:31:27 I guess the other alternative would be to dispatch
alex clarke (OOO till 29th) 2015/09/28 17:24:53 Done. Turned out to be much less invasive than I'd
+ if (request_info->loading_task_queue) {
+ request_info->loading_task_queue->PostTask(
+ FROM_HERE, base::Bind(&ResourceDispatcher::DispatchMessage,
+ base::Unretained(this), message));
+ } else {
+ DispatchMessage(message);
+ }
return true;
}
@@ -480,7 +488,8 @@ ResourceDispatcher::PendingRequestInfo::PendingRequestInfo(
int origin_pid,
const GURL& frame_origin,
const GURL& request_url,
- bool download_to_file)
+ bool download_to_file,
+ scoped_refptr<base::SingleThreadTaskRunner> loading_task_queue)
: peer(peer),
threaded_data_provider(NULL),
resource_type(resource_type),
@@ -490,7 +499,8 @@ ResourceDispatcher::PendingRequestInfo::PendingRequestInfo(
frame_origin(frame_origin),
response_url(request_url),
download_to_file(download_to_file),
- request_start(base::TimeTicks::Now()) {
+ request_start(base::TimeTicks::Now()),
+ loading_task_queue(loading_task_queue) {
}
ResourceDispatcher::PendingRequestInfo::~PendingRequestInfo() {
@@ -588,7 +598,8 @@ int ResourceDispatcher::StartAsync(const RequestInfo& request_info,
request->origin_pid,
frame_origin,
request->url,
- request_info.download_to_file);
+ request_info.download_to_file,
+ request_info.loading_task_queue);
message_sender_->Send(new ResourceHostMsg_RequestResource(
request_info.routing_id, request_id, *request));

Powered by Google App Engine
This is Rietveld 408576698