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
3 // found in the LICENSE file.
5 #include "content/public/browser/resource_request_details.h"
7 #include "content/public/browser/resource_request_info.h"
8 #include "net/http/http_response_headers.h"
9 #include "net/url_request/url_request.h"
13 ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest
* request
,
15 : url(request
->url()),
16 original_url(request
->original_url()),
17 method(request
->method()),
18 referrer(request
->referrer()),
19 has_upload(request
->has_upload()),
20 load_flags(request
->load_flags()),
21 status(request
->status()),
23 ssl_cert_status(request
->ssl_info().cert_status
),
24 socket_address(request
->GetSocketAddress()) {
25 const ResourceRequestInfo
* info
= ResourceRequestInfo::ForRequest(request
);
26 resource_type
= info
->GetResourceType();
27 render_frame_id
= info
->GetRenderFrameID();
29 request
->response_info().headers
.get() ?
30 request
->response_info().headers
.get()->response_code() : -1;
31 origin_child_id
= info
->GetChildID();
34 ResourceRequestDetails::~ResourceRequestDetails() {}
36 ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest
* request
,
39 : ResourceRequestDetails(request
, cert_id
),
43 ResourceRedirectDetails::~ResourceRedirectDetails() {}
45 } // namespace content