Changeset 64430 in webkit
- Timestamp:
- Jul 31, 2010 5:42:40 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r64426 r64430 1 2010-07-31 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Crash due to calling StringImpl::createCFString() from non-main thread in plug-in code 6 https://bugs.webkit.org/show_bug.cgi?id=43306 7 <rdar://problem/8259687> 8 9 * UIProcess/Plugins/PluginInfoStore.cpp: 10 (WebKit::PluginInfoStore::getMIMETypeForExtension): 11 (WebKit::PluginInfoStore::findPlugin): 12 * UIProcess/Plugins/PluginInfoStore.h: 13 * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: 14 (WebKit::safeCreateCFString): 15 (WebKit::PluginInfoStore::getMIMETypeForExtension): 16 Bypass MIMETypeRegistry in the UIProcess until we can safely convert Strings 17 to CFStringRefs. 18 1 19 2010-07-31 Sam Weinig <sam@webkit.org> 2 20 -
trunk/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
r64287 r64430 152 152 } 153 153 154 #if !PLATFORM(MAC) 155 String PluginInfoStore::getMIMETypeForExtension(const String& extension) 156 { 157 return MIMETypeRegistry::getMIMETypeForExtension(extension); 158 } 159 #endif 160 154 161 PluginInfoStore::Plugin PluginInfoStore::findPlugin(String& mimeType, const KURL& url) 155 162 { … … 171 178 172 179 // Finally, try to get the MIME type from the extension in a platform specific manner and use that. 173 String extensionMimeType = MIMETypeRegistry::getMIMETypeForExtension(extension);180 String extensionMimeType = getMIMETypeForExtension(extension); 174 181 if (!extensionMimeType.isNull()) { 175 182 Plugin plugin = findPluginForMIMEType(extensionMimeType); -
trunk/WebKit2/UIProcess/Plugins/PluginInfoStore.h
r64287 r64430 74 74 static bool getPluginInfo(const WebCore::String& pluginPath, Plugin& plugin); 75 75 static bool shouldUsePlugin(const Plugin& plugin, const Vector<Plugin>& loadedPlugins); 76 76 static WebCore::String getMIMETypeForExtension(const WebCore::String& extension); 77 77 78 Vector<WebCore::String> m_additionalPluginsDirectories; 78 79 Vector<Plugin> m_plugins; -
trunk/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
r64287 r64430 26 26 #include "PluginInfoStore.h" 27 27 28 #include "WebKitSystemInterface.h" 28 29 #include <WebCore/WebCoreNSStringExtras.h> 29 30 #include <wtf/HashSet.h> … … 46 47 // FIXME: Once the UI process knows the difference between the main thread and the web thread we can drop this and just use 47 48 // String::createCFString. 48 static CFStringRef safeCreateCFString(const String& directory)49 { 50 return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>( directory.characters()), directory.length());49 static CFStringRef safeCreateCFString(const String& string) 50 { 51 return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(string.characters()), string.length()); 51 52 } 52 53 … … 368 369 } 369 370 371 String PluginInfoStore::getMIMETypeForExtension(const String& extension) 372 { 373 // FIXME: This should just call MIMETypeRegistry::getMIMETypeForExtension and be 374 // strength reduced into the callsite once we can safely convert WebCore::String 375 // to CFStringRef off the main thread. 376 377 RetainPtr<CFStringRef> extensionCFString(AdoptCF, safeCreateCFString(extension)); 378 return WKGetMIMETypeForExtension((NSString *)extensionCFString.get()); 379 } 380 370 381 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.