зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1295352 - Release MediaEngineTabVideoSource main-thread-only members on main thread. r=jesup
MozReview-Commit-ID: H3N70b9tGiI --HG-- extra : rebase_source : e8dd9562fcf0cfe3d37987947ab85f0ac1ef66a3 extra : intermediate-source : 57f7b75e5a6210ba05e58cb6a117151e1d25f29e extra : source : 5a2bbbf8ce4b6afc4e3649ce9ca5786aac4b5336
This commit is contained in:
Родитель
aafd1d4711
Коммит
24b498b985
|
@ -119,6 +119,17 @@ MediaEngineTabVideoSource::InitRunnable::Run()
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
MediaEngineTabVideoSource::DestroyRunnable::Run()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
|
mVideoSource->mWindow = nullptr;
|
||||||
|
mVideoSource->mTabSource = nullptr;
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MediaEngineTabVideoSource::GetName(nsAString_internal& aName) const
|
MediaEngineTabVideoSource::GetName(nsAString_internal& aName) const
|
||||||
{
|
{
|
||||||
|
@ -193,6 +204,8 @@ nsresult
|
||||||
MediaEngineTabVideoSource::Deallocate(AllocationHandle* aHandle)
|
MediaEngineTabVideoSource::Deallocate(AllocationHandle* aHandle)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!aHandle);
|
MOZ_ASSERT(!aHandle);
|
||||||
|
NS_DispatchToMainThread(do_AddRef(new DestroyRunnable(this)));
|
||||||
|
|
||||||
{
|
{
|
||||||
MonitorAutoLock mon(mMonitor);
|
MonitorAutoLock mon(mMonitor);
|
||||||
mState = kReleased;
|
mState = kReleased;
|
||||||
|
|
|
@ -81,6 +81,13 @@ class MediaEngineTabVideoSource : public MediaEngineVideoSource, nsIDOMEventList
|
||||||
RefPtr<MediaEngineTabVideoSource> mVideoSource;
|
RefPtr<MediaEngineTabVideoSource> mVideoSource;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DestroyRunnable : public Runnable {
|
||||||
|
public:
|
||||||
|
explicit DestroyRunnable(MediaEngineTabVideoSource* videoSource) : mVideoSource(videoSource) {}
|
||||||
|
NS_IMETHOD Run();
|
||||||
|
RefPtr<MediaEngineTabVideoSource> mVideoSource;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~MediaEngineTabVideoSource() {}
|
~MediaEngineTabVideoSource() {}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче