Bug 25834 - Make ChromeClient only have pure virtuals
Summary: Make ChromeClient only have pure virtuals
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-16 03:35 PDT by Holger Freyther
Modified: 2009-05-20 09:06 PDT (History)
0 users

See Also:


Attachments
Make recent additions pure virtual again (15.49 KB, patch)
2009-05-16 03:38 PDT, Holger Freyther
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Freyther 2009-05-16 03:35:07 PDT
Recent additions to ChromeClient added default implementations. From a porter point of view this is rather bad as old features might break and no runtime warning is printed and searching for notImplemented will not show anything. The approach to treat the *Client as an interface and only have pure virtual is a lot better in this regard. Change ChromeClient to be a interface again.
Comment 1 Holger Freyther 2009-05-16 03:38:11 PDT
Created attachment 30411 [details]
Make recent additions pure virtual again

Make setCursor, scrollRectIntoView, requestGeolocationPermissionForFrame pure virtual.
Comment 2 Darin Adler 2009-05-16 10:39:15 PDT
Comment on attachment 30411 [details]
Make recent additions pure virtual again

> -        virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {} // Platforms other than Mac can implement this if it ever becomes necessary for them to do so.
> +        virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0; // Platforms other than Mac can implement this if it ever becomes necessary for them to do so.

I don't think the comment makes sense any more if this is a pure virtual.

This change seems OK. This is the reason I used pure virtuals in the first place, but I'm not entirely sure either way whether this is a good thing or not.

r=me
Comment 3 Holger Freyther 2009-05-20 09:06:24 PDT
Changed the comment to mention the implementation for mac and landed in r43918. With my "porters" hat on I like the pure virtual functions, they move everything relevant to the various client implementation that can be found in the kit...