Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1703)

Unified Diff: Source/core/rendering/InlineBox.cpp

Issue 20231002: Replace RenderArena with PartitionAlloc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/InlineBox.h ('k') | Source/core/rendering/InlineFlowBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineBox.cpp
diff --git a/Source/core/rendering/InlineBox.cpp b/Source/core/rendering/InlineBox.cpp
index a1bc0b9c136570ccb34fb3a4f803cde55e5cd836..bfd9db658ecabfab5fee8a714dd84e49622eeb2c 100644
--- a/Source/core/rendering/InlineBox.cpp
+++ b/Source/core/rendering/InlineBox.cpp
@@ -20,10 +20,10 @@
#include "config.h"
#include "core/rendering/InlineBox.h"
+#include "core/platform/Partitions.h"
#include "core/platform/graphics/FontMetrics.h"
#include "core/rendering/InlineFlowBox.h"
#include "core/rendering/PaintInfo.h"
-#include "core/rendering/RenderArena.h"
#include "core/rendering/RenderBlock.h"
#include "core/rendering/RootInlineBox.h"
@@ -68,31 +68,14 @@ void InlineBox::remove()
parent()->removeChild(this);
}
-void InlineBox::destroy(RenderArena* renderArena)
+void* InlineBox::operator new(size_t sz)
{
-#ifndef NDEBUG
- inInlineBoxDetach = true;
-#endif
- delete this;
-#ifndef NDEBUG
- inInlineBoxDetach = false;
-#endif
-
- // Recover the size left there for us by operator delete and free the memory.
- renderArena->free(*(size_t *)this, this);
+ return partitionAlloc(Partitions::getRenderingPartition(), sz);
}
-void* InlineBox::operator new(size_t sz, RenderArena* renderArena)
+void InlineBox::operator delete(void* ptr)
{
- return renderArena->allocate(sz);
-}
-
-void InlineBox::operator delete(void* ptr, size_t sz)
-{
- ASSERT(inInlineBoxDetach);
-
- // Stash size where destroy can find it.
- *(size_t *)ptr = sz;
+ partitionFree(ptr);
}
#ifndef NDEBUG
@@ -183,11 +166,11 @@ void InlineBox::dirtyLineBoxes()
curr->markDirty();
}
-void InlineBox::deleteLine(RenderArena* arena)
+void InlineBox::deleteLine()
{
if (!m_bitfields.extracted() && m_renderer->isBox())
toRenderBox(m_renderer)->setInlineBoxWrapper(0);
- destroy(arena);
+ destroy();
}
void InlineBox::extractLine()
« no previous file with comments | « Source/core/rendering/InlineBox.h ('k') | Source/core/rendering/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698