summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 11:33:16 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 11:33:16 +0000
commit54e981d2ed56b5becca0dcbd6d2f13503f0bfc01 (patch)
treed51bc727330a4f901794b3bec8657c138d4d72b6
parentf681c78a89e758ff1255708569fd6562af28b574 (diff)
downloadchromium_src-54e981d2ed56b5becca0dcbd6d2f13503f0bfc01.zip
chromium_src-54e981d2ed56b5becca0dcbd6d2f13503f0bfc01.tar.gz
chromium_src-54e981d2ed56b5becca0dcbd6d2f13503f0bfc01.tar.bz2
DevTools: provide response code and status text as a part of raw headers data.
BUG=44867 TEST= Review URL: http://codereview.chromium.org/5106002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66763 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--chrome/browser/debugger/devtools_netlog_observer.cc2
-rw-r--r--chrome/common/render_messages.cc4
-rw-r--r--webkit/glue/resource_loader_bridge.cc4
-rw-r--r--webkit/glue/resource_loader_bridge.h2
-rw-r--r--webkit/glue/weburlloader_impl.cc18
6 files changed, 23 insertions, 9 deletions
diff --git a/DEPS b/DEPS
index d0cacaf..28ae8ee 100644
--- a/DEPS
+++ b/DEPS
@@ -4,7 +4,7 @@ vars = {
"googlecode_url": "http://%s.googlecode.com/svn",
"webkit_trunk": "http://svn.webkit.org/repository/webkit/trunk",
"nacl_trunk": "http://src.chromium.org/native_client/trunk",
- "webkit_revision": "72369",
+ "webkit_revision": "72376",
"skia_revision": "626",
"chromium_git": "http://git.chromium.org/git",
"swig_revision": "40423",
diff --git a/chrome/browser/debugger/devtools_netlog_observer.cc b/chrome/browser/debugger/devtools_netlog_observer.cc
index c92c0e1..35368a1 100644
--- a/chrome/browser/debugger/devtools_netlog_observer.cc
+++ b/chrome/browser/debugger/devtools_netlog_observer.cc
@@ -90,6 +90,8 @@ void DevToolsNetLogObserver::OnAddEntry(net::NetLog::EventType type,
case net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS: {
const net::HttpResponseHeaders& response_headers =
static_cast<net::NetLogHttpResponseParameter*>(params)->GetHeaders();
+ info->http_status_code = response_headers.response_code();
+ info->http_status_text = response_headers.GetStatusText();
std::string name, value;
for (void* it = NULL;
response_headers.EnumerateHeaderLines(&it, &name, &value); ) {
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index e6d3126..0ee8841 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -428,6 +428,8 @@ void ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Write(
Message* m, const param_type& p) {
WriteParam(m, p.get() != NULL);
if (p.get()) {
+ WriteParam(m, p->http_status_code);
+ WriteParam(m, p->http_status_text);
WriteParam(m, p->request_headers);
WriteParam(m, p->response_headers);
}
@@ -442,6 +444,8 @@ bool ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Read(
return true;
*r = new webkit_glue::ResourceDevToolsInfo();
return
+ ReadParam(m, iter, &(*r)->http_status_code) &&
+ ReadParam(m, iter, &(*r)->http_status_text) &&
ReadParam(m, iter, &(*r)->request_headers) &&
ReadParam(m, iter, &(*r)->response_headers);
}
diff --git a/webkit/glue/resource_loader_bridge.cc b/webkit/glue/resource_loader_bridge.cc
index fe4db75..86029e2 100644
--- a/webkit/glue/resource_loader_bridge.cc
+++ b/webkit/glue/resource_loader_bridge.cc
@@ -27,7 +27,9 @@ ResourceLoadTimingInfo::ResourceLoadTimingInfo()
ResourceLoadTimingInfo::~ResourceLoadTimingInfo() {
}
-ResourceDevToolsInfo::ResourceDevToolsInfo() {}
+ResourceDevToolsInfo::ResourceDevToolsInfo()
+ : http_status_code(0) {
+}
ResourceDevToolsInfo::~ResourceDevToolsInfo() {}
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h
index 52447b4..bd2f8b9 100644
--- a/webkit/glue/resource_loader_bridge.h
+++ b/webkit/glue/resource_loader_bridge.h
@@ -105,6 +105,8 @@ struct ResourceDevToolsInfo : base::RefCounted<ResourceDevToolsInfo> {
ResourceDevToolsInfo();
~ResourceDevToolsInfo();
+ int32 http_status_code;
+ std::string http_status_text;
HeadersVector request_headers;
HeadersVector response_headers;
};
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index 9f7c325..a7f219d 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -18,7 +18,7 @@
#include "net/base/net_util.h"
#include "net/http/http_response_headers.h"
#include "third_party/WebKit/WebKit/chromium/public/WebHTTPHeaderVisitor.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebResourceRawHeaders.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebHTTPLoadInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLError.h"
@@ -37,7 +37,7 @@ using base::TimeDelta;
using WebKit::WebData;
using WebKit::WebHTTPBody;
using WebKit::WebHTTPHeaderVisitor;
-using WebKit::WebResourceRawHeaders;
+using WebKit::WebHTTPLoadInfo;
using WebKit::WebSecurityPolicy;
using WebKit::WebString;
using WebKit::WebURL;
@@ -208,22 +208,26 @@ void PopulateURLResponse(
response->setLoadTiming(timing);
if (info.devtools_info.get()) {
- WebResourceRawHeaders rawHeaders;
+ WebHTTPLoadInfo load_info;
+
+ load_info.setHTTPStatusCode(info.devtools_info->http_status_code);
+ load_info.setHTTPStatusText(WebString::fromUTF8(
+ info.devtools_info->http_status_text));
const HeadersVector& request_headers = info.devtools_info->request_headers;
- for (HeadersVector::const_iterator it = request_headers .begin();
+ for (HeadersVector::const_iterator it = request_headers.begin();
it != request_headers.end(); ++it) {
- rawHeaders.addRequestHeader(WebString::fromUTF8(it->first),
+ load_info.addRequestHeader(WebString::fromUTF8(it->first),
WebString::fromUTF8(it->second));
}
const HeadersVector& response_headers =
info.devtools_info->response_headers;
for (HeadersVector::const_iterator it = response_headers.begin();
it != response_headers.end(); ++it) {
- rawHeaders.addResponseHeader(WebString::fromUTF8(it->first),
+ load_info.addResponseHeader(WebString::fromUTF8(it->first),
WebString::fromUTF8(it->second));
}
- response->setResourceRawHeaders(rawHeaders);
+ response->setHTTPLoadInfo(load_info);
}
const net::HttpResponseHeaders* headers = info.headers;