Skip to content

Commit

Permalink
Added HTTP response code field to ResourceRequestDetails.
Browse files Browse the repository at this point in the history
BUG=361585

Review URL: https://codereview.chromium.org/226183015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262987 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pdamek@opera.com committed Apr 10, 2014
1 parent 9bfc380 commit 0ee1d0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions content/public/browser/resource_request_details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "content/browser/worker_host/worker_service_impl.h"
#include "content/public/browser/resource_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"

namespace content {
Expand All @@ -25,6 +26,9 @@ ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request,
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
resource_type = info->GetResourceType();
render_frame_id = info->GetRenderFrameID();
http_response_code =
request->response_info().headers.get() ?
request->response_info().headers.get()->response_code() : -1;

// If request is from the worker process on behalf of a renderer, use
// the renderer process id, since it consumes the notification response
Expand Down
3 changes: 3 additions & 0 deletions content/public/browser/resource_request_details.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ struct ResourceRequestDetails {
ResourceType::Type resource_type;
net::HostPortPair socket_address;
int render_frame_id;
// HTTP response code. See HttpResponseHeaders::response_code().
// -1 if there are no response headers yet.
int http_response_code;
};

// Details about a redirection of a resource request.
Expand Down

0 comments on commit 0ee1d0f

Please sign in to comment.