Bug 32572

Summary: [Qt] Cannot load flash files from a local file.
Product: WebKit Reporter: Yael <yael>
Component: Plug-insAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hausmann, webkit.review.bot
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch.
none
Patch.
kenneth: review+
New patch to reduce nesting. none

Yael
Reported 2009-12-15 12:51:15 PST
swf files that are loaded from the local file system have their mime type set to application/octet-stream. This prevents identifying the file as flash file. The same problem can be observed in Safari, but not in Chrome. Patch will follow soon.
Attachments
Patch. (3.18 KB, patch)
2009-12-15 12:58 PST, Yael
no flags
Patch. (4.15 KB, patch)
2009-12-15 13:24 PST, Yael
kenneth: review+
New patch to reduce nesting. (4.07 KB, patch)
2009-12-15 13:51 PST, Yael
no flags
Yael
Comment 1 2009-12-15 12:58:17 PST
WebKit Review Bot
Comment 2 2009-12-15 13:00:19 PST
style-queue ran check-webkit-style on attachment 44901 [details] without any errors.
Yael
Comment 3 2009-12-15 13:24:20 PST
Created attachment 44903 [details] Patch. Separate the new code into its own method, as suggested by Kenneth.
WebKit Review Bot
Comment 4 2009-12-15 13:26:09 PST
style-queue ran check-webkit-style on attachment 44903 [details] without any errors.
Kenneth Rohde Christiansen
Comment 5 2009-12-15 13:49:52 PST
Comment on attachment 44903 [details] Patch. When landing consider the below comments > + void substituteMIMETypeFromPluginDatabase(const ResourceResponse& r);\ Remove the 'r' variable > +#if PLATFORM(QT) > +void MainResourceLoader::substituteMIMETypeFromPluginDatabase(const ResourceResponse& r) > +{ > + if (m_frame->settings()->arePluginsEnabled()) { > + String filename = r.url().lastPathComponent(); > + if (!filename.endsWith("/")) { > + int extensionPos = filename.reverseFind('.'); > + if (extensionPos != -1) { > + String extension = filename.substring(extensionPos + 1); > + String mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(extension); > + if (!mimeType.isEmpty()) { > + ResourceResponse* response = const_cast<ResourceResponse*>(&r); > + response->setMimeType(mimeType); > + } > + } > + } > + } > +} > +#endif Reduce nesting by using early returns.
Yael
Comment 6 2009-12-15 13:51:26 PST
Created attachment 44907 [details] New patch to reduce nesting.
WebKit Review Bot
Comment 7 2009-12-15 13:52:00 PST
style-queue ran check-webkit-style on attachment 44907 [details] without any errors.
WebKit Commit Bot
Comment 8 2009-12-15 14:07:58 PST
Comment on attachment 44907 [details] New patch to reduce nesting. Clearing flags on attachment: 44907 Committed r52172: <http://trac.webkit.org/changeset/52172>
WebKit Commit Bot
Comment 9 2009-12-15 14:08:12 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.