Bug 1190608, part 3 - Remove some infallible new checks in nsXULElement.cpp. r=poiru
authorAndrew McCreight <continuation@gmail.com>
Tue, 04 Aug 2015 13:06:14 -0700
changeset 287849 f1579da7f21e0e2fa602061092d2f82ecc3a7dcc
parent 287848 99a5c0692c09f351c949f2fe6b0d30dc80dac8b6
child 287850 93bc28d6facd9abd380159b511eb6bd2567b73bb
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspoiru
bugs1190608
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1190608, part 3 - Remove some infallible new checks in nsXULElement.cpp. r=poiru
dom/xul/nsXULElement.cpp
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -287,20 +287,16 @@ nsXULElement::Create(nsXULPrototypeEleme
           GetNodeInfo(ni->NameAtom(), ni->GetPrefixAtom(), ni->NamespaceID(),
                       nsIDOMNode::ELEMENT_NODE);
     } else {
         nodeInfo = aPrototype->mNodeInfo;
     }
 
     nsRefPtr<nsXULElement> element = Create(aPrototype, nodeInfo,
                                             aIsScriptable, aIsRoot);
-    if (!element) {
-        return NS_ERROR_OUT_OF_MEMORY;
-    }
-
     element.forget(aResult);
 
     return NS_OK;
 }
 
 nsresult
 NS_NewXULElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
 {
@@ -2338,55 +2334,47 @@ nsXULPrototypeElement::Deserialize(nsIOb
             }
             Type childType = (Type)number;
 
             nsRefPtr<nsXULPrototypeNode> child;
 
             switch (childType) {
             case eType_Element:
                 child = new nsXULPrototypeElement();
-                if (! child)
-                    return NS_ERROR_OUT_OF_MEMORY;
                 child->mType = childType;
 
                 tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI,
                                          aNodeInfos);
                 if (NS_FAILED(tmp)) {
                   rv = tmp;
                 }
                 break;
             case eType_Text:
                 child = new nsXULPrototypeText();
-                if (! child)
-                    return NS_ERROR_OUT_OF_MEMORY;
                 child->mType = childType;
 
                 tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI,
                                          aNodeInfos);
                 if (NS_FAILED(tmp)) {
                   rv = tmp;
                 }
                 break;
             case eType_PI:
                 child = new nsXULPrototypePI();
-                if (! child)
-                    return NS_ERROR_OUT_OF_MEMORY;
                 child->mType = childType;
 
                 tmp = child->Deserialize(aStream, aProtoDoc, aDocumentURI,
                                          aNodeInfos);
                 if (NS_FAILED(tmp)) {
                   rv = tmp;
                 }
                 break;
             case eType_Script: {
                 // language version/options obtained during deserialization.
                 nsXULPrototypeScript* script = new nsXULPrototypeScript(0, 0);
-                if (! script)
-                    return NS_ERROR_OUT_OF_MEMORY;
                 child = script;
                 child->mType = childType;
 
                 tmp = aStream->ReadBoolean(&script->mOutOfLine);
                 if (NS_FAILED(tmp)) {
                   rv = tmp;
                 }
                 if (! script->mOutOfLine) {