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: http://svn.webkit.org/repository/webkit/trunk@173272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
index ac124ab..9c2363e 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -472,7 +472,7 @@
URL url = m_substituteData.responseURL();
if (url.isEmpty())
url = m_request.url();
- ResourceResponse response(url, m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding(), "");
+ ResourceResponse response(url, m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding());
responseReceived(0, response);
}
@@ -1385,7 +1385,7 @@
if (m_request.url().isEmpty() && !frameLoader()->stateMachine().creatingInitialEmptyDocument())
m_request.setURL(blankURL());
String mimeType = shouldLoadEmpty ? "text/html" : frameLoader()->client().generatedMIMETypeForURLScheme(m_request.url().protocol());
- m_response = ResourceResponse(m_request.url(), mimeType, 0, String(), String());
+ m_response = ResourceResponse(m_request.url(), mimeType, 0, String());
finishedLoading(monotonicallyIncreasingTime());
return true;
}
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 77e8e0a..06305d7 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -1513,7 +1513,7 @@
unsigned long identifier;
ResourceError error;
requestFromDelegate(request, identifier, error);
- notifier().sendRemainingDelegateMessages(m_documentLoader.get(), identifier, request, ResourceResponse(url, String(), -1, String(), String()), 0, -1, -1, error);
+ notifier().sendRemainingDelegateMessages(m_documentLoader.get(), identifier, request, ResourceResponse(url, String(), -1, String()), 0, -1, -1, error);
url = request.url();
diff --git a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
index 4e71c2e..0358f3d 100644
--- a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
+++ b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
@@ -1159,7 +1159,7 @@
String mimeType = cacheStatement.getColumnText(3);
String textEncodingName = cacheStatement.getColumnText(4);
- ResourceResponse response(url, mimeType, size, textEncodingName, "");
+ ResourceResponse response(url, mimeType, size, textEncodingName);
response.setHTTPStatusCode(httpStatusCode);
String headers = cacheStatement.getColumnText(5);
diff --git a/Source/WebCore/loader/archive/ArchiveResource.cpp b/Source/WebCore/loader/archive/ArchiveResource.cpp
index 3d5c62c..4b05fdc 100644
--- a/Source/WebCore/loader/archive/ArchiveResource.cpp
+++ b/Source/WebCore/loader/archive/ArchiveResource.cpp
@@ -49,7 +49,7 @@
if (response.isNull()) {
unsigned dataSize = data->size();
return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName,
- ResourceResponse(url, mimeType, dataSize, textEncoding, String())));
+ ResourceResponse(url, mimeType, dataSize, textEncoding)));
}
return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, response));
}