Closed Bug 1036803 Opened 5 years ago Closed 5 years ago

SharedThreadPool::GetEventTarget should be made private

Categories

(Core :: Audio/Video, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: jwwang, Assigned: lviknesh, Mentored)

Details

(Whiteboard: [good first bug])

Attachments

(1 file, 1 obsolete file)

Returning |mEventTarget| from GetEventTarget() could lead to a longer life of |mEventTarget| than SharedThreadPool which defeat the purpose of SpinUntilShutdown().

Since SharedThreadPool implements nsIEventTarget, the user can just cast a SharedThreadPool into an nsIEventTarget when an nsIEventTarget is wanted.
Flags: needinfo?(cpearce)
Yes, GetEventTarget() would be better private.
Flags: needinfo?(cpearce)
Per comment 0 and comment 1, SharedThreadPool::GetEventTarget() [1] should be private.
[1] http://hg.mozilla.org/mozilla-central/file/7f9db2379b3f/content/media/SharedThreadPool.h#l54
Mentor: jwwang
Whiteboard: [good first bug]
Attached patch private.patch (obsolete) — Splinter Review
Assignee: nobody → lviknesh
Status: NEW → ASSIGNED
Attachment #8455518 - Flags: review?(jwwang)
Comment on attachment 8455518 [details] [diff] [review]
private.patch

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

feedback=jwwang. Looks good to me.

Hi Matthew,
Can you review this patch? Thanks.
Attachment #8455518 - Flags: review?(kinetik)
Attachment #8455518 - Flags: review?(jwwang)
Attachment #8455518 - Flags: feedback+
Comment on attachment 8455518 [details] [diff] [review]
private.patch

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

Looks fine, but why not remove GetEventTarget() completely and change NS_FORWARD_SAFE_NSIEVENTTARGET(GetEventTarget()) to NS_FORWARD_SAFE_NSIEVENTTARGET(mEventTarget)?  There are no other users that I can find.
Attachment #8455518 - Flags: review?(kinetik) → review+
Good idea.

Hi vikneshwar,
Please change the patch as suggested by Matthew and put r=kinetik in the commit message. Also please push the patch to Try to ensure the patch doesn't break any builds on all platforms.
Got RED in try push :( not sure whats going wrong
Attachment #8455518 - Attachment is obsolete: true
Attachment #8456253 - Flags: feedback?(kinetik)
(In reply to vikneshwar from comment #7)
> Created attachment 8456253 [details] [diff] [review]
> eventtarget.patch
> 
> Got RED in try push :( not sure whats going wrong

Patch looks fine... Can you post a link to the try push please?
hai Matthew , here  https://tbpl.mozilla.org/?tree=Try&rev=337cfbe61146 :)
Flags: needinfo?(kinetik)
Can you update the repo and try again? It built fine for me.
hai jwwang , when i run the build with patch it fails , here is the log http://pastebin.com/zdf7iJaC . However it builds fine without the patch
Flags: needinfo?(jwwang)
Mystery solved: bug 996465 removed the only call to GetEventTarget().  So with a current tree, this patch works fine.
Flags: needinfo?(kinetik)
is there anymore changes i should make to the patch , or its fine for checkin now  ??
Flags: needinfo?(kinetik)
Attachment #8456253 - Flags: feedback?(kinetik) → feedback+
Flags: needinfo?(kinetik)
Good to go!
This is a simple change that don't need run Try tests provided it doesn't break builds.
Flags: needinfo?(jwwang)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f41eab62f108
Status: ASSIGNED → 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.