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

Unified Diff: chrome/browser/renderer_host/resource_request_details.h

Issue 509016: Refactored code to allow associating workers with multiple renderers. (Closed)
Patch Set: Disabled overly-aggressive assertion in ResourceDispatcherHost. Created 10 years, 11 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: chrome/browser/renderer_host/resource_request_details.h
diff --git a/chrome/browser/renderer_host/resource_request_details.h b/chrome/browser/renderer_host/resource_request_details.h
index c34af0f1403c0027a3cc6dbb796dc93b0aaa6c13..ad0df97db73e2e037237862509950e8caa1e71b6 100644
--- a/chrome/browser/renderer_host/resource_request_details.h
+++ b/chrome/browser/renderer_host/resource_request_details.h
@@ -46,8 +46,18 @@ class ResourceRequestDetails {
// such as ssl state etc.
const WorkerProcessHost::WorkerInstance* worker_instance =
WorkerService::GetInstance()->FindWorkerInstance(info->child_id());
- origin_child_id_ =
- worker_instance ? worker_instance->renderer_id() : info->child_id();
+ if (worker_instance) {
+ DCHECK(!worker_instance->worker_document_set()->IsEmpty());
+ const WorkerDocumentSet::DocumentInfoSet& parents =
+ worker_instance->worker_document_set()->documents();
+ // TODO(atwilson): need to notify all associated renderers in the case
+ // of ssl state change (http://crbug.com/25357). For now, just notify
+ // the first one (works for dedicated workers and shared workers with
+ // a single process).
+ origin_child_id_ = parents.begin()->renderer_id();
+ } else {
+ origin_child_id_ = info->child_id();
+ }
}
virtual ~ResourceRequestDetails() {}
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/browser/worker_host/worker_document_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698