зеркало из https://github.com/mozilla/pjs.git
Bug 325507 - Replace nsISupportsArray with nsCOMArray in nsPluginInstanceOwner::EnsureCachedAttrParamArrays. r+sr=bzbarsky
This commit is contained in:
Родитель
3351614fa1
Коммит
e8f78e1a90
|
@ -60,7 +60,6 @@
|
||||||
#include "nsIURL.h"
|
#include "nsIURL.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsIPluginInstanceOwner.h"
|
#include "nsIPluginInstanceOwner.h"
|
||||||
#include "nsISupportsArray.h"
|
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "nsILinkHandler.h"
|
#include "nsILinkHandler.h"
|
||||||
#ifdef OJI
|
#ifdef OJI
|
||||||
|
@ -2289,13 +2288,11 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
|
||||||
// to only round up the param tags that coorespond with THIS
|
// to only round up the param tags that coorespond with THIS
|
||||||
// instance. And also, weed out any bogus tags that may get in the
|
// instance. And also, weed out any bogus tags that may get in the
|
||||||
// way, see bug 39609. Then, with any param tag that meet our
|
// way, see bug 39609. Then, with any param tag that meet our
|
||||||
// qualification, temporarly cache them in an nsISupportsArray until
|
// qualification, temporarly cache them in an nsCOMArray until
|
||||||
// we can figure out what size to make our fixed char* array.
|
// we can figure out what size to make our fixed char* array.
|
||||||
|
|
||||||
mNumCachedParams = 0;
|
mNumCachedParams = 0;
|
||||||
nsCOMPtr<nsISupportsArray> ourParams;
|
nsCOMArray<nsIDOMElement> ourParams;
|
||||||
nsresult rv = NS_NewISupportsArray(getter_AddRefs(ourParams));
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
|
|
||||||
// use the DOM to get us ALL our dependent PARAM tags, even if not
|
// use the DOM to get us ALL our dependent PARAM tags, even if not
|
||||||
// ours
|
// ours
|
||||||
|
@ -2368,7 +2365,7 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMNode> mydomNode = do_QueryInterface(mydomElement);
|
nsCOMPtr<nsIDOMNode> mydomNode = do_QueryInterface(mydomElement);
|
||||||
if (parent == mydomNode) {
|
if (parent == mydomNode) {
|
||||||
ourParams->AppendElement(pnode);
|
ourParams.AppendObject(domelement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2379,8 +2376,7 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
|
||||||
// We're done with DOM method calls now; make sure we still have a frame.
|
// We're done with DOM method calls now; make sure we still have a frame.
|
||||||
NS_ENSURE_TRUE(mOwner, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(mOwner, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
PRUint32 cparams;
|
PRUint32 cparams = ourParams.Count(); // unsigned 32 bits to unsigned 16 bits conversion
|
||||||
ourParams->Count(&cparams); // unsigned 32 bits to unsigned 16 bits conversion
|
|
||||||
if (cparams < 0x0000FFFF)
|
if (cparams < 0x0000FFFF)
|
||||||
mNumCachedParams = NS_STATIC_CAST(PRUint16, cparams);
|
mNumCachedParams = NS_STATIC_CAST(PRUint16, cparams);
|
||||||
else
|
else
|
||||||
|
@ -2455,7 +2451,7 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
|
||||||
// now fill in the PARAM name/value pairs from the cached DOM nodes
|
// now fill in the PARAM name/value pairs from the cached DOM nodes
|
||||||
c = 0;
|
c = 0;
|
||||||
for (PRInt16 idx = 0; idx < mNumCachedParams; idx++) {
|
for (PRInt16 idx = 0; idx < mNumCachedParams; idx++) {
|
||||||
nsCOMPtr<nsIDOMElement> param = do_QueryElementAt(ourParams, idx);
|
nsIDOMElement* param = ourParams.ObjectAt(idx);
|
||||||
if (param) {
|
if (param) {
|
||||||
nsAutoString name;
|
nsAutoString name;
|
||||||
nsAutoString value;
|
nsAutoString value;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче