Bug 63249

Summary: [UNIX] Fix compile warnings in NetscapePluginX11.cpp
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Gtk, Qt
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch mrobinson: review+

Description Carlos Garcia Campos 2011-06-23 05:33:57 PDT
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: In function ‘void WebKit::setXButtonEventFields(XEvent&, const WebKit::WebMouseEvent&, const WebCore::IntPoint&)’:
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:405:12: warning: enumeration value ‘NoButton’ not handled in switch
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: In member function ‘bool WebKit::NetscapePlugin::platformHandleMouseEvent(const WebKit::WebMouseEvent&)’:
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:457:12: warning: enumeration value ‘NoType’ not handled in switch
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:457:12: warning: enumeration value ‘Wheel’ not handled in switch
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:457:12: warning: enumeration value ‘KeyDown’ not handled in switch
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:457:12: warning: enumeration value ‘KeyUp’ not handled in switch
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:457:12: warning: enumeration value ‘RawKeyDown’ not handled in switch
../Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:457:12: warning: enumeration value ‘Char’ not handled in switch
Comment 1 Carlos Garcia Campos 2011-06-23 05:35:31 PDT
Created attachment 98337 [details]
Patch
Comment 2 Martin Robinson 2011-06-23 08:10:41 PDT
Comment on attachment 98337 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98337&action=review

Looks good, but I have a few minor requests before landing.

> Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:362
> +    case WebMouseEvent::LeftButton:
> +    default:
> +        xButton.button = Button1;
> +        break;

If we are receiving other types of events shouldn't we be passing them properly to the plugin. I think it's more correct to simply have ASSERT_NOT_REACHED() for default:. This makes me wonder whether wheel events are supported or not.

> Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:414
> +    default:
> +        return false;

I would rather you list them explicitly here. Do you mind changing that before landing?
Comment 3 Carlos Garcia Campos 2011-06-23 08:25:30 PDT
(In reply to comment #2)
> (From update of attachment 98337 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=98337&action=review
> 
> Looks good, but I have a few minor requests before landing.
> 
> > Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:362
> > +    case WebMouseEvent::LeftButton:
> > +    default:
> > +        xButton.button = Button1;
> > +        break;
> 
> If we are receiving other types of events shouldn't we be passing them properly to the plugin. I think it's more correct to simply have ASSERT_NOT_REACHED() for default:. This makes me wonder whether wheel events are supported or not.

Since this code is shared between Gtk and Qt ports I looked at current WebKi1 code of both ports and followed it. There's another method for wheel events platformHandleWheelEvent().

> > Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:414
> > +    default:
> > +        return false;
> 
> I would rather you list them explicitly here. Do you mind changing that before landing?

Sure. Thanks for reviewing.
Comment 4 Carlos Garcia Campos 2011-06-23 09:42:06 PDT
Committed r89580: <http://trac.webkit.org/changeset/89580>