[webkit-reviews] review granted: [Bug 119231] Null deref under PluginView::handlesPageScaleFactor() : [Attachment 207689] try to make ews go

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 30 12:26:55 PDT 2013


Darin Adler <darin at apple.com> has granted Tim Horton <thorton at apple.com>'s
request for review:
Bug 119231: Null deref under PluginView::handlesPageScaleFactor()
https://bugs.webkit.org/show_bug.cgi?id=119231

Attachment 207689: try to make ews go
https://bugs.webkit.org/attachment.cgi?id=207689&action=review

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


> Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:490
>      PluginDocument* pluginDocument =
static_cast<PluginDocument*>(m_coreFrame->document());
> -    PluginView* pluginView =
static_cast<PluginView*>(pluginDocument->pluginWidget());
> +    if (PluginView* pluginView =
static_cast<PluginView*>(pluginDocument->pluginWidget()))
> +	   return pluginView->handlesPageScaleFactor();
>  
> -    return pluginView->handlesPageScaleFactor();
> +    return 0;

I prefer early return to nesting the main line code in the if. Or using &&.

    return pluginView && pluginView->handlesPageScaleFactor();


More information about the webkit-reviews mailing list