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

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

Issue 7607013: Call GenerateSafeFilename() from GetSuggestedFilename(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 4 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
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 response->setHTTPStatusCode(headers->response_code()); 220 response->setHTTPStatusCode(headers->response_code());
221 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText())); 221 response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText()));
222 222
223 // TODO(darin): We should leverage HttpResponseHeaders for this, and this 223 // TODO(darin): We should leverage HttpResponseHeaders for this, and this
224 // should be using the same code as ResourceDispatcherHost. 224 // should be using the same code as ResourceDispatcherHost.
225 // TODO(jungshik): Figure out the actual value of the referrer charset and 225 // TODO(jungshik): Figure out the actual value of the referrer charset and
226 // pass it to GetSuggestedFilename. 226 // pass it to GetSuggestedFilename.
227 std::string value; 227 std::string value;
228 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) { 228 if (headers->EnumerateHeader(NULL, "content-disposition", &value)) {
229 response->setSuggestedFileName( 229 response->setSuggestedFileName(
230 net::GetSuggestedFilename(url, value, "", "", string16())); 230 net::GetSuggestedFilename(url, value, "", "", "", string16()));
231 } 231 }
232 232
233 Time time_val; 233 Time time_val;
234 if (headers->GetLastModifiedValue(&time_val)) 234 if (headers->GetLastModifiedValue(&time_val))
235 response->setLastModifiedDate(time_val.ToDoubleT()); 235 response->setLastModifiedDate(time_val.ToDoubleT());
236 236
237 // Build up the header map. 237 // Build up the header map.
238 void* iter = NULL; 238 void* iter = NULL;
239 std::string name; 239 std::string name;
240 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { 240 while (headers->EnumerateHeaderLines(&iter, &name, &value)) {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 723
724 void WebURLLoaderImpl::cancel() { 724 void WebURLLoaderImpl::cancel() {
725 context_->Cancel(); 725 context_->Cancel();
726 } 726 }
727 727
728 void WebURLLoaderImpl::setDefersLoading(bool value) { 728 void WebURLLoaderImpl::setDefersLoading(bool value) {
729 context_->SetDefersLoading(value); 729 context_->SetDefersLoading(value);
730 } 730 }
731 731
732 } // namespace webkit_glue 732 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « 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