Remove ResourceResponse::m_suggestedFilename
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Sep 2014 20:00:11 +0000 (20:00 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Sep 2014 20:00:11 +0000 (20:00 +0000)
commit649c84a134384719d6c1e60024dfd8412ff0678f
tree673b951973c5d7e2991eed7b003f27be278b4d2b
parent6678ada92e7b0d35f2b5a59de619770b977e5287
Remove ResourceResponse::m_suggestedFilename
https://bugs.webkit.org/show_bug.cgi?id=136534

Reviewed by Alexey Proskuryakov.

Source/WebCore:

This will simplify things.

* WebCore.exp.in:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willLoadMediaElementURL):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCache):
* loader/archive/ArchiveResource.cpp:
(WebCore::ArchiveResource::create):
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::ResourceResponseBase):
(WebCore::ResourceResponseBase::adopt):
(WebCore::ResourceResponseBase::copyData):
(WebCore::ResourceResponseBase::suggestedFilename):
(WebCore::ResourceResponseBase::httpStatusText):
(WebCore::ResourceResponseBase::setHTTPStatusText):
(WebCore::ResourceResponseBase::httpHeaderField):
(WebCore::ResourceResponseBase::setHTTPHeaderField):
(WebCore::ResourceResponseBase::addHTTPHeaderField):
(WebCore::ResourceResponseBase::httpHeaderFields):
(WebCore::ResourceResponseBase::isAttachment):
(WebCore::ResourceResponseBase::wasCached):
(WebCore::ResourceResponseBase::connectionReused):
(WebCore::ResourceResponseBase::setConnectionReused):
(WebCore::ResourceResponseBase::connectionID):
(WebCore::ResourceResponseBase::setConnectionID):

    Remove AllFields initialization. It was only used to get m_suggestedFilename.
    Rename CommonAndUncommonFields to AllFields

(WebCore::ResourceResponseBase::setSuggestedFilename): Deleted.

    No more setter.

* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::platformSuggestedFileName):

    Get the suggested filename from the platform class on-demand.

* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):

    Remove never-used file name constructor parameter.

* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::platformLazyInit):
* platform/network/mac/ResourceResponseMac.mm:
(WebCore::ResourceResponse::initNSURLResponse):

    Synthesize HTTP response properly so it can hold Content-Disposition for file name (and other headers).

(WebCore::ResourceResponse::platformLazyInit):

    Don't pull the suggested filename anymore.

(WebCore::ResourceResponse::platformSuggestedFilename):

    Get the suggested name from the (possibly synthetic) NSURLRequest.

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceResponse>::encode):
(IPC::ArgumentCoder<ResourceResponse>::decode):

    No more m_suggestedFilename.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::addArchiveResource):

    Fake the suggested filename by using the Content-Disposition header.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
Source/WebCore/loader/archive/ArchiveResource.cpp
Source/WebCore/platform/network/BlobResourceHandle.cpp
Source/WebCore/platform/network/ResourceResponseBase.cpp
Source/WebCore/platform/network/ResourceResponseBase.h
Source/WebCore/platform/network/cf/ResourceResponse.h
Source/WebCore/platform/network/cf/ResourceResponseCFNet.cpp
Source/WebCore/platform/network/mac/ResourceResponseMac.mm
Source/WebCore/plugins/PluginStream.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm