Bug 660657 - Make nsCSSRendering::Init return void; r=roc
authorMs2ger <ms2ger@gmail.com>
Thu, 02 Jun 2011 14:56:46 +0200
changeset 70462 1f19c58519297d0a0ff772dfaad24914c8942de8
parent 70461 5e556151026ca87fbc1fbcce9f79a540e8ab66a4
child 70463 e3f863f8bf4afab968896fb1a835097779f124a7
push id20326
push userMs2ger@gmail.com
push dateThu, 02 Jun 2011 13:07:28 +0000
treeherdermozilla-central@e3f863f8bf4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs660657
milestone7.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 660657 - Make nsCSSRendering::Init return void; r=roc
layout/base/nsCSSRendering.cpp
layout/base/nsCSSRendering.h
layout/build/nsLayoutStatics.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -374,24 +374,20 @@ static void DrawBorderImageComponent(nsR
 
 static nscolor MakeBevelColor(mozilla::css::Side whichSide, PRUint8 style,
                               nscolor aBackgroundColor,
                               nscolor aBorderColor);
 
 static InlineBackgroundData* gInlineBGData = nsnull;
 
 // Initialize any static variables used by nsCSSRendering.
-nsresult nsCSSRendering::Init()
+void nsCSSRendering::Init()
 {
   NS_ASSERTION(!gInlineBGData, "Init called twice");
   gInlineBGData = new InlineBackgroundData();
-  if (!gInlineBGData)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  return NS_OK;
 }
 
 // Clean up any global variables used by nsCSSRendering.
 void nsCSSRendering::Shutdown()
 {
   delete gInlineBGData;
   gInlineBGData = nsnull;
 }
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -49,17 +49,17 @@ struct nsPoint;
 class nsStyleContext;
 class nsPresContext;
 class nsRenderingContext;
 
 struct nsCSSRendering {
   /**
    * Initialize any static variables used by nsCSSRendering.
    */
-  static nsresult Init();
+  static void Init();
   
   /**
    * Clean up any static variables used by nsCSSRendering.
    */
   static void Shutdown();
   
   static void PaintBoxShadowInner(nsPresContext* aPresContext,
                                   nsRenderingContext& aRenderingContext,
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -181,21 +181,17 @@ nsLayoutStatics::Initialize()
   }
 
   rv = nsCellMap::Init();
   if (NS_FAILED(rv)) {
     NS_ERROR("Could not initialize nsCellMap");
     return rv;
   }
 
-  rv = nsCSSRendering::Init();
-  if (NS_FAILED(rv)) {
-    NS_ERROR("Could not initialize nsCSSRendering");
-    return rv;
-  }
+  nsCSSRendering::Init();
 
   rv = nsTextFrameTextRunCache::Init();
   if (NS_FAILED(rv)) {
     NS_ERROR("Could not initialize textframe textrun cache");
     return rv;
   }
 
   rv = nsHTMLDNSPrefetch::Initialize();