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

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

Issue 7300005: Move filename determination to net_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 9 years, 5 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) 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 response->setHTTPStatusCode(headers->response_code()); 254 response->setHTTPStatusCode(headers->response_code());
255 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText())); 255 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText()));
256 256
257 // TODO(darin): We should leverage HttpResponseHeaders for this, and this 257 // TODO(darin): We should leverage HttpResponseHeaders for this, and this
258 // should be using the same code as ResourceDispatcherHost. 258 // should be using the same code as ResourceDispatcherHost.
259 // TODO(jungshik): Figure out the actual value of the referrer charset and 259 // TODO(jungshik): Figure out the actual value of the referrer charset and
260 // pass it to GetSuggestedFilename. 260 // pass it to GetSuggestedFilename.
261 std::string value; 261 std::string value;
262 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) { 262 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) {
263 response->setSuggestedFileName( 263 response->setSuggestedFileName(
264 net::GetSuggestedFilename(url, value, "", "", string16())); 264 net::GetSuggestedFilename(url, value, "", "", "", string16()));
265 } 265 }
266 266
267 Time time_val; 267 Time time_val;
268 if (headers->GetLastModifiedValue(&time_val)) 268 if (headers->GetLastModifiedValue(&time_val))
269 response->setLastModifiedDate(time_val.ToDoubleT()); 269 response->setLastModifiedDate(time_val.ToDoubleT());
270 270
271 // Build up the header map. 271 // Build up the header map.
272 void* iter = NULL; 272 void* iter = NULL;
273 std::string name; 273 std::string name;
274 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { 274 while (headers->EnumerateHeaderLines(&iter, &name, &value)) {
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 759
760 void WebURLLoaderImpl::cancel() { 760 void WebURLLoaderImpl::cancel() {
761 context_->Cancel(); 761 context_->Cancel();
762 } 762 }
763 763
764 void WebURLLoaderImpl::setDefersLoading(bool value) { 764 void WebURLLoaderImpl::setDefersLoading(bool value) {
765 context_->SetDefersLoading(value); 765 context_->SetDefersLoading(value);
766 } 766 }
767 767
768 } // namespace webkit_glue 768 } // namespace webkit_glue
OLDNEW
« net/base/net_util_unittest.cc ('K') | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698