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

Side by Side Diff: content/browser/renderer_host/resource_request_details.cc

Issue 9580002: Add ResourceRequestInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser/renderer_host/resource_request_details.h" 5 #include "content/browser/renderer_host/resource_request_details.h"
6 6
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" 7 #include "content/browser/renderer_host/resource_dispatcher_host.h"
8 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 8 #include "content/browser/renderer_host/resource_request_info_impl.h"
9 #include "content/browser/worker_host/worker_service_impl.h" 9 #include "content/browser/worker_host/worker_service_impl.h"
10 10
11 using content::ResourceRequestInfoImpl;
11 using content::WorkerServiceImpl; 12 using content::WorkerServiceImpl;
12 13
13 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request, 14 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request,
14 int cert_id) 15 int cert_id)
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()) {
25 const ResourceDispatcherHostRequestInfo* info = 26 const ResourceRequestInfoImpl* info =
26 ResourceDispatcherHost::InfoForRequest(request); 27 ResourceDispatcherHost::InfoForRequest(request);
27 resource_type_ = info->resource_type(); 28 resource_type_ = info->GetResourceType();
28 frame_id_ = info->frame_id(); 29 frame_id_ = info->GetFrameID();
29 30
30 // 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
31 // the renderer process id, since it consumes the notification response 32 // the renderer process id, since it consumes the notification response
32 // such as ssl state etc. 33 // such as ssl state etc.
33 // TODO(atwilson): need to notify all associated renderers in the case 34 // TODO(atwilson): need to notify all associated renderers in the case
34 // 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
35 // the first one (works for dedicated workers and shared workers with 36 // the first one (works for dedicated workers and shared workers with
36 // a single process). 37 // a single process).
37 int temp; 38 int temp;
38 if (!WorkerServiceImpl::GetInstance()->GetRendererForWorker( 39 if (!WorkerServiceImpl::GetInstance()->GetRendererForWorker(
39 info->child_id(), &origin_child_id_, &temp)) { 40 info->GetChildID(), &origin_child_id_, &temp)) {
40 origin_child_id_ = info->child_id(); 41 origin_child_id_ = info->GetChildID();
41 } 42 }
42 } 43 }
43 44
44 ResourceRequestDetails::~ResourceRequestDetails() {} 45 ResourceRequestDetails::~ResourceRequestDetails() {}
45 46
46 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request, 47 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request,
47 int cert_id, 48 int cert_id,
48 const GURL& new_url) 49 const GURL& new_url)
49 : ResourceRequestDetails(request, cert_id), 50 : ResourceRequestDetails(request, cert_id),
50 new_url_(new_url) { 51 new_url_(new_url) {
51 } 52 }
52 53
53 ResourceRedirectDetails::~ResourceRedirectDetails() {} 54 ResourceRedirectDetails::~ResourceRedirectDetails() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698