зеркало из https://github.com/mozilla/gecko-dev.git
more changes for #102037. use GetValueConst() instead of GetValue() where possible to avoid
strdups(). r=waterson, sr=bienvenu
This commit is contained in:
Родитель
966d323ac2
Коммит
e147b1a4a9
|
@ -1413,8 +1413,8 @@ NS_IMETHODIMP nsChromeRegistry::UpdateDynamicDataSource(nsIRDFDataSource *aDataS
|
|||
rv = arcs->HasMoreElements(&moreElements);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsXPIDLCString value;
|
||||
rv = aResource->GetValue(getter_Copies(value));
|
||||
const char *value;
|
||||
rv = aResource->GetValueConst(&value);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
while (moreElements)
|
||||
|
@ -1431,7 +1431,7 @@ NS_IMETHODIMP nsChromeRegistry::UpdateDynamicDataSource(nsIRDFDataSource *aDataS
|
|||
rv = literal->GetValueConst(&valueStr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = WriteInfoToDataSource((const char*)value, valueStr, aIsOverlay, aUseProfile, aRemove);
|
||||
rv = WriteInfoToDataSource(value, valueStr, aIsOverlay, aUseProfile, aRemove);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
rv = arcs->HasMoreElements(&moreElements);
|
||||
|
|
|
@ -643,8 +643,8 @@ nsRDFXMLSerializer::SerializeMember(nsIOutputStream* aStream,
|
|||
nsCOMPtr<nsIRDFLiteral> literal;
|
||||
|
||||
if ((resource = do_QueryInterface(aMember)) != nsnull) {
|
||||
nsXPIDLCString s;
|
||||
if (NS_SUCCEEDED(rv = resource->GetValue( getter_Copies(s) ))) {
|
||||
const char *s;
|
||||
if (NS_SUCCEEDED(rv = resource->GetValueConst(&s))) {
|
||||
static const char kRDFLIResource1[] = " <RDF:li resource=\"";
|
||||
static const char kRDFLIResource2[] = "\"/>\n";
|
||||
|
||||
|
@ -658,8 +658,8 @@ static const char kRDFLIResource2[] = "\"/>\n";
|
|||
}
|
||||
}
|
||||
else if ((literal = do_QueryInterface(aMember)) != nsnull) {
|
||||
nsXPIDLString value;
|
||||
if (NS_SUCCEEDED(rv = literal->GetValue( getter_Copies(value) ))) {
|
||||
const PRUnichar *value;
|
||||
if (NS_SUCCEEDED(rv = literal->GetValueConst(&value))) {
|
||||
static const char kRDFLILiteral1[] = " <RDF:li>";
|
||||
static const char kRDFLILiteral2[] = "</RDF:li>\n";
|
||||
|
||||
|
|
|
@ -1413,8 +1413,8 @@ NS_IMETHODIMP nsChromeRegistry::UpdateDynamicDataSource(nsIRDFDataSource *aDataS
|
|||
rv = arcs->HasMoreElements(&moreElements);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsXPIDLCString value;
|
||||
rv = aResource->GetValue(getter_Copies(value));
|
||||
const char *value;
|
||||
rv = aResource->GetValueConst(&value);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
while (moreElements)
|
||||
|
@ -1431,7 +1431,7 @@ NS_IMETHODIMP nsChromeRegistry::UpdateDynamicDataSource(nsIRDFDataSource *aDataS
|
|||
rv = literal->GetValueConst(&valueStr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = WriteInfoToDataSource((const char*)value, valueStr, aIsOverlay, aUseProfile, aRemove);
|
||||
rv = WriteInfoToDataSource(value, valueStr, aIsOverlay, aUseProfile, aRemove);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
rv = arcs->HasMoreElements(&moreElements);
|
||||
|
|
Загрузка…
Ссылка в новой задаче