Fixing bug 438830. Prevent instantiation of a plugin if it's already been instantiated. r+sr=jonas@sicking.cc

This commit is contained in:
Johnny Stenback 2008-06-27 12:54:27 -07:00
Родитель 3541ec9b61
Коммит c7ccc0b721
2 изменённых файлов: 20 добавлений и 8 удалений

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

@ -762,15 +762,27 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
{
LOG(("OBJLC [%p]: Got frame %p (mInstantiating=%i)\n", this, aFrame,
mInstantiating));
if (!mInstantiating && aFrame && mType == eType_Plugin) {
// "revoke" any existing instantiate event as it likely has out of
// date data (frame pointer etc).
mPendingInstantiateEvent = nsnull;
nsCOMPtr<nsIPluginInstance> instance;
aFrame->GetPluginInstance(*getter_AddRefs(instance));
if (instance) {
// The frame already has a plugin instance, that means the plugin
// has already been instantiated.
return NS_OK;
}
if (!mInstantiating && mType == eType_Plugin) {
// Asynchronously call Instantiate
// This can go away once plugin loading moves to content
// This must be done asynchronously to ensure that the frame is correctly
// initialized (has a view etc)
// "revoke" any existing instantiate event.
mPendingInstantiateEvent = nsnull;
// When in a plugin document, the document will take care of calling
// instantiate
nsCOMPtr<nsIPluginDocument> pDoc (do_QueryInterface(GetOurDocument()));

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

@ -54,10 +54,10 @@
#include "nsIRunnable.h"
#include "nsIChannelClassifier.h"
struct nsAsyncInstantiateEvent;
class AutoNotifier;
class AutoFallback;
class AutoSetInstantiatingToFalse;
class nsAsyncInstantiateEvent;
class AutoNotifier;
class AutoFallback;
class AutoSetInstantiatingToFalse;
/**
* INVARIANTS OF THIS CLASS