| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/renderer_host/resource_request_details.h" | |
| 6 | |
| 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | |
| 8 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" | |
| 9 #include "chrome/browser/worker_host/worker_service.h" | |
| 10 | |
| 11 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request, | |
| 12 int cert_id) | |
| 13 : url_(request->url()), | |
| 14 original_url_(request->original_url()), | |
| 15 method_(request->method()), | |
| 16 referrer_(request->referrer()), | |
| 17 has_upload_(request->has_upload()), | |
| 18 load_flags_(request->load_flags()), | |
| 19 status_(request->status()), | |
| 20 ssl_cert_id_(cert_id), | |
| 21 ssl_cert_status_(request->ssl_info().cert_status) { | |
| 22 const ResourceDispatcherHostRequestInfo* info = | |
| 23 ResourceDispatcherHost::InfoForRequest(request); | |
| 24 DCHECK(info); | |
| 25 resource_type_ = info->resource_type(); | |
| 26 | |
| 27 // If request is from the worker process on behalf of a renderer, use | |
| 28 // the renderer process id, since it consumes the notification response | |
| 29 // such as ssl state etc. | |
| 30 // TODO(atwilson): need to notify all associated renderers in the case | |
| 31 // of ssl state change (http://crbug.com/25357). For now, just notify | |
| 32 // the first one (works for dedicated workers and shared workers with | |
| 33 // a single process). | |
| 34 int temp; | |
| 35 if (!WorkerService::GetInstance()->GetRendererForWorker( | |
| 36 info->child_id(), &origin_child_id_, &temp)) { | |
| 37 origin_child_id_ = info->child_id(); | |
| 38 } | |
| 39 } | |
| 40 | |
| 41 ResourceRequestDetails::~ResourceRequestDetails() {} | |
| 42 | |
| 43 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request, | |
| 44 int cert_id, | |
| 45 const GURL& new_url) | |
| 46 : ResourceRequestDetails(request, cert_id), | |
| 47 new_url_(new_url) { | |
| 48 } | |
| 49 | |
| 50 ResourceRedirectDetails::~ResourceRedirectDetails() {} | |
| OLD | NEW |