[webkit-reviews] review granted: [Bug 72959] [Qt] [WK2] Move PagePolicyClient related code to QtWebPagePolicyClient : [Attachment 116228] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 23 04:53:44 PST 2011


Andreas Kling <kling at webkit.org> has granted Caio Marcelo de Oliveira Filho
<cmarcelo at webkit.org>'s request for review:
Bug 72959: [Qt] [WK2] Move PagePolicyClient related code to
QtWebPagePolicyClient
https://bugs.webkit.org/show_bug.cgi?id=72959

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

------- Additional Comments from Andreas Kling <kling at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=116228&action=review


r=me with some nits that you don't need to fix in this patch, but may want to
consider in the future. :)

> Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:64
> +static Qt::MouseButton toQtMouseButton(WKEventMouseButton button)
> +{
> +    switch (button) {
> +    case kWKEventMouseButtonLeftButton:
> +	   return Qt::LeftButton;
> +    case kWKEventMouseButtonMiddleButton:
> +	   return Qt::MiddleButton;
> +    case kWKEventMouseButtonRightButton:
> +	   return Qt::RightButton;
> +    }
> +    return Qt::NoButton;
> +}

In this kind of method, we should have a case for kWKEventMouseButtonNoButton
(returning Qt::NoButton) and then putting an ASSERT_NOT_REACHED() after the
switch.

> Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp:97
> +    switch (action) {
> +    case Use:
> +	   WKFramePolicyListenerUse(listener);
> +	   break;
> +    case Download:
> +	   WKFramePolicyListenerDownload(listener);
> +	   break;
> +    case Ignore:
> +	   WKFramePolicyListenerIgnore(listener);
> +	   break;
> +    }

Similar situation here, we could replace the breaks by returns and put an
ASSERT_NOT_REACHED() after the switch.


More information about the webkit-reviews mailing list