mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-11 14:28:42 +00:00
Bug 889614 - Fix regression in plugin reparenting. r=josh
This commit is contained in:
parent
ece7cc6e8c
commit
42e406f74f
@ -133,7 +133,7 @@ nsAsyncInstantiateEvent::Run()
|
|||||||
static_cast<nsObjectLoadingContent *>(mContent.get());
|
static_cast<nsObjectLoadingContent *>(mContent.get());
|
||||||
|
|
||||||
// If objLC is no longer tracking this event, we've been canceled or
|
// If objLC is no longer tracking this event, we've been canceled or
|
||||||
// superceded
|
// superseded
|
||||||
if (objLC->mPendingInstantiateEvent != this) {
|
if (objLC->mPendingInstantiateEvent != this) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -166,11 +166,11 @@ CheckPluginStopEvent::Run()
|
|||||||
static_cast<nsObjectLoadingContent *>(mContent.get());
|
static_cast<nsObjectLoadingContent *>(mContent.get());
|
||||||
|
|
||||||
// If objLC is no longer tracking this event, we've been canceled or
|
// If objLC is no longer tracking this event, we've been canceled or
|
||||||
// superceded
|
// superseded. We clear this before we finish - either by calling
|
||||||
|
// UnloadObject/StopPluginInstance, or directly if we took no action.
|
||||||
if (objLC->mPendingCheckPluginStopEvent != this) {
|
if (objLC->mPendingCheckPluginStopEvent != this) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
objLC->mPendingCheckPluginStopEvent = nullptr;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> content =
|
nsCOMPtr<nsIContent> content =
|
||||||
do_QueryInterface(static_cast<nsIImageLoadingContent *>(objLC));
|
do_QueryInterface(static_cast<nsIImageLoadingContent *>(objLC));
|
||||||
@ -182,12 +182,26 @@ CheckPluginStopEvent::Run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!content->GetPrimaryFrame()) {
|
if (!content->GetPrimaryFrame()) {
|
||||||
|
LOG(("OBJLC [%p]: CheckPluginStopEvent - No frame, flushing layout", this));
|
||||||
|
nsIDocument* currentDoc = content->GetCurrentDoc();
|
||||||
|
if (currentDoc) {
|
||||||
|
currentDoc->FlushPendingNotifications(Flush_Layout);
|
||||||
|
if (objLC->mPendingCheckPluginStopEvent != this ||
|
||||||
|
content->GetPrimaryFrame()) {
|
||||||
|
LOG(("OBJLC [%p]: Event superseded or frame gained during layout flush",
|
||||||
|
this));
|
||||||
|
objLC->mPendingCheckPluginStopEvent = nullptr;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Still no frame, suspend plugin. HasNewFrame will restart us when we
|
// Still no frame, suspend plugin. HasNewFrame will restart us when we
|
||||||
// become rendered again
|
// become rendered again
|
||||||
LOG(("OBJLC [%p]: Stopping plugin that lost frame", this));
|
LOG(("OBJLC [%p]: Stopping plugin that lost frame", this));
|
||||||
// Okay to leave loaded as a plugin, but stop the unrendered instance
|
// Okay to leave loaded as a plugin, but stop the unrendered instance
|
||||||
objLC->StopPluginInstance();
|
objLC->StopPluginInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
objLC->mPendingCheckPluginStopEvent = nullptr;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -890,7 +904,6 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
|
|||||||
return NS_BINDING_ABORTED;
|
return NS_BINDING_ABORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(!mChannelLoaded, "mChannelLoaded set already?");
|
|
||||||
// If we already switched to type plugin, this channel can just be passed to
|
// If we already switched to type plugin, this channel can just be passed to
|
||||||
// the final listener.
|
// the final listener.
|
||||||
if (mType == eType_Plugin) {
|
if (mType == eType_Plugin) {
|
||||||
@ -912,6 +925,7 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
|
|||||||
NS_NOTREACHED("Should be type loading at this point");
|
NS_NOTREACHED("Should be type loading at this point");
|
||||||
return NS_BINDING_ABORTED;
|
return NS_BINDING_ABORTED;
|
||||||
}
|
}
|
||||||
|
NS_ASSERTION(!mChannelLoaded, "mChannelLoaded set already?");
|
||||||
NS_ASSERTION(!mFinalListener, "mFinalListener exists already?");
|
NS_ASSERTION(!mFinalListener, "mFinalListener exists already?");
|
||||||
|
|
||||||
mChannelLoaded = true;
|
mChannelLoaded = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user