Diff
Modified: trunk/Source/WebCore/ChangeLog (263889 => 263890)
--- trunk/Source/WebCore/ChangeLog 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/ChangeLog 2020-07-03 09:35:48 UTC (rev 263890)
@@ -1,3 +1,70 @@
+2020-07-03 Said Abou-Hallawa <[email protected]>
+
+ Change the names of MIMETypeRegistry methods to comply with webkit naming style
+ https://bugs.webkit.org/show_bug.cgi?id=213912
+
+ Reviewed by Youenn Fablet.
+
+ Remove the verb 'get' from the name of some of the methods of MIMETypeRegistry.
+
+ * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm:
+ (WebCore::if):
+ * fileapi/File.cpp:
+ (WebCore::File::computeNameAndContentType):
+ * html/HTMLPlugInElement.cpp:
+ (WebCore::pluginReplacementForType):
+ * loader/mac/LoaderNSURLExtras.mm:
+ (suggestedFilenameWithMIMEType):
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::commonMimeTypesMap):
+ (WebCore::MIMETypeRegistry::mediaMIMETypeForExtension):
+ (WebCore::MIMETypeRegistry::mimeTypeForPath):
+ (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
+ (WebCore::MIMETypeRegistry::normalizedMIMEType):
+ (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
+ (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Deleted.
+ (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Deleted.
+ Delete this function since it is not used.
+
+ (WebCore::MIMETypeRegistry::getMIMETypeForPath): Deleted.
+ (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Deleted.
+ * platform/MIMETypeRegistry.h:
+ * platform/cocoa/MIMETypeRegistryCocoa.mm:
+ (WebCore::MIMETypeRegistry::mimeTypeForExtension):
+ (WebCore::MIMETypeRegistry::extensionsForMIMEType):
+ (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType):
+ (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted.
+ (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted.
+ (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted.
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::load):
+ * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
+ (WebCore::ImageDecoderAVFObjC::filenameExtension const):
+ * platform/graphics/gstreamer/ImageDecoderGStreamer.h:
+ * platform/network/curl/CurlRequest.cpp:
+ (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
+ * platform/playstation/MIMETypeRegistryPlayStation.cpp:
+ (WebCore::MIMETypeRegistry::mimeTypeForExtension):
+ (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType):
+ (WebCore::MIMETypeRegistry::extensionsForMIMEType):
+ (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted.
+ (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted.
+ (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted.
+ * platform/win/MIMETypeRegistryWin.cpp:
+ (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType):
+ (WebCore::MIMETypeRegistry::mimeTypeForExtension):
+ (WebCore::MIMETypeRegistry::extensionsForMIMEType):
+ (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted.
+ (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted.
+ (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted.
+ * platform/xdg/MIMETypeRegistryXdg.cpp:
+ (WebCore::MIMETypeRegistry::mimeTypeForExtension):
+ (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType):
+ (WebCore::MIMETypeRegistry::extensionsForMIMEType):
+ (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted.
+ (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted.
+ (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted.
+
2020-07-03 Carlos Garcia Campos <[email protected]>
[GTK4] Enable threaded rendering by default
Modified: trunk/Source/WebCore/editing/cocoa/WebArchiveResourceFromNSAttributedString.mm (263889 => 263890)
--- trunk/Source/WebCore/editing/cocoa/WebArchiveResourceFromNSAttributedString.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/editing/cocoa/WebArchiveResourceFromNSAttributedString.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -45,7 +45,7 @@
if ([MIMEType isEqualToString:@"application/octet-stream"]) {
// FIXME: This is a workaround for <rdar://problem/36074429>, and can be removed once that is fixed.
- auto mimeTypeFromURL = MIMETypeRegistry::getMIMETypeForExtension(URL.pathExtension);
+ auto mimeTypeFromURL = MIMETypeRegistry::mimeTypeForExtension(URL.pathExtension);
if (!mimeTypeFromURL.isEmpty())
MIMEType = mimeTypeFromURL;
}
Modified: trunk/Source/WebCore/fileapi/File.cpp (263889 => 263890)
--- trunk/Source/WebCore/fileapi/File.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/fileapi/File.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -136,7 +136,7 @@
size_t index = effectiveName.reverseFind('.');
if (index != notFound) {
callOnMainThreadAndWait([&effectiveContentType, &effectiveName, index] {
- effectiveContentType = MIMETypeRegistry::getMIMETypeForExtension(effectiveName.substring(index + 1)).isolatedCopy();
+ effectiveContentType = MIMETypeRegistry::mimeTypeForExtension(effectiveName.substring(index + 1)).isolatedCopy();
});
}
}
Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (263889 => 263890)
--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -376,7 +376,7 @@
if (type.isEmpty()) {
if (extension.isEmpty())
return nullptr;
- type = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
+ type = MIMETypeRegistry::mediaMIMETypeForExtension(extension);
}
if (type.isEmpty())
Modified: trunk/Source/WebCore/loader/mac/LoaderNSURLExtras.mm (263889 => 263890)
--- trunk/Source/WebCore/loader/mac/LoaderNSURLExtras.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/loader/mac/LoaderNSURLExtras.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -71,11 +71,11 @@
// I don't think we need to worry about this for the image case
// If the type is known, check the extension and correct it if necessary.
if (mimeType != "application/octet-stream" && mimeType != "text/plain") {
- Vector<String> extensions = MIMETypeRegistry::getExtensionsForMIMEType(mimeType);
+ Vector<String> extensions = MIMETypeRegistry::extensionsForMIMEType(mimeType);
if (extensions.isEmpty() || !extensions.contains(String(extension))) {
// The extension doesn't match the MIME type. Correct this.
- NSString *correctExtension = MIMETypeRegistry::getPreferredExtensionForMIMEType(mimeType);
+ NSString *correctExtension = MIMETypeRegistry::preferredExtensionForMIMEType(mimeType);
if ([correctExtension length] != 0) {
// Append the correct extension.
filename = [filename stringByAppendingPathExtension:correctExtension];
Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (263889 => 263890)
--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -369,10 +369,10 @@
ASCIILiteral type = pair.type;
ASCIILiteral extension = pair.extension;
map.ensure(extension, [type, extension] {
- // First type in the vector must always be the one from getMIMETypeForExtension,
- // so we can use the map without also calling getMIMETypeForExtension each time.
+ // First type in the vector must always be the one from mimeTypeForExtension,
+ // so we can use the map without also calling mimeTypeForExtension each time.
Vector<String> synonyms;
- String systemType = MIMETypeRegistry::getMIMETypeForExtension(extension);
+ String systemType = MIMETypeRegistry::mimeTypeForExtension(extension);
if (!systemType.isEmpty() && type != systemType)
synonyms.append(systemType);
return synonyms;
@@ -391,31 +391,20 @@
return &mapEntry->value;
}
-String MIMETypeRegistry::getMediaMIMETypeForExtension(const String& extension)
+String MIMETypeRegistry::mediaMIMETypeForExtension(const String& extension)
{
auto* vector = typesForCommonExtension(extension);
if (vector)
return (*vector)[0];
- return getMIMETypeForExtension(extension);
+ return mimeTypeForExtension(extension);
}
-Vector<String> MIMETypeRegistry::getMediaMIMETypesForExtension(const String& extension)
+String MIMETypeRegistry::mimeTypeForPath(const String& path)
{
- auto* vector = typesForCommonExtension(extension);
- if (vector)
- return *vector;
- String type = getMIMETypeForExtension(extension);
- if (!type.isNull())
- return { { type } };
- return { };
-}
-
-String MIMETypeRegistry::getMIMETypeForPath(const String& path)
-{
size_t pos = path.reverseFind('.');
if (pos != notFound) {
String extension = path.substring(pos + 1);
- String result = getMIMETypeForExtension(extension);
+ String result = mimeTypeForExtension(extension);
if (result.length())
return result;
}
@@ -426,7 +415,7 @@
{
if (mimeType.isEmpty())
return false;
- String normalizedMIMEType = getNormalizedMIMEType(mimeType);
+ String normalizedMIMEType = MIMETypeRegistry::normalizedMIMEType(mimeType);
return supportedImageMIMETypes().contains(normalizedMIMEType) || additionalSupportedImageMIMETypes().contains(normalizedMIMEType);
}
@@ -714,7 +703,7 @@
// FIXME: Not sure why it makes sense to have a cross-platform function when only CURL has the concept
// of a "normalized" MIME type.
-String MIMETypeRegistry::getNormalizedMIMEType(const String& mimeType)
+String MIMETypeRegistry::normalizedMIMEType(const String& mimeType)
{
return mimeType;
}
@@ -721,7 +710,7 @@
#else
-String MIMETypeRegistry::getNormalizedMIMEType(const String& mimeType)
+String MIMETypeRegistry::normalizedMIMEType(const String& mimeType)
{
static const auto mimeTypeAssociationMap = makeNeverDestroyed([] {
static const std::pair<ASCIILiteral, ASCIILiteral> mimeTypeAssociations[] = {
@@ -792,7 +781,7 @@
if (filename.isEmpty() || filename.contains('.') || equalIgnoringASCIICase(mimeType, defaultMIMEType()))
return filename;
- auto preferredExtension = getPreferredExtensionForMIMEType(mimeType);
+ auto preferredExtension = preferredExtensionForMIMEType(mimeType);
if (preferredExtension.isEmpty())
return filename;
Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.h (263889 => 263890)
--- trunk/Source/WebCore/platform/MIMETypeRegistry.h 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.h 2020-07-03 09:35:48 UTC (rev 263890)
@@ -54,16 +54,13 @@
class MIMETypeRegistry {
public:
- WEBCORE_EXPORT static String getMIMETypeForExtension(const String& extension);
+ WEBCORE_EXPORT static String mimeTypeForExtension(const String& extension);
+ WEBCORE_EXPORT static Vector<String> extensionsForMIMEType(const String& type);
+ WEBCORE_EXPORT static String preferredExtensionForMIMEType(const String& type);
+ WEBCORE_EXPORT static String mediaMIMETypeForExtension(const String& extension);
- // FIXME: WebKit coding style says we should not have the word "get" in the names of these functions.
- WEBCORE_EXPORT static Vector<String> getExtensionsForMIMEType(const String& type);
- WEBCORE_EXPORT static String getPreferredExtensionForMIMEType(const String& type);
- WEBCORE_EXPORT static String getMediaMIMETypeForExtension(const String& extension);
- static Vector<String> getMediaMIMETypesForExtension(const String& extension);
+ static String mimeTypeForPath(const String& path);
- static String getMIMETypeForPath(const String& path);
-
static std::unique_ptr<MIMETypeRegistryThreadGlobalData> createMIMETypeRegistryThreadGlobalData();
// Check to see if a MIME type is suitable for being loaded inline as an
@@ -140,9 +137,8 @@
WEBCORE_EXPORT static const HashSet<String, ASCIICaseInsensitiveHash>& unsupportedTextMIMETypes();
WEBCORE_EXPORT static const HashSet<String, ASCIICaseInsensitiveHash>& systemPreviewMIMETypes();
- // FIXME: WebKit coding style says we should not have the word "get" in the name of this function.
// FIXME: Unclear what the concept of a normalized MIME type is; currently it's a platform-specific notion.
- static String getNormalizedMIMEType(const String&);
+ static String normalizedMIMEType(const String&);
WEBCORE_EXPORT static String appendFileExtensionIfNecessary(const String& filename, const String& mimeType);
Modified: trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm (263889 => 263890)
--- trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -85,12 +85,12 @@
return extensions;
}
-String MIMETypeRegistry::getMIMETypeForExtension(const String& extension)
+String MIMETypeRegistry::mimeTypeForExtension(const String& extension)
{
return [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:(NSString *)extension];
}
-Vector<String> MIMETypeRegistry::getExtensionsForMIMEType(const String& type)
+Vector<String> MIMETypeRegistry::extensionsForMIMEType(const String& type)
{
if (type.endsWith('*'))
return extensionsForWildcardMIMEType(type);
@@ -97,7 +97,7 @@
return makeVector<String>([[NSURLFileTypeMappings sharedMappings] extensionsForMIMEType:type]);
}
-String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& type)
+String MIMETypeRegistry::preferredExtensionForMIMEType(const String& type)
{
// System Previews accept some non-standard MIMETypes, so we can't rely on
// the file type mappings.
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (263889 => 263890)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -444,7 +444,7 @@
size_t pos = lastPathComponent.reverseFind('.');
if (pos != notFound) {
String extension = lastPathComponent.substring(pos + 1).toString();
- String mediaType = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
+ String mediaType = MIMETypeRegistry::mediaMIMETypeForExtension(extension);
if (!mediaType.isEmpty()) {
m_contentType = ContentType { WTFMove(mediaType) };
m_contentMIMETypeWasInferredFromExtension = true;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm (263889 => 263890)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -516,7 +516,7 @@
String ImageDecoderAVFObjC::filenameExtension() const
{
- return MIMETypeRegistry::getPreferredExtensionForMIMEType(m_mimeType);
+ return MIMETypeRegistry::preferredExtensionForMIMEType(m_mimeType);
}
IntSize ImageDecoderAVFObjC::frameSizeAtIndex(size_t, SubsamplingLevel) const
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.h (263889 => 263890)
--- trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.h 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.h 2020-07-03 09:35:48 UTC (rev 263890)
@@ -55,7 +55,7 @@
size_t frameCount() const final { return m_sampleData.size(); }
RepetitionCount repetitionCount() const final;
String uti() const final;
- String filenameExtension() const final { return MIMETypeRegistry::getPreferredExtensionForMIMEType(m_mimeType); }
+ String filenameExtension() const final { return MIMETypeRegistry::preferredExtensionForMIMEType(m_mimeType); }
Optional<IntPoint> hotSpot() const final { return WTF::nullopt; }
IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const final { return size(); }
Modified: trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp (263889 => 263890)
--- trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -592,7 +592,7 @@
ASSERT(url.isLocalFile());
// Determine the MIME type based on the path.
- auto mimeType = MIMETypeRegistry::getMIMETypeForPath(url.path().toString());
+ auto mimeType = MIMETypeRegistry::mimeTypeForPath(url.path().toString());
// DidReceiveResponse must not be called immediately
runOnWorkerThreadIfRequired([this, protectedThis = makeRef(*this), url = "" mimeType = crossThreadCopy(WTFMove(mimeType))]() mutable {
Modified: trunk/Source/WebCore/platform/playstation/MIMETypeRegistryPlayStation.cpp (263889 => 263890)
--- trunk/Source/WebCore/platform/playstation/MIMETypeRegistryPlayStation.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/playstation/MIMETypeRegistryPlayStation.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -57,7 +57,7 @@
return platformMediaTypes;
}
-String MIMETypeRegistry::getMIMETypeForExtension(const String& extension)
+String MIMETypeRegistry::mimeTypeForExtension(const String& extension)
{
for (auto& entry : platformMediaTypes()) {
if (equalIgnoringASCIICase(extension, entry.extension.characters()))
@@ -71,7 +71,7 @@
return false;
}
-String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& mimeType)
+String MIMETypeRegistry::preferredExtensionForMIMEType(const String& mimeType)
{
for (auto& entry : platformMediaTypes()) {
if (equalIgnoringASCIICase(mimeType, entry.type.characters()))
@@ -80,7 +80,7 @@
return emptyString();
}
-Vector<String> MIMETypeRegistry::getExtensionsForMIMEType(const String&)
+Vector<String> MIMETypeRegistry::extensionsForMIMEType(const String&)
{
ASSERT_NOT_IMPLEMENTED_YET();
return { };
Modified: trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp (263889 => 263890)
--- trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -48,7 +48,7 @@
return String();
}
-String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& type)
+String MIMETypeRegistry::preferredExtensionForMIMEType(const String& type)
{
String path = "MIME\\Database\\Content Type\\" + type;
WCHAR extStr[MAX_PATH];
@@ -63,7 +63,7 @@
return String();
}
-String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
+String MIMETypeRegistry::mimeTypeForExtension(const String &ext)
{
ASSERT(isMainThread());
@@ -114,7 +114,7 @@
return false;
}
-Vector<String> MIMETypeRegistry::getExtensionsForMIMEType(const String&)
+Vector<String> MIMETypeRegistry::extensionsForMIMEType(const String&)
{
ASSERT_NOT_IMPLEMENTED_YET();
return { };
Modified: trunk/Source/WebCore/platform/xdg/MIMETypeRegistryXdg.cpp (263889 => 263890)
--- trunk/Source/WebCore/platform/xdg/MIMETypeRegistryXdg.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebCore/platform/xdg/MIMETypeRegistryXdg.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -31,7 +31,7 @@
namespace WebCore {
-String MIMETypeRegistry::getMIMETypeForExtension(const String& extension)
+String MIMETypeRegistry::mimeTypeForExtension(const String& extension)
{
if (extension.isEmpty())
return String();
@@ -51,7 +51,7 @@
return false;
}
-String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& mimeType)
+String MIMETypeRegistry::preferredExtensionForMIMEType(const String& mimeType)
{
if (mimeType.isEmpty())
return String();
@@ -66,7 +66,7 @@
return returnValue;
}
-Vector<String> MIMETypeRegistry::getExtensionsForMIMEType(const String&)
+Vector<String> MIMETypeRegistry::extensionsForMIMEType(const String&)
{
ASSERT_NOT_IMPLEMENTED_YET();
return { };
Modified: trunk/Source/WebKit/ChangeLog (263889 => 263890)
--- trunk/Source/WebKit/ChangeLog 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/ChangeLog 2020-07-03 09:35:48 UTC (rev 263890)
@@ -1,3 +1,28 @@
+2020-07-03 Said Abou-Hallawa <[email protected]>
+
+ Change the names of MIMETypeRegistry methods to comply with webkit naming style
+ https://bugs.webkit.org/show_bug.cgi?id=213912
+
+ Reviewed by Youenn Fablet.
+
+ * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+ (WebKit::NetworkDataTaskSoup::didSendRequest):
+ * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
+ (API::mimeTypeInferredFromFileExtension):
+ (API::Attachment::setFileWrapperAndUpdateContentType):
+ * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
+ (-[WKOpenPanelParameters _allowedFileExtensions]):
+ * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
+ (webkitURISchemeRequestReadCallback):
+ * UIProcess/Automation/WebAutomationSession.cpp:
+ (WebKit::fileCanBeAcceptedForUpload):
+ * UIProcess/Plugins/PluginInfoStore.cpp:
+ (WebKit::PluginInfoStore::findPlugin):
+ * UIProcess/ios/forms/WKFileUploadPanel.mm:
+ (-[WKFileUploadPanel presentWithParameters:resultListener:]):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::objectContentType):
+
2020-07-03 Alexander Mikhaylenko <[email protected]>
[GTK4] Support kinetic scrolling
Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp (263889 => 263890)
--- trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -344,7 +344,7 @@
m_response.setSniffedContentType(soup_request_get_content_type(m_soupRequest.get()));
m_response.updateFromSoupMessage(m_soupMessage.get());
if (m_response.mimeType().isEmpty() && m_soupMessage->status_code != SOUP_STATUS_NOT_MODIFIED)
- m_response.setMimeType(MIMETypeRegistry::getMIMETypeForPath(m_response.url().path().toString()));
+ m_response.setMimeType(MIMETypeRegistry::mimeTypeForPath(m_response.url().path().toString()));
if (shouldStartHTTPRedirection()) {
m_inputStream = WTFMove(inputStream);
@@ -365,7 +365,7 @@
m_response.setTextEncodingName(extractCharsetFromMediaType(contentType));
m_response.setExpectedContentLength(soup_request_get_content_length(m_soupRequest.get()));
if (m_response.mimeType().isEmpty())
- m_response.setMimeType(MIMETypeRegistry::getMIMETypeForPath(m_response.url().path().toString()));
+ m_response.setMimeType(MIMETypeRegistry::mimeTypeForPath(m_response.url().path().toString()));
m_inputStream = WTFMove(inputStream);
}
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm (263889 => 263890)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -41,7 +41,7 @@
static WTF::String mimeTypeInferredFromFileExtension(const API::Attachment& attachment)
{
if (NSString *fileExtension = [(NSString *)attachment.fileName() pathExtension])
- return WebCore::MIMETypeRegistry::getMIMETypeForExtension(fileExtension);
+ return WebCore::MIMETypeRegistry::mimeTypeForExtension(fileExtension);
return { };
}
@@ -104,7 +104,7 @@
contentType = (NSString *)kUTTypeDirectory;
else if (fileWrapper.regularFile) {
if (NSString *pathExtension = (fileWrapper.filename.length ? fileWrapper.filename : fileWrapper.preferredFilename).pathExtension)
- contentType = WebCore::MIMETypeRegistry::getMIMETypeForExtension(pathExtension);
+ contentType = WebCore::MIMETypeRegistry::mimeTypeForExtension(pathExtension);
if (!contentType.length)
contentType = (NSString *)kUTTypeData;
}
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm (263889 => 263890)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -74,7 +74,7 @@
[acceptedMIMETypes enumerateObjectsUsingBlock:^(NSString *mimeType, NSUInteger index, BOOL* stop) {
ASSERT([mimeType containsString:@"/"]);
- auto extensions = API::Array::createStringArray(WebCore::MIMETypeRegistry::getExtensionsForMIMEType(mimeType));
+ auto extensions = API::Array::createStringArray(WebCore::MIMETypeRegistry::extensionsForMIMEType(mimeType));
[allowedFileExtensions addObjectsFromArray:wrapper(extensions)];
}];
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp (263889 => 263890)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -183,7 +183,7 @@
ResourceResponse response(priv->task->request().url(), extractMIMETypeFromMediaType(priv->contentType.data()), priv->streamLength, emptyString());
response.setTextEncodingName(extractCharsetFromMediaType(priv->contentType.data()));
if (response.mimeType().isEmpty())
- response.setMimeType(MIMETypeRegistry::getMIMETypeForPath(response.url().path().toString()));
+ response.setMimeType(MIMETypeRegistry::mimeTypeForPath(response.url().path().toString()));
priv->task->didReceiveResponse(response);
}
Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (263889 => 263890)
--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -861,7 +861,7 @@
if (allowedFileExtensions.contains(extension))
return true;
- String mappedMIMEType = WebCore::MIMETypeRegistry::getMIMETypeForExtension(extension).convertToASCIILowercase();
+ String mappedMIMEType = WebCore::MIMETypeRegistry::mimeTypeForExtension(extension).convertToASCIILowercase();
if (mappedMIMEType.isEmpty())
return false;
Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp (263889 => 263890)
--- trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -190,7 +190,7 @@
return plugin;
// Finally, try to get the MIME type from the extension in a platform specific manner and use that.
- String extensionMimeType = MIMETypeRegistry::getMIMETypeForExtension(extension);
+ String extensionMimeType = MIMETypeRegistry::mimeTypeForExtension(extension);
if (!extensionMimeType.isNull()) {
PluginModuleInfo plugin = findPluginForMIMEType(extensionMimeType, allowedPluginTypes);
if (!plugin.path.isNull()) {
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (263889 => 263890)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -250,7 +250,7 @@
Ref<API::Array> acceptFileExtensions = parameters->acceptFileExtensions();
for (auto extension : acceptFileExtensions->elementsOfType<API::String>()) {
- String mimeType = WebCore::MIMETypeRegistry::getMIMETypeForExtension(extension->stringView().substring(1).toString());
+ String mimeType = WebCore::MIMETypeRegistry::mimeTypeForExtension(extension->stringView().substring(1).toString());
if (!mimeType.isEmpty())
[mimeTypes addObject:mimeType];
}
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (263889 => 263890)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -1677,7 +1677,7 @@
auto extension = path.substring(dotPosition + 1).convertToASCIILowercase();
// Try to guess the MIME type from the extension.
- mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension);
+ mimeType = MIMETypeRegistry::mimeTypeForExtension(extension);
if (mimeType.isEmpty()) {
// Check if there's a plug-in around that can handle the extension.
if (auto* webPage = m_frame->page()) {
Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (263889 => 263890)
--- trunk/Source/WebKitLegacy/ios/ChangeLog 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog 2020-07-03 09:35:48 UTC (rev 263890)
@@ -1,3 +1,14 @@
+2020-07-03 Said Abou-Hallawa <[email protected]>
+
+ Change the names of MIMETypeRegistry methods to comply with webkit naming style
+ https://bugs.webkit.org/show_bug.cgi?id=213912
+
+ Reviewed by Youenn Fablet.
+
+ * WebCoreSupport/WebMIMETypeRegistry.mm:
+ (+[WebMIMETypeRegistry mimeTypeForExtension:]):
+ (+[WebMIMETypeRegistry preferredExtensionForMIMEType:]):
+
2020-05-15 Alex Christensen <[email protected]>
Use enum serialization instead of casting to/from uint32_t
Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebMIMETypeRegistry.mm (263889 => 263890)
--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebMIMETypeRegistry.mm 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebMIMETypeRegistry.mm 2020-07-03 09:35:48 UTC (rev 263890)
@@ -35,12 +35,12 @@
+ (NSString *)mimeTypeForExtension:(NSString *)extension
{
- return MIMETypeRegistry::getMIMETypeForExtension(extension);
+ return MIMETypeRegistry::mimeTypeForExtension(extension);
}
+ (NSString *)preferredExtensionForMIMEType:(NSString *)mimeType
{
- return MIMETypeRegistry::getPreferredExtensionForMIMEType(mimeType);
+ return MIMETypeRegistry::preferredExtensionForMIMEType(mimeType);
}
+ (BOOL)isSupportedImageMIMEType:(NSString *)mimeType
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (263889 => 263890)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2020-07-03 09:35:48 UTC (rev 263890)
@@ -1,3 +1,13 @@
+2020-07-03 Said Abou-Hallawa <[email protected]>
+
+ Change the names of MIMETypeRegistry methods to comply with webkit naming style
+ https://bugs.webkit.org/show_bug.cgi?id=213912
+
+ Reviewed by Youenn Fablet.
+
+ * WebView.cpp:
+ (WebView::MIMETypeForExtension):
+
2020-07-01 Said Abou-Hallawa <[email protected]>
Allow the File object to be created with a replacement file
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (263889 => 263890)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2020-07-03 09:18:46 UTC (rev 263889)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2020-07-03 09:35:48 UTC (rev 263890)
@@ -5707,7 +5707,7 @@
if (!mimeType)
return E_POINTER;
- *mimeType = BString(MIMETypeRegistry::getMIMETypeForExtension(toString(extension))).release();
+ *mimeType = BString(MIMETypeRegistry::mimeTypeForExtension(toString(extension))).release();
return S_OK;
}