Bug 1190608, part 3 - Remove some infallible new checks in nsXULElement.cpp. r=poiru

This commit is contained in:
Andrew McCreight 2015-08-04 13:06:14 -07:00
parent 3b702bcb21
commit 25941cb0f9

View File

@ -292,10 +292,6 @@ nsXULElement::Create(nsXULPrototypeElement* aPrototype,
nsRefPtr<nsXULElement> element = Create(aPrototype, nodeInfo, nsRefPtr<nsXULElement> element = Create(aPrototype, nodeInfo,
aIsScriptable, aIsRoot); aIsScriptable, aIsRoot);
if (!element) {
return NS_ERROR_OUT_OF_MEMORY;
}
element.forget(aResult); element.forget(aResult);
return NS_OK; return NS_OK;
@ -2343,8 +2339,6 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream,
switch (childType) { switch (childType) {
case eType_Element: case eType_Element:
child = new nsXULPrototypeElement(); child = new nsXULPrototypeElement();
if (! child)
return NS_ERROR_OUT_OF_MEMORY;
child->mType = childType; child->mType = childType;
tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI, tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI,
@ -2355,8 +2349,6 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream,
break; break;
case eType_Text: case eType_Text:
child = new nsXULPrototypeText(); child = new nsXULPrototypeText();
if (! child)
return NS_ERROR_OUT_OF_MEMORY;
child->mType = childType; child->mType = childType;
tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI, tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI,
@ -2367,8 +2359,6 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream,
break; break;
case eType_PI: case eType_PI:
child = new nsXULPrototypePI(); child = new nsXULPrototypePI();
if (! child)
return NS_ERROR_OUT_OF_MEMORY;
child->mType = childType; child->mType = childType;
tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI, tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI,
@ -2380,8 +2370,6 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream,
case eType_Script: { case eType_Script: {
// language version/options obtained during deserialization. // language version/options obtained during deserialization.
nsXULPrototypeScript* script = new nsXULPrototypeScript(0, 0); nsXULPrototypeScript* script = new nsXULPrototypeScript(0, 0);
if (! script)
return NS_ERROR_OUT_OF_MEMORY;
child = script; child = script;
child->mType = childType; child->mType = childType;