Bug 1302758 Part 3 - Remove nullptr check of operator new in CreateFloatManager. r=dholbert
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 15 Sep 2016 23:29:57 +0800
changeset 355436 1eb767946c2e3a07e7a4632966f5617f6c25dcd4
parent 355435 3b8d624b89da61815cf87ad738c8a9f1619ba120
child 355437 7d7558864a662be6535d4a52054b6dc0bf9c5fc7
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1302758
milestone51.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 1302758 Part 3 - Remove nullptr check of operator new in CreateFloatManager. r=dholbert The operator new is infallable. Also change the return value to void accordingly. The only caller doesn't even check the return value. MozReview-Commit-ID: 3whf7s1d35q
layout/generic/nsFloatManager.cpp
layout/generic/nsFloatManager.h
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -576,31 +576,28 @@ nsAutoFloatManager::~nsAutoFloatManager(
       }
     }
 #endif
 
     delete mNew;
   }
 }
 
-nsresult
+void
 nsAutoFloatManager::CreateFloatManager(nsPresContext *aPresContext)
 {
   // Create a new float manager and install it in the reflow
   // input. `Remember' the old float manager so we can restore it
   // later.
   mNew = new nsFloatManager(aPresContext->PresShell(),
                             mReflowInput.GetWritingMode());
-  if (! mNew)
-    return NS_ERROR_OUT_OF_MEMORY;
 
 #ifdef DEBUG
   if (nsBlockFrame::gNoisyFloatManager) {
     printf("constructed new float manager %p (replacing %p)\n",
            mNew, mReflowInput.mFloatManager);
   }
 #endif
 
   // Set the float manager in the existing reflow input.
   mOld = mReflowInput.mFloatManager;
   mReflowInput.mFloatManager = mNew;
-  return NS_OK;
 }
--- a/layout/generic/nsFloatManager.h
+++ b/layout/generic/nsFloatManager.h
@@ -383,17 +383,17 @@ public:
 
   ~nsAutoFloatManager();
 
   /**
    * Create a new float manager for the specified frame. This will
    * `remember' the old float manager, and install the new float
    * manager in the reflow input.
    */
-  nsresult
+  void
   CreateFloatManager(nsPresContext *aPresContext);
 
 protected:
   ReflowInput &mReflowInput;
   nsFloatManager *mNew;
   nsFloatManager *mOld;
 };