Changeset 177482 in webkit


Ignore:
Timestamp:
Dec 17, 2014 5:56:18 PM (9 years ago)
Author:
andersca@apple.com
Message:

Get rid of FrameLoader::defaultObjectContentType
https://bugs.webkit.org/show_bug.cgi?id=139758

Reviewed by Geoffrey Garen.

Source/WebCore:

Move the FrameLoader::defaultObjectContentType implementation to its only caller in WebKit/win.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::defaultObjectContentType): Deleted.

  • loader/FrameLoader.h:

Source/WebKit/win:

  • WebCoreSupport/WebFrameLoaderClient.cpp:

(WebFrameLoaderClient::objectContentType):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r177458 r177482  
     12014-12-17  Anders Carlsson  <andersca@apple.com>
     2
     3        Get rid of FrameLoader::defaultObjectContentType
     4        https://bugs.webkit.org/show_bug.cgi?id=139758
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Move the FrameLoader::defaultObjectContentType implementation to its only caller in WebKit/win.
     9
     10        * loader/FrameLoader.cpp:
     11        (WebCore::FrameLoader::defaultObjectContentType): Deleted.
     12        * loader/FrameLoader.h:
     13
    1142014-12-17  peavo@outlook.com  <peavo@outlook.com>
    215
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r177441 r177482  
    958958#endif // ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
    959959
    960 ObjectContentType FrameLoader::defaultObjectContentType(const URL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages)
    961 {
    962     String mimeType = mimeTypeIn;
    963 
    964     if (mimeType.isEmpty())
    965         mimeType = mimeTypeFromURL(url);
    966 
    967 #if !PLATFORM(COCOA) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does EFL
    968     if (mimeType.isEmpty()) {
    969         String decodedPath = decodeURLEscapeSequences(url.path());
    970         mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(decodedPath.substring(decodedPath.reverseFind('.') + 1));
    971     }
    972 #endif
    973 
    974     if (mimeType.isEmpty())
    975         return ObjectContentFrame; // Go ahead and hope that we can display the content.
    976 
    977 #if !PLATFORM(COCOA) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does EFL
    978     bool plugInSupportsMIMEType = PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType);
    979 #else
    980     bool plugInSupportsMIMEType = false;
    981 #endif
    982 
    983     if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
    984         return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? WebCore::ObjectContentNetscapePlugin : WebCore::ObjectContentImage;
    985 
    986     if (plugInSupportsMIMEType)
    987         return WebCore::ObjectContentNetscapePlugin;
    988 
    989     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
    990         return WebCore::ObjectContentFrame;
    991 
    992     return WebCore::ObjectContentNone;
    993 }
    994 
    995960String FrameLoader::outgoingReferrer() const
    996961{
  • trunk/Source/WebCore/loader/FrameLoader.h

    r176683 r177482  
    268268    bool suppressOpenerInNewFrame() const { return m_suppressOpenerInNewFrame; }
    269269
    270     static ObjectContentType defaultObjectContentType(const URL&, const String& mimeType, bool shouldPreferPlugInsForImages);
    271 
    272270    bool quickRedirectComing() const { return m_quickRedirectComing; }
    273271
  • trunk/Source/WebKit/win/ChangeLog

    r177422 r177482  
     12014-12-17  Anders Carlsson  <andersca@apple.com>
     2
     3        Get rid of FrameLoader::defaultObjectContentType
     4        https://bugs.webkit.org/show_bug.cgi?id=139758
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * WebCoreSupport/WebFrameLoaderClient.cpp:
     9        (WebFrameLoaderClient::objectContentType):
     10
    1112014-12-16  Andreas Kling  <akling@apple.com>
    212
  • trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp

    r176892 r177482  
    7272#include <WebCore/HistoryItem.h>
    7373#include <WebCore/LocalizedStrings.h>
     74#include <WebCore/MIMETypeRegistry.h>
    7475#include <WebCore/Page.h>
     76#include <WebCore/PluginDatabase.h>
    7577#include <WebCore/PluginPackage.h>
    7678#include <WebCore/PluginView.h>
     
    10761078}
    10771079
    1078 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeType, bool shouldPreferPlugInsForImages)
    1079 {
    1080     return WebCore::FrameLoader::defaultObjectContentType(url, mimeType, shouldPreferPlugInsForImages);
     1080ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages)
     1081{
     1082    String mimeType = mimeTypeIn;
     1083
     1084    if (mimeType.isEmpty())
     1085        mimeType = mimeTypeFromURL(url);
     1086
     1087    if (mimeType.isEmpty()) {
     1088        String decodedPath = decodeURLEscapeSequences(url.path());
     1089        mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(decodedPath.substring(decodedPath.reverseFind('.') + 1));
     1090    }
     1091
     1092    if (mimeType.isEmpty())
     1093        return ObjectContentFrame; // Go ahead and hope that we can display the content.
     1094
     1095    bool plugInSupportsMIMEType = PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType);
     1096
     1097    if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
     1098        return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? WebCore::ObjectContentNetscapePlugin : WebCore::ObjectContentImage;
     1099
     1100    if (plugInSupportsMIMEType)
     1101        return WebCore::ObjectContentNetscapePlugin;
     1102
     1103    if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
     1104        return WebCore::ObjectContentFrame;
     1105
     1106    return WebCore::ObjectContentNone;
    10811107}
    10821108
Note: See TracChangeset for help on using the changeset viewer.