summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/resource_dispatcher_host.cc
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 01:28:49 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 01:28:49 +0000
commit0791d3a25978f15adfe3ddc073850f7ce2bd158e (patch)
tree857cf4f343edff2ea739571384246af4c7cbc4ae /chrome/browser/renderer_host/resource_dispatcher_host.cc
parent26426a2af6a18a8e29bdf1eb09bee9f073304d1b (diff)
downloadchromium_src-0791d3a25978f15adfe3ddc073850f7ce2bd158e.zip
chromium_src-0791d3a25978f15adfe3ddc073850f7ce2bd158e.tar.gz
chromium_src-0791d3a25978f15adfe3ddc073850f7ce2bd158e.tar.bz2
Refactored code to allow associating workers with multiple renderers.
SharedWorkers now gracefully handle http auth requests after their initial window has closed. BUG=27660 TEST=WorkerHttpAuth,SharedWorkerHttpAuth uitests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=36888 Reverted and reopened due to valgrind failures. Review URL: http://codereview.chromium.org/509016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37365 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/resource_dispatcher_host.cc')
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 65182c2..2907d7f 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -159,7 +159,11 @@ class RVHDelegateNotificationTask : public Task {
if (!ResourceDispatcherHost::RenderViewForRequest(request,
&render_process_host_id_,
&render_view_host_id_)) {
- NOTREACHED();
+ // Issue a warning here - this can happen during normal operation (for
+ // example, if a worker exits while a network operation is pending), but
+ // it should be fairly rare.
+ DLOG(WARNING) << "Trying to deliver a message to a RenderViewHost" <<
+ " that has already exited or has never existed.";
}
}
@@ -1451,8 +1455,13 @@ bool ResourceDispatcherHost::RenderViewForRequest(const URLRequest* request,
*render_view_host_id = -1;
return false;
}
- *render_process_host_id = worker_instance->renderer_id();
- *render_view_host_id = worker_instance->render_view_route_id();
+ 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();