Title: [129924] trunk/Source
Revision
129924
Author
[email protected]
Date
2012-09-28 11:16:35 -0700 (Fri, 28 Sep 2012)

Log Message

Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
https://bugs.webkit.org/show_bug.cgi?id=97547

Patch by Mikhail Pozdnyakov <[email protected]> on 2012-09-28
Reviewed by Adam Barth.

Source/WebCore:

Added MIMETypeRegistry::canShowMIMEType() function which should to be used
to detect whether a given MIME type can be shown in a page.

No new tests. No new functionality.

* WebCore.exp.in: Added MIMETypeRegistry::canShowMIMEType(). Removed MIMETypeRegistry functions that no longer need to be exported.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::canShowMIMEType):
(WebCore):
* platform/MIMETypeRegistry.h:
(MIMETypeRegistry):

Source/WebKit/blackberry:

Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
inside WebCore::FrameLoaderClientBlackBerry::canShowMIMEType().

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::canShowMIMEType):

Source/WebKit/efl:

Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
inside WebCore::FrameLoaderClientEfl::canShowMIMEType().

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::canShowMIMEType):

Source/WebKit/gtk:

Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
inside WebKit::FrameLoaderClient::canShowMIMEType().

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::canShowMIMEType):

Source/WebKit/qt:

Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
inside WebCore::FrameLoaderClientQt::canShowMIMEType().

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::canShowMIMEType):

Source/WebKit/wince:

Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
inside WebKit::FrameLoaderClientWinCE::canShowMIMEType().

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::canShowMIMEType):

Source/WebKit2:

Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
inside WebKit::WebPageProxy::canShowMIMEType() and WKBundlePageCanShowMIMEType().

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canShowMIMEType):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCanShowMIMEType):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129923 => 129924)


--- trunk/Source/WebCore/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebCore/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,3 +1,22 @@
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Added MIMETypeRegistry::canShowMIMEType() function which should to be used
+        to detect whether a given MIME type can be shown in a page.
+
+        No new tests. No new functionality.
+
+        * WebCore.exp.in: Added MIMETypeRegistry::canShowMIMEType(). Removed MIMETypeRegistry functions that no longer need to be exported.
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::MIMETypeRegistry::canShowMIMEType):
+        (WebCore):
+        * platform/MIMETypeRegistry.h:
+        (MIMETypeRegistry):
+
 2012-09-27  Tony Chang  <[email protected]>
 
         flexbox assert fails with auto-sized item with padding

Modified: trunk/Source/WebCore/WebCore.exp.in (129923 => 129924)


--- trunk/Source/WebCore/WebCore.exp.in	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-09-28 18:16:35 UTC (rev 129924)
@@ -411,10 +411,9 @@
 __ZN7WebCore16LegacyWebArchive6createEPNS_5FrameE
 __ZN7WebCore16LegacyWebArchive6createEPNS_5RangeE
 __ZN7WebCore16LegacyWebArchive6createEv
+__ZN7WebCore16MIMETypeRegistry15canShowMIMETypeERKN3WTF6StringE
 __ZN7WebCore16MIMETypeRegistry23getMIMETypeForExtensionERKN3WTF6StringE
 __ZN7WebCore16MIMETypeRegistry24isSupportedImageMIMETypeERKN3WTF6StringE
-__ZN7WebCore16MIMETypeRegistry24isSupportedMediaMIMETypeERKN3WTF6StringE
-__ZN7WebCore16MIMETypeRegistry25isUnsupportedTextMIMETypeERKN3WTF6StringE
 __ZN7WebCore16MIMETypeRegistry26getSupportedImageMIMETypesEv
 __ZN7WebCore16MIMETypeRegistry27getUnsupportedTextMIMETypesEv
 __ZN7WebCore16MIMETypeRegistry27isSupportedNonImageMIMETypeERKN3WTF6StringE

Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (129923 => 129924)


--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -579,6 +579,17 @@
         || mimeType.startsWith("application/x-java-vm", false);
 }
 
