[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 15:55:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 001d869f37bbf1087a951e1e190f0741217a9d50
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 16 20:49:36 2010 +0000

    Add WKPageCanShowMIMEType
    https://bugs.webkit.org/show_bug.cgi?id=49612
    
    Reviewed by Sam Weinig.
    
    * UIProcess/API/C/WKPage.cpp:
    (WKPageCanShowMIMEType):
    * UIProcess/API/C/WKPage.h:
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::canShowMIMEType):
    * UIProcess/WebPageProxy.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index e09c43c..7f3e96d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,20 @@
 
         Reviewed by Sam Weinig.
 
+        Add WKPageCanShowMIMEType
+        https://bugs.webkit.org/show_bug.cgi?id=49612
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageCanShowMIMEType):
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::canShowMIMEType):
+        * UIProcess/WebPageProxy.h:
+
+2010-11-16  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
         Make WebPageProxy::decidePolicyForMIMEType a tad synchronous
         https://bugs.webkit.org/show_bug.cgi?id=49605
 
diff --git a/WebKit2/UIProcess/API/C/WKPage.cpp b/WebKit2/UIProcess/API/C/WKPage.cpp
index b516efe..bbd60da 100644
--- a/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -132,6 +132,11 @@ WKBackForwardListRef WKPageGetBackForwardList(WKPageRef pageRef)
     return toAPI(toImpl(pageRef)->backForwardList());
 }
 
+bool WKPageCanShowMIMEType(WKPageRef pageRef, WKStringRef mimeTypeRef)
+{
+    return toImpl(pageRef)->canShowMIMEType(toWTFString(mimeTypeRef));
+}
+
 WKStringRef WKPageCopyTitle(WKPageRef pageRef)
 {
     return toCopiedAPI(toImpl(pageRef)->pageTitle());
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index 2706618..2edf3ec 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -238,6 +238,8 @@ WK_EXPORT bool WKPageCanGoBack(WKPageRef page);
 WK_EXPORT void WKPageGoToBackForwardListItem(WKPageRef page, WKBackForwardListItemRef item);
 WK_EXPORT WKBackForwardListRef WKPageGetBackForwardList(WKPageRef page);
 
+WK_EXPORT bool WKPageCanShowMIMEType(WKPageRef page, WKStringRef mimeType);
+
 WK_EXPORT WKStringRef WKPageCopyTitle(WKPageRef page);
 
 WK_EXPORT WKFrameRef WKPageGetMainFrame(WKPageRef page);
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 537ff89..ebaab0e 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -55,6 +55,7 @@
 #include "WebProcessProxy.h"
 #include "WebURLRequest.h"
 #include <WebCore/FloatRect.h>
+#include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/WindowFeatures.h>
 #include <stdio.h>
 
@@ -356,6 +357,23 @@ void WebPageProxy::didChangeBackForwardList()
     m_loaderClient.didChangeBackForwardList(this);
 }
 
+    
+bool WebPageProxy::canShowMIMEType(const String& mimeType) const
+{
+    if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
+        return true;
+
+    if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
+        return true;
+    
+    String newMimeType = mimeType;
+    PluginInfoStore::Plugin plugin = pageNamespace()->context()->pluginInfoStore()->findPlugin(newMimeType, KURL());
+    if (!plugin.path.isNull())
+        return true;
+
+    return false;
+}
+
 void WebPageProxy::setFocused(bool isFocused)
 {
     if (!isValid())
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 5b7dfd6..b14dd4a 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -152,6 +152,8 @@ public:
     void goToBackForwardItem(WebBackForwardListItem*);
     void didChangeBackForwardList();
 
+    bool canShowMIMEType(const String& mimeType) const;
+
     void setFocused(bool isFocused);
     void setActive(bool active);
     void setIsInWindow(bool isInWindow);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list