зеркало из https://github.com/mozilla/gecko-dev.git
Fixing GetParameters() back to the way it was, returning success for zero parameters bug 114973 r=av sr=beard a=brendan
This commit is contained in:
Родитель
8cc88b14f8
Коммит
f96915bc51
|
@ -2419,13 +2419,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetParameters(PRUint16& n, const char*const
|
|||
nsresult rv = EnsureCachedAttrParamArrays();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// make sure we have at least one param tag because embed's don't have any
|
||||
if (!mNumCachedParams)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
n = mNumCachedParams;
|
||||
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
|
||||
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
|
||||
if (n) {
|
||||
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
|
||||
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
|
||||
} else
|
||||
names = values = nsnull;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -2419,13 +2419,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetParameters(PRUint16& n, const char*const
|
|||
nsresult rv = EnsureCachedAttrParamArrays();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// make sure we have at least one param tag because embed's don't have any
|
||||
if (!mNumCachedParams)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
n = mNumCachedParams;
|
||||
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
|
||||
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
|
||||
if (n) {
|
||||
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
|
||||
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
|
||||
} else
|
||||
names = values = nsnull;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -823,7 +823,8 @@ nsresult ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer* peer)
|
|||
const char* const* pvalues = nsnull;
|
||||
if (NS_SUCCEEDED(taginfo->GetParameters(pcount, pnames, pvalues))) {
|
||||
NS_ASSERTION(nsnull == values[count], "attribute/parameter array not setup correctly for 4.x plugins");
|
||||
count += ++pcount; //if it's all setup correctly, then all we need is to change the count
|
||||
if (pcount)
|
||||
count += ++pcount; //if it's all setup correctly, then all we need is to change the count (attrs + PARAM/blank + params)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче