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

Unified Diff: webkit/glue/weburlloader_impl.cc

Issue 11790003: Always make an attempt to fill in the suggested filename. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/weburlloader_impl.cc
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index aed0318ecb2ba6057cbff5dcf0985e121a3c31ac..6d2c41d2027d59818c1273a61413fb25767c63eb 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -245,11 +245,15 @@ void PopulateURLResponse(
// should be using the same code as ResourceDispatcherHost.
// TODO(jungshik): Figure out the actual value of the referrer charset and
// pass it to GetSuggestedFilename.
- std::string value;
- if (headers->EnumerateHeader(NULL, "content-disposition", &value)) {
- response->setSuggestedFileName(
- net::GetSuggestedFilename(url, value, "", "", "", std::string()));
- }
+ std::string disposition_filename;
+ headers->EnumerateHeader(NULL, "content-disposition", &disposition_filename);
+ response->setSuggestedFileName(
+ net::GetSuggestedFilename(url,
+ disposition_filename,
+ std::string(), // referrer_charset
+ std::string(), // suggested_name
+ std::string(), // mime_type
+ std::string())); // default_name
Time time_val;
if (headers->GetLastModifiedValue(&time_val))
@@ -258,9 +262,9 @@ void PopulateURLResponse(
// Build up the header map.
void* iter = NULL;
std::string name;
- while (headers->EnumerateHeaderLines(&iter, &name, &value)) {
+ while (headers->EnumerateHeaderLines(&iter, &name, &disposition_filename)) {
darin (slow to review) 2013/01/07 23:05:03 nit: This is an awkward use of the variable named
Avi (use Gerrit) 2013/01/07 23:08:26 I actually didn't see this second use of |value| :
response->addHTTPHeaderField(WebString::fromUTF8(name),
- WebString::fromUTF8(value));
+ WebString::fromUTF8(disposition_filename));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698