Closed Bug 1036070 Opened 5 years ago Closed 5 years ago

Remove dangerous public destructor of VisualEventTracer

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: valentin.gosu, Assigned: valentin.gosu)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch event_tracer_destructor.patch (obsolete) — Splinter Review
/home/icecold/mozilla-central/xpcom/base/VisualEventTracer.cpp:646:1: error: static_assert failed "Reference-counted class VisualEventTracer should not have a public destructor. Try to make this class's destructor non-public. If that is really not possible, you can whitelist this class by providing a HasDangerousPublicDestructor specialization for it."
NS_IMPL_ISUPPORTS(VisualEventTracer, nsIVisualEventTracer)
Attachment #8452623 - Flags: review?(ehsan)
Attachment #8452623 - Flags: review?(ehsan) → review?(dougt)
Attachment #8452623 - Flags: review?(dougt) → review?(nfroyd)
Comment on attachment 8452623 [details] [diff] [review]
event_tracer_destructor.patch

Review of attachment 8452623 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the changes below.

::: xpcom/base/VisualEventTracer.cpp
@@ +551,1 @@
>    virtual ~VisualEventTracerLog();

Please make this non-virtual and the class MOZ_FINAL while you are here.

::: xpcom/base/VisualEventTracer.h
@@ +218,5 @@
>  {
>    NS_DECL_ISUPPORTS
>    NS_DECL_NSIVISUALEVENTTRACER
> +private:
> +  virtual ~VisualEventTracer() {}

Please don't make this virtual and mark the class as MOZ_FINAL.
Attachment #8452623 - Flags: review?(nfroyd) → review+
Attachment #8452623 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/eb6fbf9aa306
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.