| Index: net/url_request/url_request_http_job.cc
|
| diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
| index 7207777517db74bcfff9d1a4abb8ceb80b655dc5..9453a861a263967673f42e8c313278af8c670002 100644
|
| --- a/net/url_request/url_request_http_job.cc
|
| +++ b/net/url_request/url_request_http_job.cc
|
| @@ -25,6 +25,7 @@
|
| #include "net/base/sdch_manager.h"
|
| #include "net/cert/cert_status_flags.h"
|
| #include "net/cookies/cookie_monster.h"
|
| +#include "net/http/http_content_disposition.h"
|
| #include "net/http/http_network_session.h"
|
| #include "net/http/http_request_headers.h"
|
| #include "net/http/http_response_headers.h"
|
| @@ -58,6 +59,7 @@ class URLRequestHttpJob::HttpFilterContext : public FilterContext {
|
| // FilterContext implementation.
|
| virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
|
| virtual bool GetURL(GURL* gurl) const OVERRIDE;
|
| + virtual bool GetFilename(std::string* filename) const OVERRIDE;
|
| virtual base::Time GetRequestTime() const OVERRIDE;
|
| virtual bool IsCachedContent() const OVERRIDE;
|
| virtual bool IsDownload() const OVERRIDE;
|
| @@ -96,6 +98,21 @@ bool URLRequestHttpJob::HttpFilterContext::GetURL(GURL* gurl) const {
|
| return true;
|
| }
|
|
|
| +bool URLRequestHttpJob::HttpFilterContext::GetFilename(
|
| + std::string* filename) const {
|
| + HttpResponseHeaders* headers = job_->GetResponseHeaders();
|
| + std::string disposition;
|
| + void *iter = NULL;
|
| + if (!headers->EnumerateHeader(&iter, "Content-Disposition", &disposition))
|
| + return false;
|
| + HttpContentDisposition parsed_disposition(disposition, std::string());
|
| + std::string parsed_filename = parsed_disposition.filename();
|
| + if (parsed_filename.empty())
|
| + return false;
|
| + *filename = parsed_filename;
|
| + return true;
|
| +}
|
| +
|
| base::Time URLRequestHttpJob::HttpFilterContext::GetRequestTime() const {
|
| return job_->request() ? job_->request()->request_time() : base::Time();
|
| }
|
|
|