Bug 1373018 - Part 4: stylo: Rename eArenaObjectID_nsStyleContext to eArenaObjectID_GeckoStyleContext; r=bholley
authorManish Goregaokar <manishearth@gmail.com>
Sat, 10 Jun 2017 22:27:45 -0700
changeset 412982 df118b3de43b4fa7f69d0520077c49fdcf44b6b6
parent 412981 20db5241e456b96d3ea3eceb9296370cafdf15be
child 412983 5492eb087406719b10f510b9b74093c460ee0622
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1373018
milestone56.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 1373018 - Part 4: stylo: Rename eArenaObjectID_nsStyleContext to eArenaObjectID_GeckoStyleContext; r=bholley MozReview-Commit-ID: 5oZwxG8r9Ty
layout/base/nsPresArena.cpp
layout/base/nsPresArenaObjectList.h
layout/style/GeckoStyleContext.cpp
layout/style/nsStyleContext.cpp
layout/style/nsStyleContext.h
layout/style/nsStyleSet.cpp
--- a/layout/base/nsPresArena.cpp
+++ b/layout/base/nsPresArena.cpp
@@ -8,17 +8,17 @@
 /* arena allocation for the frame tree and closely-related objects */
 
 #include "nsPresArena.h"
 
 #include "mozilla/Poison.h"
 #include "nsDebug.h"
 #include "nsArenaMemoryStats.h"
 #include "nsPrintfCString.h"
-#include "nsStyleContext.h"
+#include "GeckoStyleContext.h"
 #include "FrameLayerBuilder.h"
 #include "mozilla/ArrayUtils.h"
 
 #include <inttypes.h>
 
 using namespace mozilla;
 
 nsPresArena::nsPresArena()
@@ -203,17 +203,17 @@ nsPresArena::AddSizeOfExcludingThis(mozi
 #undef FRAME_ID
 #undef ABSTRACT_FRAME_ID
       case eArenaObjectID_nsLineBox:
         p = &aArenaStats->mLineBoxes;
         break;
       case eArenaObjectID_nsRuleNode:
         p = &aArenaStats->mRuleNodes;
         break;
-      case eArenaObjectID_nsStyleContext:
+      case eArenaObjectID_GeckoStyleContext:
         p = &aArenaStats->mStyleContexts;
         break;
 #define STYLE_STRUCT(name_, checkdata_cb_)      \
         case eArenaObjectID_nsStyle##name_:
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
         p = &aArenaStats->mStyleStructs;
         break;
--- a/layout/base/nsPresArenaObjectList.h
+++ b/layout/base/nsPresArenaObjectList.h
@@ -42,17 +42,17 @@
 //
 // Files including nsPresArenaObjectList.h can either define one or both
 // of PRES_ARENA_OBJECT_{WITH,WITHOUT}_ARENAREFPTR_SUPPORT to capture those
 // classes separately, or PRES_ARENA_OBJECT to capture all nsPresArena-
 // allocated classes.
 
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsLineBox)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsRuleNode)
-PRES_ARENA_OBJECT_WITH_ARENAREFPTR_SUPPORT(nsStyleContext)
+PRES_ARENA_OBJECT_WITH_ARENAREFPTR_SUPPORT(GeckoStyleContext)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(DisplayItemData)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsInheritedStyleData)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsResetStyleData)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsConditionalResetStyleData)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsConditionalResetStyleDataEntry)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(nsFrameList)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(CustomCounterStyle)
 PRES_ARENA_OBJECT_WITHOUT_ARENAREFPTR_SUPPORT(DependentBuiltinCounterStyle)
--- a/layout/style/GeckoStyleContext.cpp
+++ b/layout/style/GeckoStyleContext.cpp
@@ -40,12 +40,13 @@ GeckoStyleContext::GeckoStyleContext(nsS
   ApplyStyleFixups(aSkipParentDisplayBasedStyleFixup);
 }
 
 // Overloaded new operator. Initializes the memory to 0 and relies on an arena
 // (which comes from the presShell) to perform the allocation.
 void*
 GeckoStyleContext::operator new(size_t sz, nsPresContext* aPresContext)
 {
+  MOZ_ASSERT(sz == sizeof(GeckoStyleContext));
   // Check the recycle list first.
   return aPresContext->PresShell()->
-    AllocateByObjectID(eArenaObjectID_nsStyleContext, sz);
+    AllocateByObjectID(eArenaObjectID_GeckoStyleContext, sz);
 }
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -1331,17 +1331,17 @@ nsStyleContext::Destroy()
   if (IsGecko()) {
     // Get the pres context.
     RefPtr<nsPresContext> presContext = PresContext();
     // Call our destructor.
     this->AsGecko()->~GeckoStyleContext();
     // Don't let the memory be freed, since it will be recycled
     // instead. Don't call the global operator delete.
     presContext->PresShell()->
-      FreeByObjectID(eArenaObjectID_nsStyleContext, this);
+      FreeByObjectID(eArenaObjectID_GeckoStyleContext, this);
     } else {
       delete static_cast<ServoStyleContext*>(this);
     }
 }
 
 already_AddRefed<nsStyleContext>
 NS_NewStyleContext(nsStyleContext* aParentContext,
                    nsIAtom* aPseudoTag,
--- a/layout/style/nsStyleContext.h
+++ b/layout/style/nsStyleContext.h
@@ -67,17 +67,17 @@ public:
 #endif
   MOZ_DECL_STYLO_CONVERT_METHODS(mozilla::GeckoStyleContext, mozilla::ServoStyleContext);
 
   void Destroy();
 
   // These two methods are for use by ArenaRefPtr.
   static mozilla::ArenaObjectID ArenaObjectID()
   {
-    return mozilla::eArenaObjectID_nsStyleContext;
+    return mozilla::eArenaObjectID_GeckoStyleContext;
   }
   nsIPresShell* Arena();
 
 #ifdef DEBUG
   /**
    * Initializes a cached pref, which is only used in DEBUG code.
    */
   static void Initialize();
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -303,17 +303,17 @@ nsresult
 nsStyleSet::BeginReconstruct()
 {
   NS_ASSERTION(!mInReconstruct, "Unmatched begin/end?");
   NS_ASSERTION(mRuleTree, "Reconstructing before first construction?");
   mInReconstruct = true;
 
   // Clear any ArenaRefPtr-managed style contexts, as we don't want them
   // held on to after the rule tree has been reconstructed.
-  PresContext()->PresShell()->ClearArenaRefPtrs(eArenaObjectID_nsStyleContext);
+  PresContext()->PresShell()->ClearArenaRefPtrs(eArenaObjectID_GeckoStyleContext);
 
   // Clear our cached style contexts for non-inheriting anonymous boxes.
   ClearNonInheritingStyleContexts();
 
 #ifdef DEBUG
   MOZ_ASSERT(!mOldRootNode);
   mOldRootNode = mRuleTree;
 #endif