+bool MIMETypeRegistry::canShowMIMEType(const String& mimeType)
+{
+    if (isSupportedImageMIMEType(mimeType) || isSupportedNonImageMIMEType(mimeType) || isSupportedMediaMIMEType(mimeType))
+        return true;
+
+    if (mimeType.startsWith("text/", false))
+        return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType);
+
+    return false;
+}
+
 HashSet<String>& MIMETypeRegistry::getSupportedImageMIMETypes()
 {
     if (!supportedImageMIMETypes)

Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.h (129923 => 129924)


--- trunk/Source/WebCore/platform/MIMETypeRegistry.h	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.h	2012-09-28 18:16:35 UTC (rev 129924)
@@ -78,6 +78,11 @@
     // browser (e.g. a Qt Plugin).
     static bool isApplicationPluginMIMEType(const String& mimeType);
 
+    // Check to see if a mime type is suitable for being shown inside a page.
+    // Returns true if any of isSupportedImageMIMEType(), isSupportedNonImageMIMEType(), isSupportedMediaMIMEType() returns true
+    // or if given mime type begins with "text/" and isUnsupportedTextMIMEType() returns false.
+    static bool canShowMIMEType(const String& mimeType);
+
     static HashSet<String>& getSupportedImageMIMETypes();
     static HashSet<String>& getSupportedImageResourceMIMETypes();
     static HashSet<String>& getSupportedImageMIMETypesForEncoding();

Modified: trunk/Source/WebKit/blackberry/ChangeLog (129923 => 129924)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,3 +1,16 @@
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
+        inside WebCore::FrameLoaderClientBlackBerry::canShowMIMEType().
+
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::canShowMIMEType):
+
 2012-09-28  Rob Buis  <[email protected]>
 
         [BlackBerry] Hard to tap on x to clear a text field

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (129923 => 129924)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -485,8 +485,8 @@
     String mimeType = MIMETypeRegistry::getNormalizedMIMEType(mimeTypeIn);
 
     // FIXME: Seems no other port checks empty MIME type in this function. Should we do that?
-    return MIMETypeRegistry::isSupportedImageMIMEType(mimeType) || MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)
-        || MIMETypeRegistry::isSupportedMediaMIMEType(mimeType) || WebSettings::isSupportedObjectMIMEType(mimeType)
+    return MIMETypeRegistry::canShowMIMEType(mimeType)
+        || WebSettings::isSupportedObjectMIMEType(mimeType)
         || (mimeType == "application/x-shockwave-flash");
 }
 

Modified: trunk/Source/WebKit/efl/ChangeLog (129923 => 129924)


--- trunk/Source/WebKit/efl/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,5 +1,18 @@
 2012-09-28  Mikhail Pozdnyakov  <[email protected]>
 
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
+        inside WebCore::FrameLoaderClientEfl::canShowMIMEType().
+
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::canShowMIMEType):
+
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
         [EFL][DRT] EFL DRT should disable visited links tracking by default
         https://bugs.webkit.org/show_bug.cgi?id=97881
 

Modified: trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp (129923 => 129924)


--- trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -720,9 +720,7 @@
 
 bool FrameLoaderClientEfl::canShowMIMEType(const String& MIMEType) const
 {
-    if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType)
-        || MIMETypeRegistry::isSupportedNonImageMIMEType(MIMEType)
-        || MIMETypeRegistry::isSupportedMediaMIMEType(MIMEType))
+    if (MIMETypeRegistry::canShowMIMEType(MIMEType))
         return true;
 
 #if 0 // PluginDatabase is disabled until we have Plugin system done.

Modified: trunk/Source/WebKit/gtk/ChangeLog (129923 => 129924)


--- trunk/Source/WebKit/gtk/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/gtk/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,3 +1,16 @@
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
+        inside WebKit::FrameLoaderClient::canShowMIMEType().
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::canShowMIMEType):
+
 2012-09-28  Huang Dongsung  <[email protected]>
 
         [GTK] Enable CSS Shaders layout LayoutTests on GTK+

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp (129923 => 129924)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -897,9 +897,7 @@
 
 bool FrameLoaderClient::canShowMIMEType(const String& type) const
 {
-    return (MIMETypeRegistry::isSupportedImageMIMEType(type)
-            || MIMETypeRegistry::isSupportedNonImageMIMEType(type)
-            || MIMETypeRegistry::isSupportedMediaMIMEType(type)
+    return (MIMETypeRegistry::canShowMIMEType(type)
             || PluginDatabase::installedPlugins()->isMIMETypeRegistered(type));
 }
 

Modified: trunk/Source/WebKit/qt/ChangeLog (129923 => 129924)


--- trunk/Source/WebKit/qt/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/qt/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,3 +1,16 @@
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
+        inside WebCore::FrameLoaderClientQt::canShowMIMEType().
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::canShowMIMEType):
+
 2012-09-27  Allan Sandfeld Jensen  <[email protected]>
 
         Unify event handling of middle mouse button.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (129923 => 129924)


--- trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -630,15 +630,9 @@
 {
     String type = MIMEType;
     type.makeLower();
-    if (MIMETypeRegistry::isSupportedImageMIMEType(type))
+    if (MIMETypeRegistry::canShowMIMEType(type))
         return true;
 
-    if (MIMETypeRegistry::isSupportedNonImageMIMEType(type))
-        return true;
-
-    if (MIMETypeRegistry::isSupportedMediaMIMEType(type))
-        return true;
-
     if (m_frame && m_frame->settings()  && m_frame->settings()->arePluginsEnabled()
         && PluginDatabase::installedPlugins()->isMIMETypeRegistered(type))
         return true;

Modified: trunk/Source/WebKit/wince/ChangeLog (129923 => 129924)


--- trunk/Source/WebKit/wince/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/wince/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,3 +1,16 @@
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
+        inside WebKit::FrameLoaderClientWinCE::canShowMIMEType().
+
+        * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+        (WebKit::FrameLoaderClientWinCE::canShowMIMEType):
+
 2012-09-25  Beth Dakin  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=95397

Modified: trunk/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp (129923 => 129924)


--- trunk/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -414,9 +414,7 @@
 
 bool FrameLoaderClientWinCE::canShowMIMEType(const String& type) const
 {
-    return (MIMETypeRegistry::isSupportedImageMIMEType(type)
-            || MIMETypeRegistry::isSupportedNonImageMIMEType(type)
-            || MIMETypeRegistry::isSupportedMediaMIMEType(type)
+    return (MIMETypeRegistry::canShowMIMEType(type)
             || PluginDatabase::installedPlugins()->isMIMETypeRegistered(type));
 }
 

Modified: trunk/Source/WebKit2/ChangeLog (129923 => 129924)


--- trunk/Source/WebKit2/ChangeLog	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-28 18:16:35 UTC (rev 129924)
@@ -1,3 +1,18 @@
+2012-09-28  Mikhail Pozdnyakov  <[email protected]>
+
+        Code inside FrameLoaderClient::canShowMIMEType() implementations can be shared among different WK ports
+        https://bugs.webkit.org/show_bug.cgi?id=97547
+
+        Reviewed by Adam Barth.
+
+        Newly added WebCore::MIMETypeRegistry::canShowMIMEType() function is used
+        inside WebKit::WebPageProxy::canShowMIMEType() and WKBundlePageCanShowMIMEType().
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::canShowMIMEType):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageCanShowMIMEType):
+
 2012-09-28  Byungwoo Lee  <[email protected]>
 
         [EFL][WK2] {Vibration,Battery,NetworkInfo}Provider should contain WKContextRef instead of proxy.

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (129923 => 129924)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -748,18 +748,9 @@
 
 bool WebPageProxy::canShowMIMEType(const String& mimeType) const
 {
-    if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
+    if (MIMETypeRegistry::canShowMIMEType(mimeType))
         return true;
 
-    if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
-        return true;
-
-    if (MIMETypeRegistry::isSupportedMediaMIMEType(mimeType))
-        return true;
-
-    if (mimeType.startsWith("text/", false))
-        return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType);
-
     String newMimeType = mimeType;
     PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
     if (!plugin.path.isNull())

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (129923 => 129924)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2012-09-28 18:08:10 UTC (rev 129923)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2012-09-28 18:16:35 UTC (rev 129924)
@@ -423,21 +423,7 @@
 
 bool WKBundlePageCanShowMIMEType(WKBundlePageRef, WKStringRef mimeTypeRef)
 {
-    using WebCore::MIMETypeRegistry;
-
     const String mimeType = toWTFString(mimeTypeRef);
 
-    if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
-        return true;
-
-    if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
-        return true;
-
-    if (MIMETypeRegistry::isSupportedMediaMIMEType(mimeType))
-        return true;
-
-    if (mimeType.startsWith("text/", false))
-        return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType);
-
-    return false;
+    return WebCore::MIMETypeRegistry::canShowMIMEType(mimeType);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to