OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/public/browser/resource_request_details.h" | 5 #include "content/public/browser/resource_request_details.h" |
6 | 6 |
7 #include "content/browser/worker_host/worker_service_impl.h" | 7 #include "content/browser/worker_host/worker_service_impl.h" |
8 #include "content/public/browser/resource_request_info.h" | 8 #include "content/public/browser/resource_request_info.h" |
9 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request, | 13 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request, |
jar (doing other things)
2013/06/18 01:33:49
Question: Why isn't this a const ref? generally we
kouhei (in TOK)
2013/06/18 22:28:41
I'd like to address this in separate CL.
| |
14 int cert_id) | 14 int cert_id, |
15 PageTransition transition) | |
15 : url(request->url()), | 16 : url(request->url()), |
16 original_url(request->original_url()), | 17 original_url(request->original_url()), |
17 method(request->method()), | 18 method(request->method()), |
18 referrer(request->referrer()), | 19 referrer(request->referrer()), |
19 has_upload(request->has_upload()), | 20 has_upload(request->has_upload()), |
20 load_flags(request->load_flags()), | 21 load_flags(request->load_flags()), |
21 status(request->status()), | 22 status(request->status()), |
22 ssl_cert_id(cert_id), | 23 ssl_cert_id(cert_id), |
23 ssl_cert_status(request->ssl_info().cert_status), | 24 ssl_cert_status(request->ssl_info().cert_status), |
24 socket_address(request->GetSocketAddress()) { | 25 socket_address(request->GetSocketAddress()), |
26 page_transition(transition) { | |
25 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 27 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
26 resource_type = info->GetResourceType(); | 28 resource_type = info->GetResourceType(); |
27 frame_id = info->GetFrameID(); | 29 frame_id = info->GetFrameID(); |
28 | 30 |
29 // If request is from the worker process on behalf of a renderer, use | 31 // If request is from the worker process on behalf of a renderer, use |
30 // the renderer process id, since it consumes the notification response | 32 // the renderer process id, since it consumes the notification response |
31 // such as ssl state etc. | 33 // such as ssl state etc. |
32 // TODO(atwilson): need to notify all associated renderers in the case | 34 // TODO(atwilson): need to notify all associated renderers in the case |
33 // of ssl state change (http://crbug.com/25357). For now, just notify | 35 // of ssl state change (http://crbug.com/25357). For now, just notify |
34 // the first one (works for dedicated workers and shared workers with | 36 // the first one (works for dedicated workers and shared workers with |
35 // a single process). | 37 // a single process). |
36 if (!WorkerServiceImpl::GetInstance()->GetRendererForWorker( | 38 if (!WorkerServiceImpl::GetInstance()->GetRendererForWorker( |
37 info->GetChildID(), &origin_child_id, &origin_route_id)) { | 39 info->GetChildID(), &origin_child_id, &origin_route_id)) { |
38 origin_child_id = info->GetChildID(); | 40 origin_child_id = info->GetChildID(); |
39 origin_route_id = info->GetRouteID(); | 41 origin_route_id = info->GetRouteID(); |
40 } | 42 } |
41 } | 43 } |
42 | 44 |
43 ResourceRequestDetails::~ResourceRequestDetails() {} | 45 ResourceRequestDetails::~ResourceRequestDetails() {} |
44 | 46 |
45 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request, | 47 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request, |
46 int cert_id, | 48 int cert_id, |
49 PageTransition transition, | |
47 const GURL& new_url) | 50 const GURL& new_url) |
48 : ResourceRequestDetails(request, cert_id), | 51 : ResourceRequestDetails(request, cert_id, transition), |
49 new_url(new_url) { | 52 new_url(new_url) { |
50 } | 53 } |
51 | 54 |
52 ResourceRedirectDetails::~ResourceRedirectDetails() {} | 55 ResourceRedirectDetails::~ResourceRedirectDetails() {} |
53 | 56 |
54 } // namespace content | 57 } // namespace content |
OLD | NEW |