Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: webkit/glue/weburlloader_impl.cc

Issue 10383201: Expose HTTP version number in responses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge.
6 6
7 #include "webkit/glue/weburlloader_impl.h" 7 #include "webkit/glue/weburlloader_impl.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 load_info.addResponseHeader(WebString::fromUTF8(it->first), 222 load_info.addResponseHeader(WebString::fromUTF8(it->first),
223 WebString::fromUTF8(it->second)); 223 WebString::fromUTF8(it->second));
224 } 224 }
225 response->setHTTPLoadInfo(load_info); 225 response->setHTTPLoadInfo(load_info);
226 } 226 }
227 227
228 const net::HttpResponseHeaders* headers = info.headers; 228 const net::HttpResponseHeaders* headers = info.headers;
229 if (!headers) 229 if (!headers)
230 return; 230 return;
231 231
232 WebURLResponse::HTTPVersion version = WebURLResponse::Unknown;
233 if (headers->GetHttpVersion() == net::HttpVersion(0, 9))
234 version = WebURLResponse::HTTP_0_9;
235 else if (headers->GetHttpVersion() == net::HttpVersion(1, 0))
236 version = WebURLResponse::HTTP_1_0;
237 else if (headers->GetHttpVersion() == net::HttpVersion(1, 1))
darin (slow to review) 2012/05/21 23:39:07 you should probably complain if GetHttpVersion() r
Ami GONE FROM CHROMIUM 2012/05/21 23:49:23 What kind of complaint did you have in mind? (no
238 version = WebURLResponse::HTTP_1_1;
239 response->setHTTPVersion(version);
232 response->setHTTPStatusCode(headers->response_code()); 240 response->setHTTPStatusCode(headers->response_code());
233 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText())); 241 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText()));
234 242
235 // TODO(darin): We should leverage HttpResponseHeaders for this, and this 243 // TODO(darin): We should leverage HttpResponseHeaders for this, and this
236 // should be using the same code as ResourceDispatcherHost. 244 // should be using the same code as ResourceDispatcherHost.
237 // TODO(jungshik): Figure out the actual value of the referrer charset and 245 // TODO(jungshik): Figure out the actual value of the referrer charset and
238 // pass it to GetSuggestedFilename. 246 // pass it to GetSuggestedFilename.
239 std::string value; 247 std::string value;
240 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) { 248 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) {
241 response->setSuggestedFileName( 249 response->setSuggestedFileName(
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 768
761 void WebURLLoaderImpl::setDefersLoading(bool value) { 769 void WebURLLoaderImpl::setDefersLoading(bool value) {
762 context_->SetDefersLoading(value); 770 context_->SetDefersLoading(value);
763 } 771 }
764 772
765 void WebURLLoaderImpl::UpdateRoutingId(int new_routing_id) { 773 void WebURLLoaderImpl::UpdateRoutingId(int new_routing_id) {
766 context_->UpdateRoutingId(new_routing_id); 774 context_->UpdateRoutingId(new_routing_id);
767 } 775 }
768 776
769 } // namespace webkit_glue 777 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | webkit/media/buffered_resource_loader.cc » ('j') | webkit/media/buffered_resource_loader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698