summaryrefslogtreecommitdiffstats
path: root/webkit/glue/weburlloader_impl.cc
diff options
context:
space:
mode:
authorcaseq@google.com <caseq@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-06 16:16:05 +0000
committercaseq@google.com <caseq@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-06 16:16:05 +0000
commitb707912881d14be9da53f20e35937f7e4f458550 (patch)
treeaeb92912f2c2550778cfcb5a37d2d91a226da99a /webkit/glue/weburlloader_impl.cc
parentabc7e06dd115173991e19456940f3af933287b10 (diff)
downloadchromium_src-b707912881d14be9da53f20e35937f7e4f458550.zip
chromium_src-b707912881d14be9da53f20e35937f7e4f458550.tar.gz
chromium_src-b707912881d14be9da53f20e35937f7e4f458550.tar.bz2
Added support for raw headers.
Added DevToolsNetLogObserver (used by the above) BUG=http://crbug.com/41916 TEST=none Review URL: http://codereview.chromium.org/3133016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/weburlloader_impl.cc')
-rw-r--r--webkit/glue/weburlloader_impl.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index ad3e5fe..528cc19 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -18,6 +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/WebSecurityPolicy.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLError.h"
@@ -36,6 +37,7 @@ using base::TimeDelta;
using WebKit::WebData;
using WebKit::WebHTTPBody;
using WebKit::WebHTTPHeaderVisitor;
+using WebKit::WebResourceRawHeaders;
using WebKit::WebSecurityPolicy;
using WebKit::WebString;
using WebKit::WebURL;
@@ -163,6 +165,8 @@ bool GetInfoFromDataURL(const GURL& url,
return false;
}
+typedef ResourceLoaderBridge::DevToolsInfo::HeadersVector HeadersVector;
+
void PopulateURLResponse(
const GURL& url,
const ResourceLoaderBridge::ResponseInfo& info,
@@ -203,6 +207,25 @@ void PopulateURLResponse(
timing.setReceiveHeadersEnd(timing_info.receive_headers_end);
response->setLoadTiming(timing);
+ if (info.devtools_info.get()) {
+ WebResourceRawHeaders rawHeaders;
+
+ const HeadersVector& request_headers = info.devtools_info->request_headers;
+ for (HeadersVector::const_iterator it = request_headers .begin();
+ it != request_headers.end(); ++it) {
+ rawHeaders.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),
+ WebString::fromUTF8(it->second));
+ }
+ response->setResourceRawHeaders(rawHeaders);
+ }
+
const net::HttpResponseHeaders* headers = info.headers;
if (!headers)
return;
@@ -364,6 +387,8 @@ void WebURLLoaderImpl::Context::Start(
load_flags |= net::LOAD_ENABLE_UPLOAD_PROGRESS;
if (request.reportLoadTiming())
load_flags |= net::LOAD_ENABLE_LOAD_TIMING;
+ if (request.reportRawHeaders())
+ load_flags |= net::LOAD_REPORT_RAW_HEADERS;
if (!request.allowCookies() || !request.allowStoredCredentials()) {
load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES;
@@ -373,7 +398,6 @@ void WebURLLoaderImpl::Context::Start(
if (!request.allowStoredCredentials())
load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA;
-
// TODO(jcampan): in the non out-of-process plugin case the request does not
// have a requestor_pid. Find a better place to set this.
int requestor_pid = request.requestorProcessID();