[webkit-reviews] review granted: [Bug 53466] Move WebKit2 to printing via API methods : [Attachment 80706] proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 31 19:06:55 PST 2011


Maciej Stachowiak <mjs at apple.com> has granted Alexey Proskuryakov
<ap at webkit.org>'s request for review:
Bug 53466: Move WebKit2 to printing via API methods
https://bugs.webkit.org/show_bug.cgi?id=53466

Attachment 80706: proposed patch
https://bugs.webkit.org/attachment.cgi?id=80706&action=review

------- Additional Comments from Maciej Stachowiak <mjs at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=80706&action=review

r=me but see comments

> Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm:114
> +    return [[[[_printOperation printInfo] dictionary]
objectForKey:NSPrintFirstPage] unsignedIntegerValue];

Perhaps it's worth it to encapsulate this dictionary lookup and its comment in
a method, so that the  similar calls below could reuse it.

> Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm:123
> +    // Need to directly access the dictionary because -[NSPrintOperation
pageRange] verifies pagination, potentially causing recursion.
> +    NSUInteger firstPage = [[[[_printOperation printInfo] dictionary]
objectForKey:NSPrintFirstPage] unsignedIntegerValue];
> +    NSUInteger lastPage = [[[[_printOperation printInfo] dictionary]
objectForKey:NSPrintLastPage] unsignedIntegerValue];

Aforementioned similar calls.

> Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm:166
> +	       if (data) {

Is it possible to change this if block to an early return with the reverse
condition?


More information about the webkit-reviews mailing list