Changeset 81732 in webkit
- Timestamp:
- Mar 22, 2011 5:33:48 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r81719 r81732 1 2011-03-22 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 OBJECT element with DivX source is always downloaded 6 https://bugs.webkit.org/show_bug.cgi?id=56879 7 8 * Plugins/WebBasePluginPackage.mm: 9 (-[WebBasePluginPackage getPluginInfoFromPLists]): 10 Always try to split every element in the "WebPluginExtensions" array, since the DivX plug-in 11 specifies multiple file extensions in a single element. 12 1 13 2011-03-22 Brady Eidson <beidson@apple.com> 2 14 -
trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm
r74446 r81732 39 39 #import <wtf/Threading.h> 40 40 #import <wtf/Vector.h> 41 #import <wtf/text/CString.h> 41 42 42 43 #import <WebKitSystemInterface.h> … … 223 224 224 225 extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings]; 225 for (NSUInteger i = 0; i < [extensions count]; ++i) 226 mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:i]); 226 for (NSUInteger i = 0; i < [extensions count]; ++i) { 227 // The DivX plug-in lists multiple extensions in a comma separated string instead of using 228 // multiple array elements in the property list. Work around this here by splitting the 229 // extension string into components. 230 NSArray *extensionComponents = [[extensions objectAtIndex:i] componentsSeparatedByString:@","]; 231 232 for (NSString *extension in extensionComponents) 233 mimeClassInfo.extensions.append(extension); 234 } 227 235 228 236 if ([extensions count] == 0) -
trunk/Source/WebKit2/ChangeLog
r81723 r81732 1 2011-03-22 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 OBJECT element with DivX source is always downloaded 6 https://bugs.webkit.org/show_bug.cgi?id=56879 7 8 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: 9 (WebKit::getPluginInfoFromPropertyLists): 10 Always try to split every element in the "WebPluginExtensions" array, since the DivX plug-in 11 specifies multiple file extensions in a single element. 12 13 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 14 (WebKit::pluginSupportsExtension): 15 Add a new helper function. 16 17 (WebKit::WebFrameLoaderClient::objectContentType): 18 If we can't find the MIME for an extension, explicitly check if there's a plugin that claims to 19 handle the given extension. 20 1 21 2011-03-22 Brady Eidson <beidson@apple.com> 2 22 -
trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
r81705 r81732 143 143 if (!extension || CFGetTypeID(extension) != CFStringGetTypeID()) 144 144 continue; 145 146 mimeClassInfo.extensions.append(String(extension).lower()); 145 146 // The DivX plug-in lists multiple extensions in a comma separated string instead of using 147 // multiple array elements in the property list. Work around this here by splitting the 148 // extension string into components. 149 Vector<String> extensionComponents; 150 String(extension).lower().split(',', extensionComponents); 151 152 for (size_t i = 0; i < extensionComponents.size(); ++i) 153 mimeClassInfo.extensions.append(extensionComponents[i]); 147 154 } 148 155 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r81535 r81732 1256 1256 } 1257 1257 1258 static bool pluginSupportsExtension(PluginData* pluginData, const String& extension) 1259 { 1260 ASSERT(extension.lower() == extension); 1261 1262 for (size_t i = 0; i < pluginData->mimes().size(); ++i) { 1263 const MimeClassInfo& mimeClassInfo = pluginData->mimes()[i]; 1264 1265 if (mimeClassInfo.extensions.contains(extension)) 1266 return true; 1267 } 1268 return false; 1269 } 1270 1258 1271 ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeTypeIn) 1259 1272 { … … 1262 1275 1263 1276 String mimeType = mimeTypeIn; 1264 if (mimeType.isEmpty()) 1265 mimeType = MIMETypeRegistry::getMIMETypeForExtension(url.path().substring(url.path().reverseFind('.') + 1)); 1277 if (mimeType.isEmpty()) { 1278 String extension = url.path().substring(url.path().reverseFind('.') + 1).lower(); 1279 1280 // Try to guess the MIME type from the extension. 1281 mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension); 1282 1283 if (mimeType.isEmpty()) { 1284 // Check if there's a plug-in around that can handle the extension. 1285 if (WebPage* webPage = m_frame->page()) { 1286 if (PluginData* pluginData = webPage->corePage()->pluginData()) { 1287 if (pluginSupportsExtension(pluginData, extension)) 1288 return ObjectContentNetscapePlugin; 1289 } 1290 } 1291 } 1292 } 1266 1293 1267 1294 if (mimeType.isEmpty())
Note: See TracChangeset
for help on using the changeset viewer.