Changeset 230082 in webkit


Ignore:
Timestamp:
Mar 29, 2018 2:49:25 PM (6 years ago)
Author:
dbates@webkit.org
Message:

MIMETypeRegistry should return const HashSets
https://bugs.webkit.org/show_bug.cgi?id=184150

Reviewed by Per Arne Vollan.

Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
LegacyWebKit can modify the set of non-image MIME types.

  • platform/MIMETypeRegistry.cpp:

(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
(WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
(WebCore::MIMETypeRegistry::getPDFMIMETypes):
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):

  • platform/MIMETypeRegistry.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r230081 r230082  
     12018-03-29  Daniel Bates  <dabates@apple.com>
     2
     3        MIMETypeRegistry should return const HashSets
     4        https://bugs.webkit.org/show_bug.cgi?id=184150
     5
     6        Reviewed by Per Arne Vollan.
     7
     8        Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
     9        LegacyWebKit can modify the set of non-image MIME types.
     10
     11        * platform/MIMETypeRegistry.cpp:
     12        (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
     13        (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
     14        (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
     15        (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
     16        (WebCore::MIMETypeRegistry::getPDFMIMETypes):
     17        (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
     18        * platform/MIMETypeRegistry.h:
     19
    1202018-03-29  Brady Eidson  <beidson@apple.com>
    221
  • trunk/Source/WebCore/platform/MIMETypeRegistry.cpp

    r229498 r230082  
    652652}
    653653
    654 HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageMIMETypes()
     654const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageMIMETypes()
    655655{
    656656    if (!supportedImageMIMETypes)
     
    659659}
    660660
    661 HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageResourceMIMETypes()
     661const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageResourceMIMETypes()
    662662{
    663663    if (!supportedImageResourceMIMETypes)
     
    666666}
    667667
    668 HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
     668const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
    669669{
    670670    if (!supportedImageMIMETypesForEncoding)
     
    680680}
    681681
    682 HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedMediaMIMETypes()
     682const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedMediaMIMETypes()
    683683{
    684684    if (!supportedMediaMIMETypes)
     
    688688
    689689
    690 HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getPDFMIMETypes()
     690const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getPDFMIMETypes()
    691691{
    692692    if (!pdfMIMETypes)
     
    695695}
    696696
    697 HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getUnsupportedTextMIMETypes()
     697const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getUnsupportedTextMIMETypes()
    698698{
    699699    if (!unsupportedTextMIMETypes)
  • trunk/Source/WebCore/platform/MIMETypeRegistry.h

    r225472 r230082  
    107107    // FIXME: WebKit coding style says we should not have the word "get" in the names of these functions.
    108108    // FIXME: Would be nice to find a way to avoid exposing these sets, even worse exposing non-const references.
    109     WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypes();
    110     static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageResourceMIMETypes();
    111     static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypesForEncoding();
    112109    WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedNonImageMIMETypes();
    113     WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedMediaMIMETypes();
    114     WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& getPDFMIMETypes();
    115     WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& getUnsupportedTextMIMETypes();
     110
     111    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypes();
     112    const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageResourceMIMETypes();
     113    const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypesForEncoding();
     114    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedMediaMIMETypes();
     115    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getPDFMIMETypes();
     116    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getUnsupportedTextMIMETypes();
    116117
    117118    // FIXME: WebKit coding style says we should not have the word "get" in the name of this function.
Note: See TracChangeset for help on using the changeset viewer.