Bug 1353030: document use of WrapRunnable(this) r=cpearce

MozReview-Commit-ID: Fb3KjsI9tE3
This commit is contained in:
Randell Jesup 2017-06-02 16:36:34 -04:00
Родитель edcbb1bc88
Коммит ae21d19935
4 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -273,7 +273,11 @@ GeckoMediaPluginServiceParent::Observe(nsISupports* aSubject,
gmpThread = mGMPThread;
}
if (gmpThread) {
gmpThread->Dispatch(WrapRunnable(this,
// Note: 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, so this RefPtr<> is not
// strictly necessary so long as that is true, but it's safer.
gmpThread->Dispatch(WrapRunnable(RefPtr<GeckoMediaPluginServiceParent>(this),
&GeckoMediaPluginServiceParent::CrashPlugins),
NS_DISPATCH_NORMAL);
}

Просмотреть файл

@ -309,6 +309,7 @@ WebrtcGmpVideoEncoder::Encode(const webrtc::VideoFrame& aInputImage,
MOZ_ASSERT(aInputImage.width() >= 0 && aInputImage.height() >= 0);
// Would be really nice to avoid this sync dispatch, but it would require a
// copy of the frame, since it doesn't appear to actually have a refcount.
// Passing 'this' is safe since this is synchronous.
mGMPThread->Dispatch(
WrapRunnable(this,
&WebrtcGmpVideoEncoder::Encode_g,
@ -776,6 +777,7 @@ WebrtcGmpVideoDecoder::Decode(const webrtc::EncodedImage& aInputImage,
MOZ_ASSERT(!NS_IsMainThread());
// Would be really nice to avoid this sync dispatch, but it would require a
// copy of the frame, since it doesn't appear to actually have a refcount.
// Passing 'this' is safe since this is synchronous.
mozilla::SyncRunnable::DispatchToThread(mGMPThread,
WrapRunnableRet(&ret, this,
&WebrtcGmpVideoDecoder::Decode_g,

Просмотреть файл

@ -1137,6 +1137,7 @@ PeerConnectionMedia::ShutdownMediaTransport_s()
mIceCtxHdlr = nullptr;
// we're holding a ref to 'this' that's released by SelfDestruct_m
mMainThread->Dispatch(WrapRunnable(this, &PeerConnectionMedia::SelfDestruct_m),
NS_DISPATCH_NORMAL);
}

Просмотреть файл

@ -873,6 +873,8 @@ WebrtcGlobalChild::RecvGetLogRequest(const int& aRequestId,
do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv) && stsThread) {
// this is a singleton, so we shouldn't need to hold a ref for the
// request (and can't just add a ref here anyways)
rv = RUN_ON_THREAD(stsThread,
WrapRunnableNM(&GetLogging_s, this, aRequestId, aPattern.get()),
NS_DISPATCH_NORMAL);