зеркало из https://github.com/mozilla/pjs.git
Ongoing fix for bug 81446. r=peter lubcynzski. sr=jst. a=asa. Fixes leaks of PARAM elements which now get destroyed when the document goes away. This fix ddoes away with 394206 bytes of leaks described in bugs 129423, 129424, 129425, 129429. We still leak memory across reloads of the same page so bug 81446 is being left open.
This commit is contained in:
Родитель
f500f24a80
Коммит
5e2562e44e
|
@ -2955,29 +2955,26 @@ 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<nsISupports> sup = ourParams->ElementAt(idx);
|
nsCOMPtr<nsIDOMElement> param = do_QueryElementAt(ourParams, idx);
|
||||||
if (sup) {
|
if (param) {
|
||||||
nsCOMPtr<nsIDOMElement> param = do_QueryInterface(sup);
|
nsAutoString name;
|
||||||
if (param) {
|
nsAutoString value;
|
||||||
nsAutoString name;
|
param->GetAttribute(NS_LITERAL_STRING("name"), name); // check for empty done above
|
||||||
nsAutoString value;
|
param->GetAttribute(NS_LITERAL_STRING("value"), value);
|
||||||
param->GetAttribute(NS_LITERAL_STRING("name"), name); // check for empty done above
|
/*
|
||||||
param->GetAttribute(NS_LITERAL_STRING("value"), value);
|
* According to the HTML 4.01 spec, at
|
||||||
/*
|
* http://www.w3.org/TR/html4/types.html#type-cdata
|
||||||
* According to the HTML 4.01 spec, at
|
* ''User agents may ignore leading and trailing
|
||||||
* http://www.w3.org/TR/html4/types.html#type-cdata
|
* white space in CDATA attribute values (e.g., "
|
||||||
* ''User agents may ignore leading and trailing
|
* myval " may be interpreted as "myval"). Authors
|
||||||
* white space in CDATA attribute values (e.g., "
|
* should not declare attribute values with
|
||||||
* myval " may be interpreted as "myval"). Authors
|
* leading or trailing white space.''
|
||||||
* should not declare attribute values with
|
*/
|
||||||
* leading or trailing white space.''
|
name.CompressWhitespace(); // XXX right function?
|
||||||
*/
|
value.CompressWhitespace();
|
||||||
name.CompressWhitespace(); // XXX right function?
|
mCachedAttrParamNames [mNumCachedAttrs + 1 + c] = ToNewUTF8String(name);
|
||||||
value.CompressWhitespace();
|
mCachedAttrParamValues[mNumCachedAttrs + 1 + c] = ToNewUTF8String(value);
|
||||||
mCachedAttrParamNames [mNumCachedAttrs + 1 + c] = ToNewUTF8String(name);
|
c++; // rules!
|
||||||
mCachedAttrParamValues[mNumCachedAttrs + 1 + c] = ToNewUTF8String(value);
|
|
||||||
c++; // rules!
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2955,29 +2955,26 @@ 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<nsISupports> sup = ourParams->ElementAt(idx);
|
nsCOMPtr<nsIDOMElement> param = do_QueryElementAt(ourParams, idx);
|
||||||
if (sup) {
|
if (param) {
|
||||||
nsCOMPtr<nsIDOMElement> param = do_QueryInterface(sup);
|
nsAutoString name;
|
||||||
if (param) {
|
nsAutoString value;
|
||||||
nsAutoString name;
|
param->GetAttribute(NS_LITERAL_STRING("name"), name); // check for empty done above
|
||||||
nsAutoString value;
|
param->GetAttribute(NS_LITERAL_STRING("value"), value);
|
||||||
param->GetAttribute(NS_LITERAL_STRING("name"), name); // check for empty done above
|
/*
|
||||||
param->GetAttribute(NS_LITERAL_STRING("value"), value);
|
* According to the HTML 4.01 spec, at
|
||||||
/*
|
* http://www.w3.org/TR/html4/types.html#type-cdata
|
||||||
* According to the HTML 4.01 spec, at
|
* ''User agents may ignore leading and trailing
|
||||||
* http://www.w3.org/TR/html4/types.html#type-cdata
|
* white space in CDATA attribute values (e.g., "
|
||||||
* ''User agents may ignore leading and trailing
|
* myval " may be interpreted as "myval"). Authors
|
||||||
* white space in CDATA attribute values (e.g., "
|
* should not declare attribute values with
|
||||||
* myval " may be interpreted as "myval"). Authors
|
* leading or trailing white space.''
|
||||||
* should not declare attribute values with
|
*/
|
||||||
* leading or trailing white space.''
|
name.CompressWhitespace(); // XXX right function?
|
||||||
*/
|
value.CompressWhitespace();
|
||||||
name.CompressWhitespace(); // XXX right function?
|
mCachedAttrParamNames [mNumCachedAttrs + 1 + c] = ToNewUTF8String(name);
|
||||||
value.CompressWhitespace();
|
mCachedAttrParamValues[mNumCachedAttrs + 1 + c] = ToNewUTF8String(value);
|
||||||
mCachedAttrParamNames [mNumCachedAttrs + 1 + c] = ToNewUTF8String(name);
|
c++; // rules!
|
||||||
mCachedAttrParamValues[mNumCachedAttrs + 1 + c] = ToNewUTF8String(value);
|
|
||||||
c++; // rules!
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче