Title: [117138] branches/safari-536-branch

Diff

Modified: branches/safari-536-branch/Source/WebCore/ChangeLog (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/ChangeLog	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/ChangeLog	2012-05-15 20:18:10 UTC (rev 117138)
@@ -1,5 +1,34 @@
 2012-05-15  Lucas Forschler  <[email protected]>
 
+    Merge 116695
+
+    2012-05-10  Anders Carlsson  <[email protected]>
+
+            WebKit1: Add a way to blacklist specific plug-ins/plug-in versions
+            https://bugs.webkit.org/show_bug.cgi?id=86150
+            <rdar://problem/9551196>
+
+            Reviewed by Sam Weinig.
+
+            * English.lproj/Localizable.strings:
+            Update.
+
+            * loader/SubframeLoader.cpp:
+            (WebCore::SubframeLoader::loadPlugin):
+            It is possible that the client has already set the unavailability reason so don't try to set it twice.
+
+            * platform/LocalizedStrings.cpp:
+            (WebCore::insecurePluginVersionText):
+            * platform/LocalizedStrings.h:
+            Add insecure plug-in version text.
+
+            * rendering/RenderEmbeddedObject.cpp:
+            (WebCore::RenderEmbeddedObject::unavailablePluginReplacementText):
+            * rendering/RenderEmbeddedObject.h:
+            Add InsecurePluginVersion unavailability reason.
+
+2012-05-15  Lucas Forschler  <[email protected]>
+
     Merge 116687
 
     2012-05-10  Anders Carlsson  <[email protected]>

Modified: branches/safari-536-branch/Source/WebCore/English.lproj/Localizable.strings (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/English.lproj/Localizable.strings	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/English.lproj/Localizable.strings	2012-05-15 20:18:10 UTC (rev 117138)
@@ -172,6 +172,9 @@
 /* Undo action name */
 "Indent (Undo action name)" = "Indent";
 
+/* Label text to be used when an insecure plug-in version was blocked from loading */
+"Insecure Plug-In Version" = "Insecure Plug-In Version";
+
 /* Undo action name */
 "Insert List (Undo action name)" = "Insert List";
 

Modified: branches/safari-536-branch/Source/WebCore/loader/SubframeLoader.cpp (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/loader/SubframeLoader.cpp	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/loader/SubframeLoader.cpp	2012-05-15 20:18:10 UTC (rev 117138)
@@ -376,7 +376,8 @@
         pluginElement, url, paramNames, paramValues, mimeType, loadManually);
 
     if (!widget) {
-        renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
+        if (!renderer->showsUnavailablePluginIndicator())
+            renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
         return false;
     }
 

Modified: branches/safari-536-branch/Source/WebCore/platform/LocalizedStrings.cpp (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/platform/LocalizedStrings.cpp	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/platform/LocalizedStrings.cpp	2012-05-15 20:18:10 UTC (rev 117138)
@@ -673,6 +673,11 @@
     return WEB_UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
 }
 
+String insecurePluginVersionText()
+{
+    return WEB_UI_STRING("Insecure Plug-In Version", "Label text to be used when an insecure plug-in version was blocked from loading");
+}
+
 String multipleFileUploadText(unsigned numberOfFiles)
 {
     return formatLocalizedString(WEB_UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles);

Modified: branches/safari-536-branch/Source/WebCore/platform/LocalizedStrings.h (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/platform/LocalizedStrings.h	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/platform/LocalizedStrings.h	2012-05-15 20:18:10 UTC (rev 117138)
@@ -167,6 +167,7 @@
 
     String missingPluginText();
     String crashedPluginText();
+    String insecurePluginVersionText();
     String multipleFileUploadText(unsigned numberOfFiles);
     String unknownFileSizeText();
 

Modified: branches/safari-536-branch/Source/WebCore/rendering/RenderEmbeddedObject.cpp (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2012-05-15 20:18:10 UTC (rev 117138)
@@ -214,6 +214,8 @@
         return missingPluginText();
     case PluginCrashed:
         return crashedPluginText();
+    case InsecurePluginVersion:
+        return insecurePluginVersionText();
     }
 
     ASSERT_NOT_REACHED();

Modified: branches/safari-536-branch/Source/WebCore/rendering/RenderEmbeddedObject.h (117137 => 117138)


--- branches/safari-536-branch/Source/WebCore/rendering/RenderEmbeddedObject.h	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebCore/rendering/RenderEmbeddedObject.h	2012-05-15 20:18:10 UTC (rev 117138)
@@ -39,6 +39,7 @@
     enum PluginUnavailabilityReason {
         PluginMissing,
         PluginCrashed,
+        InsecurePluginVersion
     };
     void setPluginUnavailabilityReason(PluginUnavailabilityReason);
     bool showsUnavailablePluginIndicator() const;

Modified: branches/safari-536-branch/Source/WebKit/mac/ChangeLog (117137 => 117138)


--- branches/safari-536-branch/Source/WebKit/mac/ChangeLog	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebKit/mac/ChangeLog	2012-05-15 20:18:10 UTC (rev 117138)
@@ -1,5 +1,30 @@
 2012-05-15  Lucas Forschler  <[email protected]>
 
+    Merge 116695
+
+    2012-05-10  Anders Carlsson  <[email protected]>
+
+            WebKit1: Add a way to blacklist specific plug-ins/plug-in versions
+            https://bugs.webkit.org/show_bug.cgi?id=86150
+            <rdar://problem/9551196>
+
+            Reviewed by Sam Weinig.
+
+            * Misc/WebKitErrors.h:
+            Add WebKitErrorInsecurePlugInVersion enum.
+
+            * Plugins/WebBasePluginPackage.h:
+            * Plugins/WebBasePluginPackage.mm:
+            (-[WebBasePluginPackage bundleIdentifier]):
+            (-[WebBasePluginPackage bundleVersion]):
+            Add bundleIdentifier and bundleVersion getters.
+
+            * WebCoreSupport/WebFrameLoaderClient.mm:
+            (WebFrameLoaderClient::createPlugin):
+            Check if the plug-in is blocked. If it is, set the unavailability reason and the error code.
+
+2012-05-15  Lucas Forschler  <[email protected]>
+
     Merge 116687
 
     2012-05-10  Anders Carlsson  <[email protected]>

Modified: branches/safari-536-branch/Source/WebKit/mac/Misc/WebKitErrors.h (117137 => 117138)


--- branches/safari-536-branch/Source/WebKit/mac/Misc/WebKitErrors.h	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebKit/mac/Misc/WebKitErrors.h	2012-05-15 20:18:10 UTC (rev 117138)
@@ -56,4 +56,5 @@
     WebKitErrorCannotFindPlugIn =                               200,
     WebKitErrorCannotLoadPlugIn =                               201,
     WebKitErrorJavaUnavailable =                                202,
+    WebKitErrorInsecurePlugInVersion =                          203,
 };

Modified: branches/safari-536-branch/Source/WebKit/mac/Plugins/WebBasePluginPackage.h (117137 => 117138)


--- branches/safari-536-branch/Source/WebKit/mac/Plugins/WebBasePluginPackage.h	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebKit/mac/Plugins/WebBasePluginPackage.h	2012-05-15 20:18:10 UTC (rev 117138)
@@ -77,7 +77,8 @@
 
 - (const WebCore::PluginInfo&)pluginInfo;
 
-- (WTF::String)bundleIdentifier;
+- (String)bundleIdentifier;
+- (String)bundleVersion;
 
 - (BOOL)supportsExtension:(const WTF::String&)extension;
 - (BOOL)supportsMIMEType:(const WTF::String&)MIMEType;

Modified: branches/safari-536-branch/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm (117137 => 117138)


--- branches/safari-536-branch/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm	2012-05-15 20:18:10 UTC (rev 117138)
@@ -463,11 +463,24 @@
     [pluginDatabases removeObject:database];
 }
 
-- (WTF::String)bundleIdentifier
+- (String)bundleIdentifier
 {
     return CFBundleGetIdentifier(cfBundle.get());
 }
 
+- (String)bundleVersion
+{
+    CFDictionaryRef infoDictionary = CFBundleGetInfoDictionary(cfBundle.get());
+    if (!infoDictionary)
+        return String();
+
+    CFTypeRef bundleVersionString = CFDictionaryGetValue(infoDictionary, kCFBundleVersionKey);
+    if (!bundleVersionString || CFGetTypeID(bundleVersionString) != CFStringGetTypeID())
+        return String();
+
+    return reinterpret_cast<CFStringRef>(bundleVersionString);
+}
+
 @end
 
 @implementation NSArray (WebPluginExtensions)

Modified: branches/safari-536-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (117137 => 117138)


--- branches/safari-536-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2012-05-15 20:18:10 UTC (rev 117138)
@@ -1665,25 +1665,31 @@
     NSView *view = nil;
 
     if (pluginPackage) {
-        if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
-            view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, attributeKeys, kit(paramValues), baseURL, kit(element), loadManually);
-            
+        if (!WKShouldBlockPlugin([pluginPackage bundleIdentifier], [pluginPackage bundleVersion])) {
+            if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
+                view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, attributeKeys, kit(paramValues), baseURL, kit(element), loadManually);
+
 #if ENABLE(NETSCAPE_PLUGIN_API)
-        else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
-            WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
-                initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
-                pluginPackage:(WebNetscapePluginPackage *)pluginPackage
-                URL:pluginURL
-                baseURL:baseURL
-                MIMEType:MIMEType
-                attributeKeys:attributeKeys
-                attributeValues:kit(paramValues)
-                loadManually:loadManually
-                element:element] autorelease];
-            
-            return adoptRef(new NetscapePluginWidget(pluginView));
-        } 
+            else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
+                WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
+                    initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+                    pluginPackage:(WebNetscapePluginPackage *)pluginPackage
+                    URL:pluginURL
+                    baseURL:baseURL
+                    MIMEType:MIMEType
+                    attributeKeys:attributeKeys
+                    attributeValues:kit(paramValues)
+                    loadManually:loadManually
+                    element:element] autorelease];
+
+                return adoptRef(new NetscapePluginWidget(pluginView));
+            }
 #endif
