[Webkit-unassigned] [Bug 63256] [GTK] Fix runtime critical warnings in WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 23 08:08:56 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=63256


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #98350|review?                     |review-
               Flag|                            |




--- Comment #2 from Martin Robinson <mrobinson at webkit.org>  2011-06-23 08:08:56 PST ---
(From update of attachment 98350)
View in context: https://bugs.webkit.org/attachment.cgi?id=98350&action=review

> Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:92
> -FloatRect screenRect(Widget* widget)
> +static gboolean getScreenAndMonitorForWidget(Widget* widget, GdkScreen** screenOut, gint* monitorOut)

I'd rather this be a smaller helper (getScreen) like getVisual. In fact, getVisual should just use this helper to get the screen.

> Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:127
> +    if (!widget)
> +        return FloatRect();
> +
> +    GdkScreen* screen;
> +    gint monitor;
> +    if (!getScreenAndMonitorForWidget(widget, &screen, &monitor))
>          return FloatRect();
>  
> -    gint monitor = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_window(GTK_WIDGET(container)));
>      GdkRectangle geometry;
>      gdk_screen_get_monitor_geometry(screen, monitor, &geometry);
> -    
> +

I think this could be a bit more straightforward. The use of out-parameters is a bit cludgy here. Why not just maintain the structure of screenRect and then do an early return if getScreenForWidget/getScreen fails?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list