[webkit-reviews] review granted: [Bug 32572] [Qt] Cannot load flash files from a local file. : [Attachment 44903] Patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 15 13:49:52 PST 2009


Kenneth Rohde Christiansen <kenneth at webkit.org> has granted Yael
<yael.aharon at nokia.com>'s request for review:
Bug 32572: [Qt] Cannot load flash files from a local file.
https://bugs.webkit.org/show_bug.cgi?id=32572

Attachment 44903: Patch.
https://bugs.webkit.org/attachment.cgi?id=44903&action=review

------- Additional Comments from Kenneth Rohde Christiansen
<kenneth at webkit.org>
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.


More information about the webkit-reviews mailing list