Changeset 52172 in webkit
- Timestamp:
- Dec 15, 2009 2:07:49 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52170 r52172 1 2009-12-15 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Cannot load flash files from a local file. 6 https://bugs.webkit.org/show_bug.cgi?id=32572 7 8 When loading the main resource and its mime type is application/octet-stream, 9 use the file extenstion to check if it is a supported plugin. 10 11 No new tests were added since any existing swf file can be used as a manual test. 12 13 * loader/MainResourceLoader.cpp: 14 (WebCore::MainResourceLoader::didReceiveResponse): 15 * loader/MainResourceLoader.h: 16 * plugins/PluginDatabase.h: 17 1 18 2009-12-15 Brian Weinstein <bweinstein@apple.com> 2 19 -
trunk/WebCore/loader/MainResourceLoader.cpp
r49671 r52172 39 39 #include "HTMLFormElement.h" 40 40 #include "Page.h" 41 #if PLATFORM(QT) 42 #include "PluginDatabase.h" 43 #endif 41 44 #include "ResourceError.h" 42 45 #include "ResourceHandle.h" … … 280 283 } 281 284 285 #if PLATFORM(QT) 286 void MainResourceLoader::substituteMIMETypeFromPluginDatabase(const ResourceResponse& r) 287 { 288 if (!m_frame->settings()->arePluginsEnabled()) 289 return; 290 291 String filename = r.url().lastPathComponent(); 292 if (filename.endsWith("/")) 293 return; 294 295 int extensionPos = filename.reverseFind('.'); 296 if (extensionPos == -1) 297 return; 298 299 String extension = filename.substring(extensionPos + 1); 300 String mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(extension); 301 if (!mimeType.isEmpty()) { 302 ResourceResponse* response = const_cast<ResourceResponse*>(&r); 303 response->setMimeType(mimeType); 304 } 305 } 306 #endif 307 282 308 void MainResourceLoader::didReceiveResponse(const ResourceResponse& r) 283 309 { … … 302 328 #endif 303 329 330 #if PLATFORM(QT) 331 if (r.mimeType() == "application/octet-stream") 332 substituteMIMETypeFromPluginDatabase(r); 333 #endif 334 304 335 if (m_loadingMultipartContent) { 305 336 frameLoader()->setupForReplaceByMIMEType(r.mimeType()); -
trunk/WebCore/loader/MainResourceLoader.h
r50625 r52172 93 93 void continueAfterContentPolicy(PolicyAction); 94 94 void continueAfterContentPolicy(PolicyAction, const ResourceResponse&); 95 96 #if PLATFORM(QT) 97 void substituteMIMETypeFromPluginDatabase(const ResourceResponse&); 98 #endif 95 99 96 100 ResourceRequest m_initialRequest; -
trunk/WebCore/plugins/PluginDatabase.h
r51378 r52172 84 84 Vector<String> pluginDirectories() const { return m_pluginDirectories; } 85 85 86 String MIMETypeForExtension(const String& extension) const; 87 86 88 private: 87 89 void getPluginPathsInDirectories(HashSet<String>&) const; … … 91 93 bool add(PassRefPtr<PluginPackage>); 92 94 void remove(PluginPackage*); 93 94 String MIMETypeForExtension(const String& extension) const;95 95 96 96 Vector<String> m_pluginDirectories;
Note: See TracChangeset
for help on using the changeset viewer.