Summary: | [Qt] Cannot load flash files from a local file. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yael <yael> | ||||||||
Component: | Plug-ins | Assignee: | 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
Yael
2009-12-15 12:51:15 PST
Created attachment 44901 [details]
Patch.
style-queue ran check-webkit-style on attachment 44901 [details] without any errors.
Created attachment 44903 [details]
Patch.
Separate the new code into its own method, as suggested by Kenneth.
style-queue ran check-webkit-style on attachment 44903 [details] without any errors.
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. Created attachment 44907 [details]
New patch to reduce nesting.
style-queue ran check-webkit-style on attachment 44907 [details] without any errors.
Comment on attachment 44907 [details] New patch to reduce nesting. Clearing flags on attachment: 44907 Committed r52172: <http://trac.webkit.org/changeset/52172> All reviewed patches have been landed. Closing bug. |