+        } else {
+            errorCode = WebKitErrorInsecurePlugInVersion;
+            if (element->renderer()->isEmbeddedObject())
+                toRenderEmbeddedObject(element->renderer())->setPluginUnavailabilityReason(RenderEmbeddedObject::InsecurePluginVersion);
+        }
     } else
         errorCode = WebKitErrorCannotFindPlugIn;
 

Modified: branches/safari-536-branch/WebKitLibraries/ChangeLog (117137 => 117138)


--- branches/safari-536-branch/WebKitLibraries/ChangeLog	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/WebKitLibraries/ChangeLog	2012-05-15 20:18:10 UTC (rev 117138)
@@ -1,5 +1,23 @@
 2012-05-15  Lucas Forschler  <[email protected]>
 
+    Merge 116695
+
+    2012-05-10  Anders Carlsson  <[email protected]>
+
+            WebKit1: Add a way to blacklist specific plug-ins/plug-in versions
+            https://bugs.webkit.org/show_bug.cgi?id=86150
+            <rdar://problem/9551196>
+
+            Reviewed by Sam Weinig.
+
+            Add WKShouldBlockPlugin.
+
+            * WebKitSystemInterface.h:
+            * libWebKitSystemInterfaceLion.a:
+            * libWebKitSystemInterfaceSnowLeopard.a:
+
+2012-05-15  Lucas Forschler  <[email protected]>
+
     Merge 116473
 
     2012-05-08  Jon Lee  <[email protected]>

Modified: branches/safari-536-branch/WebKitLibraries/WebKitSystemInterface.h (117137 => 117138)


--- branches/safari-536-branch/WebKitLibraries/WebKitSystemInterface.h	2012-05-15 20:15:45 UTC (rev 117137)
+++ branches/safari-536-branch/WebKitLibraries/WebKitSystemInterface.h	2012-05-15 20:18:10 UTC (rev 117138)
@@ -92,6 +92,7 @@
 AXUIElementRef WKCreateAXUIElementRef(id element);
 void WKUnregisterUniqueIdForElement(id element);
 
+BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
 
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
 // Remote Accessibility API.

Modified: branches/safari-536-branch/WebKitLibraries/libWebKitSystemInterfaceLion.a


(Binary files differ)

Modified: branches/safari-536-branch/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a


(Binary files differ)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to