This commit is contained in:
Ryan VanderMeulen 2012-09-07 16:22:55 -04:00
Родитель 7253faa97c a84b8c80c8
Коммит 3f079a04ec
3 изменённых файлов: 29 добавлений и 32 удалений

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

@ -687,29 +687,21 @@ nsObjectLoadingContent::~nsObjectLoadingContent()
nsresult
nsObjectLoadingContent::InstantiatePluginInstance()
{
if (mInstanceOwner || mType != eType_Plugin || mIsLoading || mInstantiating) {
return NS_OK;
}
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent *>(this));
// Flush layout so that the frame is created if possible and the plugin is
// initialized with the latest information.
nsIDocument* doc = thisContent->GetCurrentDoc();
if (!doc || !InActiveDocument(thisContent)) {
NS_ERROR("Shouldn't be calling "
"InstantiatePluginInstance without an active document");
return NS_ERROR_FAILURE;
}
doc->FlushPendingNotifications(Flush_Layout);
if (!thisContent->GetPrimaryFrame()) {
LOG(("OBJLC [%p]: Not instantiating plugin with no frame", this));
if (mType != eType_Plugin || mIsLoading) {
LOG(("OBJLC [%p]: Not instantiating loading or non-plugin object, type %u",
this, mType));
return NS_OK;
}
// Don't do anything if we already have an active instance.
if (mInstanceOwner) {
return NS_OK;
}
// Don't allow re-entry into initialization code.
if (mInstantiating) {
return NS_OK;
}
mInstantiating = true;
AutoSetInstantiatingToFalse autoInstantiating(this);
@ -718,6 +710,20 @@ nsObjectLoadingContent::InstantiatePluginInstance()
// of this method.
nsCOMPtr<nsIObjectLoadingContent> kungFuDeathGrip = this;
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent *>(this));
// Flush layout so that the plugin is initialized with the latest information.
nsIDocument* doc = thisContent->GetCurrentDoc();
if (!doc) {
return NS_ERROR_FAILURE;
}
if (!InActiveDocument(thisContent)) {
NS_ERROR("Shouldn't be calling "
"InstantiatePluginInstance in an inactive document");
return NS_ERROR_FAILURE;
}
doc->FlushPendingNotifications(Flush_Layout);
nsresult rv = NS_ERROR_FAILURE;
nsRefPtr<nsPluginHost> pluginHost =
already_AddRefed<nsPluginHost>(nsPluginHost::GetInst());
@ -1723,14 +1729,6 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
oldType = mType;
oldState = ObjectState();
if (!thisContent->GetPrimaryFrame()) {
// We're un-rendered, and can't instantiate a plugin. HasNewFrame will
// re-start us when we can proceed.
LOG(("OBJLC [%p]: Aborting load - plugin-type, but no frame", this));
CloseChannel();
break;
}
rv = pluginHost->NewEmbeddedPluginStreamListener(mURI, this, nullptr,
getter_AddRefs(mFinalListener));
if (NS_SUCCEEDED(rv)) {

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

@ -3224,7 +3224,6 @@ nsresult nsPluginInstanceOwner::Init(nsIContent* aContent)
// document is destroyed before we try to create the new one.
objFrame->PresContext()->EnsureVisible();
} else {
NS_NOTREACHED("Should not be initializing plugin without a frame");
return NS_ERROR_FAILURE;
}

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

@ -65,10 +65,10 @@ class MarionetteTestResult(unittest._TextTestResult):
def printLogs(self, test):
for testcase in test._tests:
if hasattr(testcase, 'loglines') and testcase.loglines:
print 'START LOG:'
self.stream.writeln('START LOG:')
for line in testcase.loglines:
print ' '.join(line)
print 'END LOG:'
self.stream.writeln(' '.join(line))
self.stream.writeln('END LOG:')
def getPerfData(self, test):
for testcase in test._tests: