Title: [155001] branches/safari-537.60-branch/Source/WebKit/win
Revision
155001
Author
lforsch...@apple.com
Date
2013-09-03 15:08:49 -0700 (Tue, 03 Sep 2013)

Log Message

Merged r154759.  <rdar://problem/14879679>

Modified Paths

Diff

Modified: branches/safari-537.60-branch/Source/WebKit/win/ChangeLog (155000 => 155001)


--- branches/safari-537.60-branch/Source/WebKit/win/ChangeLog	2013-09-03 21:47:45 UTC (rev 155000)
+++ branches/safari-537.60-branch/Source/WebKit/win/ChangeLog	2013-09-03 22:08:49 UTC (rev 155001)
@@ -1,3 +1,24 @@
+2013-09-03  Lucas Forschler  <lforsch...@apple.com>
+
+        Merge r154759
+
+    2013-08-27  Brent Fulgham  <bfulg...@apple.com>
+
+            [Windows] Loader is not properly determining supported MIME types
+            https://bugs.webkit.org/show_bug.cgi?id=120383
+
+            Reviewed by Eric Carlson.
+
+            * WebCoreSupport/WebFrameLoaderClient.cpp:
+            (WebFrameLoaderClient::canShowMIMEType): Modify to ask WebView if it can
+            display the media type. Use new helper function to avoid converting a String
+            to BSTR, only to immediatly be converted from BSTR back to String.
+            (WebFrameLoaderClient::canShowMIMETypeAsHTML): Ditto.
+            * WebView.cpp:
+            (WebView::canShowMIMEType): Move logic to a new (similarly named) helper function.
+            (WebView::canShowMIMETypeAsHTML): Ditto.
+            * WebView.h: Add declaration for two new helper functions.
+
 2013-08-29  Roger Fong  <roger_f...@apple.com>
 
         Unreviewed. Windows build fix.

Modified: branches/safari-537.60-branch/Source/WebKit/win/WebView.cpp (155000 => 155001)


--- branches/safari-537.60-branch/Source/WebKit/win/WebView.cpp	2013-09-03 21:47:45 UTC (rev 155000)
+++ branches/safari-537.60-branch/Source/WebKit/win/WebView.cpp	2013-09-03 22:08:49 UTC (rev 155001)
@@ -110,6 +110,7 @@
 #include <WebCore/KeyboardEvent.h>
 #include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/MemoryCache.h>
+#include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageCache.h>
 #include <WebCore/PageGroup.h>
@@ -2532,39 +2533,51 @@
 
 // IWebView --------------------------------------------------------------------
 
-HRESULT STDMETHODCALLTYPE WebView::canShowMIMEType( 
-    /* [in] */ BSTR mimeType,
-    /* [retval][out] */ BOOL* canShow)
+HRESULT WebView::canShowMIMEType(/* [in] */ BSTR mimeType, /* [retval][out] */ BOOL* canShow)
 {
-    String mimeTypeStr = toString(mimeType);
-
     if (!canShow)
         return E_POINTER;
 
+    *canShow = canShowMIMEType(toString(mimeType));
+
+    return S_OK;
+}
+
+bool WebView::canShowMIMEType(const String& mimeType)
+{
     Frame* coreFrame = core(m_mainFrame);
     bool allowPlugins = coreFrame && coreFrame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin);
 
-    *canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeTypeStr)
-        || MIMETypeRegistry::isSupportedNonImageMIMEType(mimeTypeStr);
+    bool canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeType)
+        || MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)
+        || MIMETypeRegistry::isSupportedMediaMIMEType(mimeType);
 
-    if (!*canShow && m_page && m_page->pluginData()) {
-        *canShow = (m_page->pluginData()->supportsMimeType(mimeTypeStr, PluginData::AllPlugins) && allowPlugins)
-            || m_page->pluginData()->supportsMimeType(mimeTypeStr, PluginData::OnlyApplicationPlugins);
+    if (!canShow && m_page && m_page->pluginData())) {
+        canShow = (m_page->pluginData()->supportsMimeType(mimeType, PluginData::AllPlugins) && allowPlugins)
+            || m_page->pluginData()->supportsMimeType(mimeType, PluginData::OnlyApplicationPlugins);
     }
 
-    if (!*canShow)
-        *canShow = shouldUseEmbeddedView(mimeTypeStr);
+    if (!canShow)
+        canShow = shouldUseEmbeddedView(mimeType);
 
+    return canShow;
+}
+
+HRESULT WebView::canShowMIMETypeAsHTML(/* [in] */ BSTR mimeType, /* [retval][out] */ BOOL* canShow)
+{
+    if (!canShow)
+        return E_POINTER;
+
+    *canShow = canShowMIMETypeAsHTML(toString(mimeType));
+
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebView::canShowMIMETypeAsHTML( 
-    /* [in] */ BSTR /*mimeType*/,
-    /* [retval][out] */ BOOL* canShow)
+bool WebView::canShowMIMETypeAsHTML(const String& /*mimeType*/)
 {
     // FIXME
-    *canShow = TRUE;
-    return S_OK;
+    notImplemented();
+    return true;
 }
 
 HRESULT STDMETHODCALLTYPE WebView::MIMETypesShownAsHTML( 

Modified: branches/safari-537.60-branch/Source/WebKit/win/WebView.h (155000 => 155001)


--- branches/safari-537.60-branch/Source/WebKit/win/WebView.h	2013-09-03 21:47:45 UTC (rev 155000)
+++ branches/safari-537.60-branch/Source/WebKit/win/WebView.h	2013-09-03 22:08:49 UTC (rev 155001)
@@ -975,6 +975,9 @@
     WebCore::Element* fullScreenElement() const { return m_fullScreenElement.get(); }
 #endif
 
+    bool canShowMIMEType(const String& mimeType);
+    bool canShowMIMETypeAsHTML(const String& mimeType);
+
     // Used by TextInputController in DumpRenderTree
 
     HRESULT STDMETHODCALLTYPE setCompositionForTesting(
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to