Chromium Code Reviews| 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)); |