Closed Bug 1168167 Opened 9 years ago Closed 9 years ago

Mark LazyIdleThread::mIdleObserver with MOZ_UNSAFE_REF

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(1 file, 2 obsolete files)

Attachment #8610196 - Flags: review?(benjamin)
Comment on attachment 8610196 [details] [diff] [review]
Mark LazyIdleThread::mIdleObserver with MOZ_UNSAFE_REF

I can't figure out from the docs what MOZ_UNSAFE_REF does, so I don't think I can review this.
Attachment #8610196 - Flags: review?(benjamin)
Attachment #8610196 - Flags: review?(nfroyd)
Assignee: nobody → michael
Comment on attachment 8610196 [details] [diff] [review]
Mark LazyIdleThread::mIdleObserver with MOZ_UNSAFE_REF

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

r=me with the change below.

::: xpcom/threads/LazyIdleThread.h
@@ +161,5 @@
>    /**
>     * Idle observer. Called when the thread is about to be shut down. Released
>     * only when Shutdown() is called.
>     */
> +  nsIObserver* MOZ_UNSAFE_REF("Caller must null if ptr becomes invalid") mIdleObserver;

I think the better annotation here is something like:

MOZ_UNSAFE_REF("See the documentation for SetWeakIdleObserver for lifetime information of this field")

as there's no referent for "Caller" here.
Attachment #8610196 - Flags: review?(nfroyd) → review+
Update the commit message
Attachment #8610196 - Attachment is obsolete: true
Or:

MOZ_UNSAFE_REF("See the documentation for SetWeakIdleObserver for how the owner of LazyIdleThread should manage the lifetime information of this field")
Yeah - I think I like that one better. I'll update it again.
Updated message again
Attachment #8612850 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/871ac213933e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: