cleanup and document WrapRunnable uses

RESOLVED FIXED in Firefox 55

Status

()

enhancement
P2
normal
Rank:
22
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jesup, Assigned: jesup)

Tracking

45 Branch
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

Just documenting WrapRunnable(this, ...) uses; there's one in gmp that due to paranoia I want to wrap, though it's only used for force-crashing GMP instances.
Rank: 22
MozReview-Commit-ID: Fb3KjsI9tE3
Attachment #8854008 - Flags: review?(cpearce)
Comment on attachment 8854008 [details] [diff] [review]
document use of WrapRunnable(this)

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

::: dom/media/gmp/GMPServiceParent.cpp
@@ +273,5 @@
>            MutexAutoLock lock(mMutex);
>            gmpThread = mGMPThread;
>          }
>          if (gmpThread) {
> +          gmpThread->Dispatch(WrapRunnable(RefPtr<GeckoMediaPluginServiceParent>(this),

I'd point out that the GeckoMediaPluginServiceParent singleton is kept alive by a static refptr that is only cleared in the final stage of shutdown after everything else is shutdown:
https://dxr.mozilla.org/mozilla-central/rev/38894655c89e68bcd8f45d31a0d3005f2c2b53db/dom/media/gmp/GMPService.cpp#123

So while I think the refcount here is a good idea for future-proofing the code, I think it's unlikely it will actually prevent any problems.
Attachment #8854008 - Flags: review?(cpearce) → review+
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/39f8ae0ea97f
document use of WrapRunnable(this) r=cpearce
https://hg.mozilla.org/mozilla-central/rev/39f8ae0ea97f
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.