diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 23:14:25 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 23:14:25 +0000 |
commit | 88e6b6f3251af7092432c33b7d372a17c7169904 (patch) | |
tree | 3fde374eed02ee05026449729952f0364609971b /webkit/appcache/appcache_update_job.cc | |
parent | da244100d3ac663a1f827fc712dc508c7761d207 (diff) | |
download | chromium_src-88e6b6f3251af7092432c33b7d372a17c7169904.zip chromium_src-88e6b6f3251af7092432c33b7d372a17c7169904.tar.gz chromium_src-88e6b6f3251af7092432c33b7d372a17c7169904.tar.bz2 |
Pass HttpRequestHeaders to URLRequest::SetExtraRequestHeaders().
BUG=22588
Review URL: http://codereview.chromium.org/1998008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_update_job.cc')
-rw-r--r-- | webkit/appcache/appcache_update_job.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc index fb2fad1..dd2c79e 100644 --- a/webkit/appcache/appcache_update_job.cc +++ b/webkit/appcache/appcache_update_job.cc @@ -10,6 +10,7 @@ #include "net/base/io_buffer.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" +#include "net/http/http_request_headers.h" #include "webkit/appcache/appcache_group.h" #include "webkit/appcache/appcache_policy.h" #include "webkit/appcache/appcache_response.h" @@ -274,15 +275,15 @@ void AppCacheUpdateJob::AddHttpHeadersAndFetch( URLRequest* request, const net::HttpResponseInfo* info) { DCHECK(request); if (info) { - std::string extra_headers; + net::HttpRequestHeaders extra_headers; // Add If-Modified-Since header if response info has Last-Modified header. const std::string last_modified = "Last-Modified"; std::string last_modified_value; info->headers->EnumerateHeader(NULL, last_modified, &last_modified_value); if (!last_modified_value.empty()) { - extra_headers.append("If-Modified-Since: "); - extra_headers.append(last_modified_value); + extra_headers.SetHeader(net::HttpRequestHeaders::kIfModifiedSince, + last_modified_value); } // Add If-None-Match header if resposne info has ETag header. @@ -290,13 +291,11 @@ void AppCacheUpdateJob::AddHttpHeadersAndFetch( std::string etag_value; info->headers->EnumerateHeader(NULL, etag, &etag_value); if (!etag_value.empty()) { - if (!extra_headers.empty()) - extra_headers.append("\r\n"); - extra_headers.append("If-None-Match: "); - extra_headers.append(etag_value); + extra_headers.SetHeader(net::HttpRequestHeaders::kIfNoneMatch, + etag_value); } - if (!extra_headers.empty()) + if (!extra_headers.IsEmpty()) request->SetExtraRequestHeaders(extra_headers); } request->Start(); |