Changeset 204462 in webkit
- Timestamp:
- Aug 15, 2016, 9:43:13 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 added
- 9 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r204459 r204462 1 2016-08-12 Anders Carlsson <andersca@apple.com> 2 3 Move the plug-in and WebGL blacklist code to WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=160831 5 6 Reviewed by Sam Weinig. 7 8 * WebCore.xcodeproj/project.pbxproj: 9 * platform/mac/BlacklistUpdater.h: Added. 10 (WebCore::BlacklistUpdater::queue): 11 (WebCore::BlacklistUpdater::pluginBlacklist): 12 (WebCore::BlacklistUpdater::webGLBlacklist): 13 * platform/mac/BlacklistUpdater.mm: Added. 14 (WebCore::BlacklistUpdater::readBlacklistData): 15 (WebCore::BlacklistUpdater::reloadIfNecessary): 16 (WebCore::BlacklistUpdater::initializeQueue): 17 * platform/mac/PluginBlacklist.h: Added. 18 * platform/mac/PluginBlacklist.mm: Added. 19 (WebCore::PluginBlacklist::loadPolicyForPluginVersion): 20 (WebCore::PluginBlacklist::isPluginUpdateAvailable): 21 (WebCore::PluginBlacklist::create): 22 (WebCore::PluginBlacklist::~PluginBlacklist): 23 (WebCore::PluginBlacklist::splitOSVersion): 24 (WebCore::PluginBlacklist::loadPolicyForPlugin): 25 (WebCore::PluginBlacklist::isUpdateAvailable): 26 (WebCore::PluginBlacklist::PluginBlacklist): 27 * platform/mac/WebGLBlacklist.h: Added. 28 * platform/mac/WebGLBlacklist.mm: Added. 29 (WebCore::OSBuildInfo::OSBuildInfo): 30 (WebCore::OSBuildInfo::operator==): 31 (WebCore::OSBuildInfo::operator>): 32 (WebCore::OSBuildInfo::operator<=): 33 (WebCore::OSBuildInfo::operator<): 34 (WebCore::buildInfoFromOSBuildString): 35 (WebCore::WebGLBlacklist::shouldBlockWebGL): 36 (WebCore::WebGLBlacklist::shouldSuggestBlockingWebGL): 37 (WebCore::matchesGPU): 38 (WebCore::gpuMaskFromString): 39 (WebCore::matchesBuildInfo): 40 (WebCore::WebGLBlacklist::create): 41 (WebCore::WebGLBlacklist::shouldBlock): 42 (WebCore::WebGLBlacklist::shouldSuggestBlocking): 43 (WebCore::WebGLBlacklist::WebGLBlacklist): 44 (WebCore::WebGLBlacklist::~WebGLBlacklist): 45 * platform/spi/cf/CFUtilitiesSPI.h: Added. 46 1 47 2016-08-14 Chris Dumez <cdumez@apple.com> 2 48 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r204459 r204462 1021 1021 1AFE11990CBFFCC4003017FA /* JSSQLResultSetRowList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFE11970CBFFCC4003017FA /* JSSQLResultSetRowList.cpp */; }; 1022 1022 1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; }; 1023 1AFFC4531D5E81C400267A66 /* WebGLBlacklist.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFFC4521D5E7EC700267A66 /* WebGLBlacklist.mm */; }; 1024 1AFFC4541D5E81CB00267A66 /* BlacklistUpdater.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFFC44E1D5E7EC700267A66 /* BlacklistUpdater.mm */; }; 1025 1AFFC4551D5E81D000267A66 /* PluginBlacklist.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFFC4501D5E7EC700267A66 /* PluginBlacklist.mm */; }; 1026 1AFFC4571D5E83A700267A66 /* CFUtilitiesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFFC4561D5E83A700267A66 /* CFUtilitiesSPI.h */; }; 1027 1AFFC4581D5E865500267A66 /* WebGLBlacklist.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFFC4511D5E7EC700267A66 /* WebGLBlacklist.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1028 1AFFC4591D5E866100267A66 /* PluginBlacklist.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFFC44F1D5E7EC700267A66 /* PluginBlacklist.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1023 1029 1B124D8D1D380B7000ECDFB0 /* MediaSampleAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */; }; 1024 1030 1B124D8F1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */; }; … … 8248 8254 1AFE11970CBFFCC4003017FA /* JSSQLResultSetRowList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLResultSetRowList.cpp; sourceTree = "<group>"; }; 8249 8255 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; }; 8256 1AFFC44D1D5E7EC700267A66 /* BlacklistUpdater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlacklistUpdater.h; sourceTree = "<group>"; }; 8257 1AFFC44E1D5E7EC700267A66 /* BlacklistUpdater.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlacklistUpdater.mm; sourceTree = "<group>"; }; 8258 1AFFC44F1D5E7EC700267A66 /* PluginBlacklist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginBlacklist.h; sourceTree = "<group>"; }; 8259 1AFFC4501D5E7EC700267A66 /* PluginBlacklist.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginBlacklist.mm; sourceTree = "<group>"; }; 8260 1AFFC4511D5E7EC700267A66 /* WebGLBlacklist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLBlacklist.h; sourceTree = "<group>"; }; 8261 1AFFC4521D5E7EC700267A66 /* WebGLBlacklist.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLBlacklist.mm; sourceTree = "<group>"; }; 8262 1AFFC4561D5E83A700267A66 /* CFUtilitiesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFUtilitiesSPI.h; sourceTree = "<group>"; }; 8250 8263 1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaSampleAVFObjC.h; path = ../MediaSampleAVFObjC.h; sourceTree = "<group>"; }; 8251 8264 1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSampleAVFObjC.mm; sourceTree = "<group>"; }; … … 17715 17728 A10D7FEB1C2676D100C6C115 /* CFNetworkConnectionCacheSPI.h */, 17716 17729 CE12525A1A1C018200864480 /* CFNetworkSPI.h */, 17730 1AFFC4561D5E83A700267A66 /* CFUtilitiesSPI.h */, 17717 17731 4449A4041A964B0000B64AD5 /* CoreMediaSPI.h */, 17718 17732 ); … … 18001 18015 isa = PBXGroup; 18002 18016 children = ( 18017 1AFFC44D1D5E7EC700267A66 /* BlacklistUpdater.h */, 18018 1AFFC44E1D5E7EC700267A66 /* BlacklistUpdater.mm */, 18003 18019 F58784F002DE375901EA4122 /* CursorMac.mm */, 18004 18020 A795463D0B5C4C80007B438F /* DragDataMac.mm */, … … 18026 18042 BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */, 18027 18043 29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */, 18044 1AFFC44F1D5E7EC700267A66 /* PluginBlacklist.h */, 18045 1AFFC4501D5E7EC700267A66 /* PluginBlacklist.mm */, 18028 18046 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */, 18029 18047 46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */, … … 18065 18083 BE855F7F0701E83500239769 /* WebCoreView.h */, 18066 18084 BE8560510701F91100239769 /* WebCoreView.m */, 18085 1AFFC4511D5E7EC700267A66 /* WebGLBlacklist.h */, 18086 1AFFC4521D5E7EC700267A66 /* WebGLBlacklist.mm */, 18067 18087 E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */, 18068 18088 E1A3162C134BC32D007C9A4F /* WebNSAttributedStringExtras.mm */, … … 22531 22551 isa = PBXGroup; 22532 22552 children = ( 22533 5C6E653F1D5CEDC900F7862E /* URLParser.cpp */,22534 5C6E65401D5CEDC900F7862E /* URLParser.h */,22535 22553 49E912A40EFAC8E6009D0CAF /* animation */, 22536 22554 FD31604012B026A300C1A359 /* audio */, … … 22706 22724 6593923609AE4346002C531F /* URL.h */, 22707 22725 BCBD21AA0E417AD400A070F2 /* URLHash.h */, 22726 5C6E653F1D5CEDC900F7862E /* URLParser.cpp */, 22727 5C6E65401D5CEDC900F7862E /* URLParser.h */, 22708 22728 868160D1187669C40021E79D /* UserActivity.cpp */, 22709 22729 868160D2187669C40021E79D /* UserActivity.h */, … … 24860 24880 F45C231E1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h in Headers */, 24861 24881 29A812380FBB9C1D00510293 /* AXObjectCache.h in Headers */, 24882 1AFFC4591D5E866100267A66 /* PluginBlacklist.h in Headers */, 24862 24883 91C9F2F91AE3BEB00095B61C /* AXTextStateChangeIntent.h in Headers */, 24863 24884 51741D0F0B07259A00ED442C /* BackForwardClient.h in Headers */, … … 25310 25331 973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */, 25311 25332 BC1A37AD097C715F0019F3D8 /* DOM.h in Headers */, 25333 1AFFC4571D5E83A700267A66 /* CFUtilitiesSPI.h in Headers */, 25312 25334 8538F0190AD718D8006A81D1 /* DOMAbstractView.h in Headers */, 25313 25335 BC99812E0DBE807A008CE9EF /* DOMAbstractViewFrame.h in Headers */, … … 27478 27500 0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */, 27479 27501 0FC4E411187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h in Headers */, 27502 1AFFC4581D5E865500267A66 /* WebGLBlacklist.h in Headers */, 27480 27503 93C4A4151629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h in Headers */, 27481 27504 0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */, … … 29609 29632 D66817FA166FE6D700FA07B4 /* HTMLTemplateElement.cpp in Sources */, 29610 29633 A81369D7097374F600D74463 /* HTMLTextAreaElement.cpp in Sources */, 29634 1AFFC4551D5E81D000267A66 /* PluginBlacklist.mm in Sources */, 29611 29635 9BC6C21C13CCC97B008E0337 /* HTMLTextFormControlElement.cpp in Sources */, 29612 29636 830519951BB0F11000F3772E /* HTMLTimeElement.cpp in Sources */, … … 30718 30742 4FFC022B1643B710004E1638 /* NodeRareData.cpp in Sources */, 30719 30743 E43105B816750F0C00DB2FB8 /* NodeTraversal.cpp in Sources */, 30744 1AFFC4531D5E81C400267A66 /* WebGLBlacklist.mm in Sources */, 30720 30745 33503CC71017A1B1003B47E1 /* Notification.cpp in Sources */, 30721 30746 3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */, … … 31408 31433 B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */, 31409 31434 B2227A4A0D00BF220071B782 /* SVGMetadataElement.cpp in Sources */, 31435 1AFFC4541D5E81CB00267A66 /* BlacklistUpdater.mm in Sources */, 31410 31436 B2A1F2B00CEF0ABF00442F6A /* SVGMissingGlyphElement.cpp in Sources */, 31411 31437 B2227A4D0D00BF220071B782 /* SVGMPathElement.cpp in Sources */, -
trunk/Source/WebCore/platform/mac/BlacklistUpdater.h
r204461 r204462 1 1 /* 2 * Copyright (C) 201 1Apple Inc. All rights reserved.2 * Copyright (C) 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef PluginModuleInfo_h 27 #define PluginModuleInfo_h 26 #pragma once 28 27 29 #i nclude <WebCore/PluginData.h>28 #if PLATFORM(MAC) 30 29 31 #if PLATFORM(COCOA) 32 #include <mach/machine.h> 33 #endif 30 #import <dispatch/dispatch.h> 34 31 35 namespace Web Kit{32 namespace WebCore { 36 33 37 enum PluginModuleLoadPolicy { 38 // The plug-in module should be loaded normally. 39 PluginModuleLoadNormally, 34 class PluginBlacklist; 35 class WebGLBlacklist; 40 36 41 // The plug-in module should be loaded normally. If the plug-in has a sandbox, it will be disabled. 42 PluginModuleLoadUnsandboxed, 37 class BlacklistUpdater { 38 public: 39 static void initializeQueue(); 40 static void reloadIfNecessary(); 43 41 44 // The plug-in should be blocked from being instantiated. 45 // Note that the plug-in will still be seen by e.g. navigator.plugins 46 PluginModuleBlockedForSecurity, 47 PluginModuleBlockedForCompatibility, 42 static dispatch_queue_t queue() { return s_queue; } 43 static PluginBlacklist* pluginBlacklist() { return s_pluginBlacklist; } 44 static WebGLBlacklist* webGLBlacklist() { return s_webGLBlacklist; }; 45 46 private: 47 48 static NSDictionary *readBlacklistData(); 49 50 static dispatch_queue_t s_queue; 51 static PluginBlacklist* s_pluginBlacklist; 52 static WebGLBlacklist* s_webGLBlacklist; 48 53 }; 49 54 50 struct PluginModuleInfo { 51 String path; 52 WebCore::PluginInfo info; 55 } 53 56 54 #if PLATFORM(COCOA)55 cpu_type_t pluginArchitecture;56 String bundleIdentifier;57 String versionString;58 String shortVersionString;59 bool hasSandboxProfile;60 #elif PLATFORM(GTK)61 bool requiresGtk2;62 57 #endif 63 };64 65 } // namespace WebKit66 67 #endif // PluginModuleInfo_h -
trunk/Source/WebCore/platform/mac/WebGLBlacklist.h
r204461 r204462 1 1 /* 2 * Copyright (C) 201 1Apple Inc. All rights reserved.2 * Copyright (C) 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef PluginModuleInfo_h 27 #define PluginModuleInfo_h 26 #pragma once 28 27 29 #i nclude <WebCore/PluginData.h>28 #if PLATFORM(MAC) 30 29 31 #i f PLATFORM(COCOA)32 #include < mach/machine.h>33 # endif30 #include <memory> 31 #include <string> 32 #include <vector> 34 33 35 namespace WebKit { 34 OBJC_CLASS NSDictionary; 36 35 37 enum PluginModuleLoadPolicy { 38 // The plug-in module should be loaded normally. 39 PluginModuleLoadNormally, 36 namespace WebCore { 40 37 41 // The plug-in module should be loaded normally. If the plug-in has a sandbox, it will be disabled. 42 PluginModuleLoadUnsandboxed, 38 class WebGLBlacklist { 39 public: 40 enum BlockComparison { 41 Equals, 42 LessThan, 43 LessThanEquals 44 }; 43 45 44 // The plug-in should be blocked from being instantiated. 45 // Note that the plug-in will still be seen by e.g. navigator.plugins 46 PluginModuleBlockedForSecurity, 47 PluginModuleBlockedForCompatibility, 46 WEBCORE_EXPORT static bool shouldBlockWebGL(); 47 WEBCORE_EXPORT static bool shouldSuggestBlockingWebGL(); 48 49 static std::unique_ptr<WebGLBlacklist> create(NSDictionary *propertyList); 50 ~WebGLBlacklist(); 51 52 bool shouldBlock() const; 53 bool shouldSuggestBlocking() const; 54 55 private: 56 enum class BlockCommand { 57 Allow, 58 Block, 59 SuggestBlocking 60 }; 61 62 WebGLBlacklist(BlockCommand); 63 64 BlockCommand m_command; 48 65 }; 49 66 50 struct PluginModuleInfo { 51 String path; 52 WebCore::PluginInfo info; 67 } 53 68 54 #if PLATFORM(COCOA)55 cpu_type_t pluginArchitecture;56 String bundleIdentifier;57 String versionString;58 String shortVersionString;59 bool hasSandboxProfile;60 #elif PLATFORM(GTK)61 bool requiresGtk2;62 69 #endif 63 };64 65 } // namespace WebKit66 67 #endif // PluginModuleInfo_h -
trunk/Source/WebCore/platform/spi/cf/CFUtilitiesSPI.h
r204461 r204462 1 1 /* 2 * Copyright (C) 201 1Apple Inc. All rights reserved.2 * Copyright (C) 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef PluginModuleInfo_h 27 #define PluginModuleInfo_h 26 #pragma once 28 27 29 #include < WebCore/PluginData.h>28 #include <CoreFoundation/CoreFoundation.h> 30 29 31 #if PLATFORM(COCOA)32 #i nclude <mach/machine.h>30 #if USE(APPLE_INTERNAL_SDK) 31 #import <CoreFoundation/CFPriv.h> 33 32 #endif 34 33 35 namespace WebKit { 36 37 enum PluginModuleLoadPolicy { 38 // The plug-in module should be loaded normally. 39 PluginModuleLoadNormally, 40 41 // The plug-in module should be loaded normally. If the plug-in has a sandbox, it will be disabled. 42 PluginModuleLoadUnsandboxed, 43 44 // The plug-in should be blocked from being instantiated. 45 // Note that the plug-in will still be seen by e.g. navigator.plugins 46 PluginModuleBlockedForSecurity, 47 PluginModuleBlockedForCompatibility, 48 }; 49 50 struct PluginModuleInfo { 51 String path; 52 WebCore::PluginInfo info; 53 54 #if PLATFORM(COCOA) 55 cpu_type_t pluginArchitecture; 56 String bundleIdentifier; 57 String versionString; 58 String shortVersionString; 59 bool hasSandboxProfile; 60 #elif PLATFORM(GTK) 61 bool requiresGtk2; 62 #endif 63 }; 64 65 } // namespace WebKit 66 67 #endif // PluginModuleInfo_h 34 extern "C" { 35 CFDictionaryRef _CFCopySystemVersionDictionary(void); 36 extern const CFStringRef _kCFSystemVersionProductVersionKey; 37 extern const CFStringRef _kCFSystemVersionBuildVersionKey; 38 } -
trunk/Source/WebKit/mac/ChangeLog
r204456 r204462 1 2016-08-12 Anders Carlsson <andersca@apple.com> 2 3 Move the plug-in and WebGL blacklist code to WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=160831 5 6 Reviewed by Sam Weinig. 7 8 Adopt the plug-in and WebGL blacklist code from WebCore instead of using the code from WebKitSystemInterface. 9 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (shouldBlockPlugin): 12 (WebFrameLoaderClient::createPlugin): 13 (WebFrameLoaderClient::createJavaAppletWidget): 14 (shouldBlockWebGL): 15 (WebFrameLoaderClient::webGLPolicyForURL): 16 (WebFrameLoaderClient::resolveWebGLPolicyForURL): 17 1 18 2016-08-14 Daniel Bates <dabates@apple.com> 2 19 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r204320 r204462 109 109 #import <WebCore/NSURLFileTypeMappingsSPI.h> 110 110 #import <WebCore/Page.h> 111 #import <WebCore/PluginBlacklist.h> 111 112 #import <WebCore/PluginViewBase.h> 112 113 #import <WebCore/ProtectionSpace.h> … … 119 120 #import <WebCore/SubresourceLoader.h> 120 121 #import <WebCore/WebCoreObjCExtras.h> 122 #import <WebCore/WebGLBlacklist.h> 121 123 #import <WebCore/WebScriptObjectPrivate.h> 122 124 #import <WebCore/Widget.h> … … 1891 1893 #endif // ENABLE(NETSCAPE_PLUGIN_API) 1892 1894 1895 static bool shouldBlockPlugin(WebBasePluginPackage *pluginPackage) 1896 { 1897 #if PLATFORM(MAC) 1898 auto loadPolicy = PluginBlacklist::loadPolicyForPluginVersion(pluginPackage.bundleIdentifier, pluginPackage.bundleVersion); 1899 return loadPolicy == PluginBlacklist::LoadPolicy::BlockedForSecurity || loadPolicy == PluginBlacklist::LoadPolicy::BlockedForCompatibility; 1900 #else 1901 UNUSED_PARAM(pluginPackage); 1902 return false; 1903 #endif 1904 } 1905 1893 1906 RefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElement* element, const URL& url, 1894 1907 const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) … … 1974 1987 1975 1988 if (pluginPackage) { 1976 if ( WKShouldBlockPlugin([pluginPackage bundleIdentifier], [pluginPackage bundleVersion])) {1989 if (shouldBlockPlugin(pluginPackage)) { 1977 1990 errorCode = WebKitErrorBlockedPlugInVersion; 1978 1991 if (is<RenderEmbeddedObject>(element->renderer())) … … 2079 2092 2080 2093 if (pluginPackage) { 2081 if ( WKShouldBlockPlugin([pluginPackage bundleIdentifier], [pluginPackage bundleVersion])) {2094 if (shouldBlockPlugin(pluginPackage)) { 2082 2095 errorCode = WebKitErrorBlockedPlugInVersion; 2083 2096 if (is<RenderEmbeddedObject>(element->renderer())) … … 2127 2140 2128 2141 #if ENABLE(WEBGL) 2142 static bool shouldBlockWebGL() 2143 { 2144 #if PLATFORM(MAC) 2145 return WebGLBlacklist::shouldBlockWebGL(); 2146 #else 2147 return false; 2148 #endif 2149 } 2150 2129 2151 WebCore::WebGLLoadPolicy WebFrameLoaderClient::webGLPolicyForURL(const String&) const 2130 2152 { 2131 return WKShouldBlockWebGL() ? WebGLBlockCreation : WebGLAllowCreation;2153 return shouldBlockWebGL() ? WebGLBlockCreation : WebGLAllowCreation; 2132 2154 } 2133 2155 2134 2156 WebCore::WebGLLoadPolicy WebFrameLoaderClient::resolveWebGLPolicyForURL(const String&) const 2135 2157 { 2136 return WKShouldBlockWebGL() ? WebGLBlockCreation : WebGLAllowCreation;2158 return shouldBlockWebGL() ? WebGLBlockCreation : WebGLAllowCreation; 2137 2159 } 2138 2160 #endif // ENABLE(WEBGL) -
trunk/Source/WebKit2/ChangeLog
r204461 r204462 1 2016-08-12 Anders Carlsson <andersca@apple.com> 2 3 Move the plug-in and WebGL blacklist code to WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=160831 5 6 Reviewed by Sam Weinig. 7 8 Adopt the plug-in and WebGL blacklist code from WebCore instead of using the code from WebKitSystemInterface. 9 10 * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: 11 (WebKit::getPlatformPluginModuleInformation): 12 * Shared/Plugins/PluginModuleInfo.h: 13 * UIProcess/API/C/mac/WKContextPrivateMac.mm: 14 (WKContextIsPlugInUpdateAvailable): 15 (WKContextShouldBlockWebGL): 16 (WKContextShouldSuggestBlockWebGL): 17 * UIProcess/Plugins/PluginInfoStore.h: 18 * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: 19 (WebKit::shouldBlockPlugin): 20 (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin): 21 (WebKit::WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy): Deleted. 22 * UIProcess/WebPageProxy.cpp: 23 (WebKit::WebPageProxy::findPlugin): 24 1 25 2016-08-10 Brent Fulgham <bfulgham@apple.com> 2 26 -
trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/PluginInformationMac.mm
r177699 r204462 33 33 #import "PluginModuleInfo.h" 34 34 #import "StringUtilities.h" 35 #import <WebKitSystemInterface.h> 35 #import <WebCore/PluginBlacklist.h> 36 37 using namespace WebCore; 36 38 37 39 namespace WebKit { … … 42 44 map.set(pluginInformationBundleVersionKey(), API::String::create(plugin.versionString)); 43 45 map.set(pluginInformationBundleShortVersionKey(), API::String::create(plugin.shortVersionString)); 44 map.set(pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey(), API::Boolean::create(W KIsPluginUpdateAvailable(nsStringFromWebCoreString(plugin.bundleIdentifier))));46 map.set(pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey(), API::Boolean::create(WebCore::PluginBlacklist::isPluginUpdateAvailable(nsStringFromWebCoreString(plugin.bundleIdentifier)))); 45 47 map.set(pluginInformationHasSandboxProfileKey(), API::Boolean::create(plugin.hasSandboxProfile)); 46 48 } -
trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h
r196505 r204462 24 24 */ 25 25 26 #ifndef PluginModuleInfo_h 27 #define PluginModuleInfo_h 26 #pragma once 28 27 29 28 #include <WebCore/PluginData.h> … … 64 63 65 64 } // namespace WebKit 66 67 #endif // PluginModuleInfo_h -
trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm
r203674 r204462 39 39 #import "WKStringCF.h" 40 40 #import "WebProcessPool.h" 41 #import <WebKitSystemInterface.h> 41 #import <WebCore/PluginBlacklist.h> 42 #import <WebCore/WebGLBlacklist.h> 42 43 #import <wtf/RetainPtr.h> 43 44 … … 49 50 return false; 50 51 #else 51 return W KIsPluginUpdateAvailable((NSString *)adoptCF(WKStringCopyCFString(kCFAllocatorDefault, plugInBundleIdentifierRef)).get());52 return WebCore::PluginBlacklist::isPluginUpdateAvailable((NSString *)adoptCF(WKStringCopyCFString(kCFAllocatorDefault, plugInBundleIdentifierRef)).get()); 52 53 #endif 53 54 } … … 157 158 bool WKContextShouldBlockWebGL() 158 159 { 159 return WKShouldBlockWebGL(); 160 #if PLATFORM(MAC) 161 return WebCore::WebGLBlacklist::shouldBlockWebGL(); 162 #else 163 return false; 164 #endif 160 165 } 161 166 162 167 bool WKContextShouldSuggestBlockWebGL() 163 168 { 164 return WKShouldSuggestBlockingWebGL(); 169 #if PLATFORM(MAC) 170 return WebCore::WebGLBlacklist::shouldSuggestBlockingWebGL(); 171 #else 172 return false; 173 #endif 165 174 } -
trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
r187047 r204462 32 32 #import "NetscapePluginModule.h" 33 33 #import "SandboxUtilities.h" 34 #import "WebKitSystemInterface.h"34 #import <WebCore/PluginBlacklist.h> 35 35 #import <WebCore/WebCoreNSStringExtras.h> 36 36 #import <wtf/HashSet.h> … … 77 77 { 78 78 PluginModuleLoadPolicy loadPolicy = PluginInfoStore::defaultLoadPolicyForPlugin(plugin); 79 return (loadPolicy == PluginModuleBlockedForSecurity) || (loadPolicy == PluginModuleBlockedForCompatibility);79 return loadPolicy == PluginModuleBlockedForSecurity || loadPolicy == PluginModuleBlockedForCompatibility; 80 80 } 81 81 … … 109 109 } 110 110 111 inline PluginModuleLoadPolicy WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy(WKPlugInModuleLoadPolicy wksiPolicy)112 {113 114 switch (wksiPolicy) {115 case WKPlugInModuleLoadPolicyLoadNormally:116 return PluginModuleLoadNormally;117 case WKPlugInModuleLoadPolicyLoadUnsandboxed:118 return PluginModuleLoadUnsandboxed;119 case WKPlugInModuleLoadPolicyBlockedForSecurity:120 return PluginModuleBlockedForSecurity;121 case WKPlugInModuleLoadPolicyBlockedForCompatibility:122 return PluginModuleBlockedForCompatibility;123 }124 125 ASSERT_NOT_REACHED();126 return PluginModuleBlockedForSecurity;127 }128 129 111 PluginModuleLoadPolicy PluginInfoStore::defaultLoadPolicyForPlugin(const PluginModuleInfo& plugin) 130 112 { 131 return WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy(WKLoadPolicyForPluginVersion(plugin.bundleIdentifier, plugin.versionString)); 113 switch (PluginBlacklist::loadPolicyForPluginVersion(plugin.bundleIdentifier, plugin.versionString)) { 114 case PluginBlacklist::LoadPolicy::LoadNormally: 115 return PluginModuleLoadNormally; 116 case PluginBlacklist::LoadPolicy::BlockedForSecurity: 117 return PluginModuleBlockedForSecurity; 118 case PluginBlacklist::LoadPolicy::BlockedForCompatibility: 119 return PluginModuleBlockedForCompatibility; 120 } 132 121 } 133 122
Note:
See TracChangeset
for help on using the changeset viewer.