Closed Bug 1170328 Opened 5 years ago Closed 5 years ago

Mark nsIDocument::WarnOnceAbout() const

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

Details

Attachments

(1 file, 1 obsolete file)

It doesn't seem to make sense that a method is not marked const because it calls WarnOnceAbout. We should make m{Deprecation,DocWarning}WarnedAbout mutable so that nsIDocument::WarnOnceAbout() can be const.
Attached patch patch (obsolete) — Splinter Review
Attachment #8613711 - Flags: review?(nfroyd)
Comment on attachment 8613711 [details] [diff] [review]
patch

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

I'm not a DOM peer.  Redirecting...
Attachment #8613711 - Flags: review?(nfroyd) → review?(bugs)
Can we add a mainthread-only assert to WarnOnceAbout in the process?  Because using mutable members in a const method in multithreaded code is bad, obviously.
(In reply to Not doing reviews right now from comment #3)
> Can we add a mainthread-only assert to WarnOnceAbout in the process? 
> Because using mutable members in a const method in multithreaded code is
> bad, obviously.

Yes. I guess it isn't that necessary, though. At worst, it would only cause a warning to display for more than once in the console, which doesn't seem to be a terrible issue, does it?
Attached patch patchSplinter Review
Attachment #8613711 - Attachment is obsolete: true
Attachment #8613711 - Flags: review?(bugs)
Attachment #8613853 - Flags: review?(bugs)
Attachment #8613853 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/486cd5d1caf7
Assignee: nobody → quanxunzhen
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.