OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 response->setHTTPStatusCode(headers->response_code()); | 252 response->setHTTPStatusCode(headers->response_code()); |
253 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText())); | 253 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText())); |
254 | 254 |
255 // TODO(darin): We should leverage HttpResponseHeaders for this, and this | 255 // TODO(darin): We should leverage HttpResponseHeaders for this, and this |
256 // should be using the same code as ResourceDispatcherHost. | 256 // should be using the same code as ResourceDispatcherHost. |
257 // TODO(jungshik): Figure out the actual value of the referrer charset and | 257 // TODO(jungshik): Figure out the actual value of the referrer charset and |
258 // pass it to GetSuggestedFilename. | 258 // pass it to GetSuggestedFilename. |
259 std::string value; | 259 std::string value; |
260 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) { | 260 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) { |
261 response->setSuggestedFileName( | 261 response->setSuggestedFileName( |
262 net::GetSuggestedFilename(url, value, "", string16())); | 262 net::GetSuggestedFilename(url, value, "", "", string16())); |
263 } | 263 } |
264 | 264 |
265 Time time_val; | 265 Time time_val; |
266 if (headers->GetLastModifiedValue(&time_val)) | 266 if (headers->GetLastModifiedValue(&time_val)) |
267 response->setLastModifiedDate(time_val.ToDoubleT()); | 267 response->setLastModifiedDate(time_val.ToDoubleT()); |
268 | 268 |
269 // Build up the header map. | 269 // Build up the header map. |
270 void* iter = NULL; | 270 void* iter = NULL; |
271 std::string name; | 271 std::string name; |
272 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { | 272 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 755 |
756 void WebURLLoaderImpl::cancel() { | 756 void WebURLLoaderImpl::cancel() { |
757 context_->Cancel(); | 757 context_->Cancel(); |
758 } | 758 } |
759 | 759 |
760 void WebURLLoaderImpl::setDefersLoading(bool value) { | 760 void WebURLLoaderImpl::setDefersLoading(bool value) { |
761 context_->SetDefersLoading(value); | 761 context_->SetDefersLoading(value); |
762 } | 762 } |
763 | 763 |
764 } // namespace webkit_glue | 764 } // namespace webkit_glue |
OLD | NEW |