Closed Bug 387211 Opened 17 years ago Closed 17 years ago

Use NS_IMPL_ISUPPPORTS macros where possible

Categories

(Core :: Widget, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9alpha8

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

Attachments

(1 file, 1 obsolete file)

Followup from bug 385750 comment 9:

neil@parkwaycc.co.uk   2007-07-05 04:14:58 PDT
On the normal refcounted objects (nsMenuBoxObject and nsDeviceContextSpec*)
can't we replace that handwritten code with the NS_IMPL_ISUPPPORTS macros?
Attached patch Patch rev. 1 (obsolete) — Splinter Review
I removed some *_INHERITED stuff when there wasn't an interface added.
I don't see the point of _INHERITED0 other than to disambiguate
between multiple super classes that has nsISupport.
Please correct me if I'm wrong.

I also changed ADDREF/RELEASE/QI macros to ISUPPORTS and removed
explicit QueryInterface() methods where possible.

Regarding the removal of NS_IMPL_QUERY_INTERFACE2 in
widget/src/cocoa/nsDragService.mm
widget/src/photon/nsDragService.cpp
The two interfaces given to the macro are those implemented by the
super class (nsBaseDragService) so this is AFAICT equivalent to 
NS_IMPL_QUERY_INTERFACE_INHERITED0 which again can be removed.

I tested the patch on all three tier-1 platforms and it seems to
work correctly.
Attachment #271331 - Flags: review?(neil)
Comment on attachment 271331 [details] [diff] [review]
Patch rev. 1

>-class nsMenuBoxObject : public nsIMenuBoxObject, public nsBoxObject
>+class nsMenuBoxObject : public nsBoxObject, public nsIMenuBoxObject
> {
> public:
>-  NS_DECL_ISUPPORTS
>+  NS_DECL_ISUPPORTS_INHERITED
Nice :-)
Comment on attachment 271331 [details] [diff] [review]
Patch rev. 1

Waldo's patch bitrotted this so I couldn't properly test it but I'm sure it's OK :-)
Attachment #271331 - Flags: review?(neil) → review+
Attached patch Patch rev. 1Splinter Review
Yeah, there were a couple of static_cast conflicts in removed code.
This is the updated patch - no need to re-review.
Attachment #271331 - Attachment is obsolete: true
Attachment #271681 - Flags: superreview?(dbaron)
Comment on attachment 271681 [details] [diff] [review]
Patch rev. 1

sr=dbaron.  Sorry for the delay.
Attachment #271681 - Flags: superreview?(dbaron) → superreview+
Attachment #271681 - Flags: approval1.9?
Attachment #271681 - Flags: approval1.9? → approval1.9+
Checked in to trunk at 2007-08-07 08:18 PDT.

-> FIXED
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: