Bug 1185392 - Use a separate mutex to protect mAsyncShutdownPluginStatesMutex, as mMutex could already be held when trying to update the states. r=cpearce

This commit is contained in:
Gerald Squelart 2015-07-19 17:42:00 +02:00
parent e43fb0894e
commit b27c22869f
2 changed files with 6 additions and 1 deletions

View File

@ -83,6 +83,9 @@ static bool sHaveSetTimeoutPrefCache = false;
GeckoMediaPluginServiceParent::GeckoMediaPluginServiceParent()
: mShuttingDown(false)
#ifdef MOZ_CRASHREPORTER
, mAsyncShutdownPluginStatesMutex("GeckoMediaPluginService::mAsyncShutdownPluginStatesMutex")
#endif
, mScannedPluginOnDisk(false)
, mWaitingForPluginsSyncShutdown(false)
{
@ -402,7 +405,7 @@ GeckoMediaPluginServiceParent::SetAsyncShutdownPluginState(GMPParent* aGMPParent
char aId,
const nsCString& aState)
{
MutexAutoLock lock(mMutex);
MutexAutoLock lock(mAsyncShutdownPluginStatesMutex);
mAsyncShutdownPluginStates.Update(aGMPParent->GetDisplayName(),
nsPrintfCString("%p", aGMPParent),
aId,

View File

@ -142,7 +142,9 @@ private:
nsTArray<nsRefPtr<GMPParent>> mPlugins;
bool mShuttingDown;
nsTArray<nsRefPtr<GMPParent>> mAsyncShutdownPlugins;
#ifdef MOZ_CRASHREPORTER
Mutex mAsyncShutdownPluginStatesMutex; // Protects mAsyncShutdownPluginStates.
class AsyncShutdownPluginStates
{
public: