[webkit-reviews] review granted: [Bug 50724] WebFrameProxy::canShowMIMEType should return true for PDF MIME types in the main frame : [Attachment 75987] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 8 17:04:01 PST 2010


Darin Adler <darin at apple.com> has granted Anders Carlsson
<andersca at apple.com>'s request for review:
Bug 50724: WebFrameProxy::canShowMIMEType should return true for PDF MIME types
in the main frame
https://bugs.webkit.org/show_bug.cgi?id=50724

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

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=75987&action=review

> WebKit2/UIProcess/WebFrameProxy.cpp:96
> +	   Vector<String> mimeTypes = WebContext::pdfAndPostScriptMIMETypes();
> +	   for (size_t i = 0; i < mimeTypes.size(); ++i) {
> +	       if (equalIgnoringCase(mimeTypes[i], mimeType))
> +		   return true;
> +	   }

Seems really ugly to write out the loop like this. One benefit of using a set
is that you don’t need to write the loop. You should factor the loop into a
helper function so it’s easier to see what the code is doing.


More information about the webkit-reviews mailing list