diff options
Diffstat (limited to 'chrome/browser/renderer_host/resource_dispatcher_host.cc')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 1d073d3..cad4560 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -1518,20 +1518,14 @@ bool ResourceDispatcherHost::RenderViewForRequest( // If the request is from the worker process, find a tab that owns the worker. if (info->process_type() == ChildProcessInfo::WORKER_PROCESS) { - const WorkerProcessHost::WorkerInstance* worker_instance = - WorkerService::GetInstance()->FindWorkerInstance(info->child_id()); - if (!worker_instance) { + // Need to display some related UI for this network request - pick an + // arbitrary parent to do so. + if (!WorkerService::GetInstance()->GetRendererForWorker( + info->child_id(), render_process_host_id, render_view_host_id)) { *render_process_host_id = -1; *render_view_host_id = -1; return false; } - DCHECK(!worker_instance->worker_document_set()->IsEmpty()); - const WorkerDocumentSet::DocumentInfoSet& parents = - worker_instance->worker_document_set()->documents(); - // Need to display some related UI for this network request - pick an - // arbitrary parent to do so. - *render_process_host_id = parents.begin()->renderer_id(); - *render_view_host_id = parents.begin()->render_view_route_id(); } else { *render_process_host_id = info->child_id(); *render_view_host_id = info->route_id(); |