| Index: third_party/WebKit/Source/platform/network/ResourceResponse.cpp
|
| diff --git a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
|
| index 810420cda17fe08d8dcffb3d3b976abc19244549..3f2c9dbe423f89add344f035cad0966aee58eaf4 100644
|
| --- a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
|
| +++ b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
|
| @@ -26,9 +26,11 @@
|
|
|
| #include "platform/network/ResourceResponse.h"
|
|
|
| +#include "platform/HTTPNames.h"
|
| #include "wtf/CurrentTime.h"
|
| #include "wtf/PtrUtil.h"
|
| #include "wtf/StdLibExtras.h"
|
| +
|
| #include <memory>
|
|
|
| namespace blink {
|
| @@ -107,13 +109,11 @@ ResourceResponse::ResourceResponse()
|
| ResourceResponse::ResourceResponse(const KURL& url,
|
| const AtomicString& mimeType,
|
| long long expectedLength,
|
| - const AtomicString& textEncodingName,
|
| - const String& filename)
|
| + const AtomicString& textEncodingName)
|
| : m_url(url),
|
| m_mimeType(mimeType),
|
| m_expectedContentLength(expectedLength),
|
| m_textEncodingName(textEncodingName),
|
| - m_suggestedFilename(filename),
|
| m_httpStatusCode(0),
|
| m_lastModifiedDate(0),
|
| m_wasCached(false),
|
| @@ -152,7 +152,6 @@ ResourceResponse::ResourceResponse(CrossThreadResourceResponseData* data)
|
| setMimeType(AtomicString(data->m_mimeType));
|
| setExpectedContentLength(data->m_expectedContentLength);
|
| setTextEncodingName(AtomicString(data->m_textEncodingName));
|
| - setSuggestedFilename(data->m_suggestedFilename);
|
|
|
| setHTTPStatusCode(data->m_httpStatusCode);
|
| setHTTPStatusText(AtomicString(data->m_httpStatusText));
|
| @@ -215,7 +214,6 @@ std::unique_ptr<CrossThreadResourceResponseData> ResourceResponse::copyData()
|
| data->m_mimeType = mimeType().getString().isolatedCopy();
|
| data->m_expectedContentLength = expectedContentLength();
|
| data->m_textEncodingName = textEncodingName().getString().isolatedCopy();
|
| - data->m_suggestedFilename = suggestedFilename().isolatedCopy();
|
| data->m_httpStatusCode = httpStatusCode();
|
| data->m_httpStatusText = httpStatusText().getString().isolatedCopy();
|
| data->m_httpHeaders = httpHeaderFields().copyData();
|
| @@ -326,19 +324,6 @@ void ResourceResponse::setTextEncodingName(const AtomicString& encodingName) {
|
| m_textEncodingName = encodingName;
|
| }
|
|
|
| -// FIXME should compute this on the fly
|
| -const String& ResourceResponse::suggestedFilename() const {
|
| - return m_suggestedFilename;
|
| -}
|
| -
|
| -void ResourceResponse::setSuggestedFilename(const String& suggestedName) {
|
| - m_isNull = false;
|
| -
|
| - // FIXME: Suggested file name is calculated based on other headers. There
|
| - // should not be a setter for it.
|
| - m_suggestedFilename = suggestedName;
|
| -}
|
| -
|
| int ResourceResponse::httpStatusCode() const {
|
| return m_httpStatusCode;
|
| }
|
| @@ -538,9 +523,8 @@ double ResourceResponse::lastModified() const {
|
| }
|
|
|
| bool ResourceResponse::isAttachment() const {
|
| - static const char headerName[] = "content-disposition";
|
| static const char attachmentString[] = "attachment";
|
| - String value = m_httpHeaderFields.get(headerName);
|
| + String value = m_httpHeaderFields.get(HTTPNames::Content_Disposition);
|
| size_t loc = value.find(';');
|
| if (loc != kNotFound)
|
| value = value.left(loc);
|
| @@ -646,8 +630,6 @@ bool ResourceResponse::compare(const ResourceResponse& a,
|
| return false;
|
| if (a.textEncodingName() != b.textEncodingName())
|
| return false;
|
| - if (a.suggestedFilename() != b.suggestedFilename())
|
| - return false;
|
| if (a.httpStatusCode() != b.httpStatusCode())
|
| return false;
|
| if (a.httpStatusText() != b.httpStatusText())
|
|
|