mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-01 11:27:55 +00:00
Moved code which was initalizing the memory allocation service from the constructor into the CreatePlugin function because it wasn't being called early enough for some plugins. Need to proceed on Bug 19931. r=av.
This commit is contained in:
parent
23b031d8d8
commit
9c230e7301
@ -112,18 +112,12 @@ static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
|
||||
|
||||
ns4xPlugin::ns4xPlugin(NPPluginFuncs* callbacks, NP_PLUGINSHUTDOWN aShutdown, nsIServiceManager* serviceMgr)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
memcpy((void*) &fCallbacks, (void*) callbacks, sizeof(fCallbacks));
|
||||
fShutdownEntry = aShutdown;
|
||||
memcpy((void*) &fCallbacks, (void*) callbacks, sizeof(fCallbacks));
|
||||
fShutdownEntry = aShutdown;
|
||||
|
||||
mServiceMgr = serviceMgr;
|
||||
|
||||
if(serviceMgr != nsnull)
|
||||
{
|
||||
if (nsnull == mMalloc)
|
||||
serviceMgr->GetService(kMemoryCID, kIMemoryIID, (nsISupports**)&mMalloc);
|
||||
}
|
||||
mServiceMgr = serviceMgr;
|
||||
}
|
||||
|
||||
|
||||
@ -195,7 +189,13 @@ nsresult
|
||||
ns4xPlugin::CreatePlugin(nsPluginTag* pluginTag, nsIServiceManager* serviceMgr)
|
||||
{
|
||||
CheckClassInitialized();
|
||||
|
||||
|
||||
// set up the MemAllocator service now because it might be used by the plugin
|
||||
if (serviceMgr != nsnull) {
|
||||
if (nsnull == mMalloc)
|
||||
serviceMgr->GetService(kMemoryCID, kIMemoryIID, (nsISupports**)&mMalloc);
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
printf("debug: edburns ns4xPlugin::CreatePlugin\n");
|
||||
#endif
|
||||
|
@ -112,18 +112,12 @@ static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
|
||||
|
||||
ns4xPlugin::ns4xPlugin(NPPluginFuncs* callbacks, NP_PLUGINSHUTDOWN aShutdown, nsIServiceManager* serviceMgr)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
memcpy((void*) &fCallbacks, (void*) callbacks, sizeof(fCallbacks));
|
||||
fShutdownEntry = aShutdown;
|
||||
memcpy((void*) &fCallbacks, (void*) callbacks, sizeof(fCallbacks));
|
||||
fShutdownEntry = aShutdown;
|
||||
|
||||
mServiceMgr = serviceMgr;
|
||||
|
||||
if(serviceMgr != nsnull)
|
||||
{
|
||||
if (nsnull == mMalloc)
|
||||
serviceMgr->GetService(kMemoryCID, kIMemoryIID, (nsISupports**)&mMalloc);
|
||||
}
|
||||
mServiceMgr = serviceMgr;
|
||||
}
|
||||
|
||||
|
||||
@ -195,7 +189,13 @@ nsresult
|
||||
ns4xPlugin::CreatePlugin(nsPluginTag* pluginTag, nsIServiceManager* serviceMgr)
|
||||
{
|
||||
CheckClassInitialized();
|
||||
|
||||
|
||||
// set up the MemAllocator service now because it might be used by the plugin
|
||||
if (serviceMgr != nsnull) {
|
||||
if (nsnull == mMalloc)
|
||||
serviceMgr->GetService(kMemoryCID, kIMemoryIID, (nsISupports**)&mMalloc);
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
printf("debug: edburns ns4xPlugin::CreatePlugin\n");
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user