Bug 1236380 - GMPStorage::mShutdown=true until Init() succeeds - r=cpearce

Initialize GMPStorage::mShutdown to true, so that if Init() has not completed
yet or if it failed, other methods will not try and access a null mStorage.
This commit is contained in:
Gerald Squelart 2016-01-07 08:06:47 +11:00
Родитель 99e46fd0e0
Коммит 74d744c943
2 изменённых файлов: 3 добавлений и 1 удалений

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

@ -568,7 +568,7 @@ GMPStorageParent::GMPStorageParent(const nsCString& aNodeId,
GMPParent* aPlugin) GMPParent* aPlugin)
: mNodeId(aNodeId) : mNodeId(aNodeId)
, mPlugin(aPlugin) , mPlugin(aPlugin)
, mShutdown(false) , mShutdown(true)
{ {
} }
@ -602,6 +602,7 @@ GMPStorageParent::Init()
mStorage = MakeUnique<GMPMemoryStorage>(); mStorage = MakeUnique<GMPMemoryStorage>();
} }
mShutdown = false;
return NS_OK; return NS_OK;
} }

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

@ -54,6 +54,7 @@ private:
const nsCString mNodeId; const nsCString mNodeId;
RefPtr<GMPParent> mPlugin; RefPtr<GMPParent> mPlugin;
// True after Shutdown(), or if Init() has not completed successfully.
bool mShutdown; bool mShutdown;
}; };