| Index: content/browser/renderer_host/resource_dispatcher_host.cc
|
| ===================================================================
|
| --- content/browser/renderer_host/resource_dispatcher_host.cc (revision 124423)
|
| +++ content/browser/renderer_host/resource_dispatcher_host.cc (working copy)
|
| @@ -90,6 +90,7 @@
|
| using content::BrowserThread;
|
| using content::GlobalRequestID;
|
| using content::ResourceContext;
|
| +using content::ResourceRequestInfo;
|
| using content::ResourceResponse;
|
| using content::ResourceThrottle;
|
| using content::ThrottlingResourceHandler;
|
| @@ -1917,39 +1918,23 @@
|
| // static
|
| const ResourceDispatcherHostRequestInfo* ResourceDispatcherHost::InfoForRequest(
|
| const net::URLRequest* request) {
|
| - const ResourceDispatcherHostRequestInfo* info =
|
| - static_cast<const ResourceDispatcherHostRequestInfo*>(
|
| - request->GetUserData(NULL));
|
| - return info;
|
| + return static_cast<const ResourceDispatcherHostRequestInfo*>(
|
| + ResourceRequestInfo::ForRequest(request));
|
| }
|
|
|
| // static
|
| bool ResourceDispatcherHost::RenderViewForRequest(
|
| const net::URLRequest* request,
|
| - int* render_process_host_id,
|
| - int* render_view_host_id) {
|
| + int* render_process_id,
|
| + int* render_view_id) {
|
| const ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
|
| if (!info) {
|
| - *render_process_host_id = -1;
|
| - *render_view_host_id = -1;
|
| + *render_process_id = -1;
|
| + *render_view_id = -1;
|
| return false;
|
| }
|
|
|
| - // If the request is from the worker process, find a tab that owns the worker.
|
| - if (info->process_type() == content::PROCESS_TYPE_WORKER) {
|
| - // Need to display some related UI for this network request - pick an
|
| - // arbitrary parent to do so.
|
| - if (!WorkerServiceImpl::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;
|
| - }
|
| - } else {
|
| - *render_process_host_id = info->child_id();
|
| - *render_view_host_id = info->route_id();
|
| - }
|
| - return true;
|
| + return info->GetAssociatedRenderView(render_process_id, render_view_id);
|
| }
|
|
|
| net::URLRequest* ResourceDispatcherHost::GetURLRequest(
|
|
|