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

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

Issue 423093002: Oilpan: Prepare to move RenderObject and RenderObjectChildList to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: dispose -> destroy Created 6 years, 4 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/RenderBlockFlow.cpp ('k') | Source/core/rendering/RenderFrameSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 8ec08d4bc738a86c755f9f226fd356360f6522ee..b06ed1d121931c3039ba1eead2f207132217cc71 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -38,6 +38,7 @@
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderObjectInlines.h"
#include "core/rendering/RenderRegion.h"
+#include "core/rendering/RenderTextFragment.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/compositing/CompositedLayerMapping.h"
#include "core/rendering/compositing/RenderLayerCompositor.h"
@@ -60,13 +61,13 @@ using namespace HTMLNames;
// an anonymous block (that houses other blocks) or it will be an inline flow.
// <b><i><p>Hello</p></i></b>. In this example the <i> will have a block as
// its continuation but the <b> will just have an inline as its continuation.
-typedef HashMap<const RenderBoxModelObject*, RenderBoxModelObject*> ContinuationMap;
-static ContinuationMap* continuationMap = 0;
+typedef WillBeHeapHashMap<RawPtrWillBeMember<const RenderBoxModelObject>, RawPtrWillBeMember<RenderBoxModelObject> > ContinuationMap;
+static OwnPtrWillBePersistent<ContinuationMap>* continuationMap = 0;
// This HashMap is similar to the continuation map, but connects first-letter
// renderers to their remaining text fragments.
-typedef HashMap<const RenderBoxModelObject*, RenderTextFragment*> FirstLetterRemainingTextMap;
-static FirstLetterRemainingTextMap* firstLetterRemainingTextMap = 0;
+typedef WillBeHeapHashMap<RawPtrWillBeMember<const RenderBoxModelObject>, RawPtrWillBeMember<RenderTextFragment> > FirstLetterRemainingTextMap;
+static OwnPtrWillBePersistent<FirstLetterRemainingTextMap>* firstLetterRemainingTextMap = 0;
void RenderBoxModelObject::setSelectionState(SelectionState state)
{
@@ -2506,18 +2507,18 @@ RenderBoxModelObject* RenderBoxModelObject::continuation() const
{
if (!continuationMap)
return 0;
- return continuationMap->get(this);
+ return (*continuationMap)->get(this);
}
void RenderBoxModelObject::setContinuation(RenderBoxModelObject* continuation)
{
if (continuation) {
if (!continuationMap)
- continuationMap = new ContinuationMap;
- continuationMap->set(this, continuation);
+ continuationMap = new OwnPtrWillBePersistent<ContinuationMap>(adoptPtrWillBeNoop(new ContinuationMap));
+ (*continuationMap)->set(this, continuation);
} else {
if (continuationMap)
- continuationMap->remove(this);
+ (*continuationMap)->remove(this);
}
}
@@ -2537,17 +2538,18 @@ RenderTextFragment* RenderBoxModelObject::firstLetterRemainingText() const
{
if (!firstLetterRemainingTextMap)
return 0;
- return firstLetterRemainingTextMap->get(this);
+ return (*firstLetterRemainingTextMap)->get(this);
}
void RenderBoxModelObject::setFirstLetterRemainingText(RenderTextFragment* remainingText)
{
if (remainingText) {
if (!firstLetterRemainingTextMap)
- firstLetterRemainingTextMap = new FirstLetterRemainingTextMap;
- firstLetterRemainingTextMap->set(this, remainingText);
- } else if (firstLetterRemainingTextMap)
- firstLetterRemainingTextMap->remove(this);
+ firstLetterRemainingTextMap = new OwnPtrWillBePersistent<FirstLetterRemainingTextMap>(adoptPtrWillBeNoop(new FirstLetterRemainingTextMap));
+ (*firstLetterRemainingTextMap)->set(this, remainingText);
+ } else if (firstLetterRemainingTextMap) {
+ (*firstLetterRemainingTextMap)->remove(this);
+ }
}
LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIndentOffset)
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.cpp ('k') | Source/core/rendering/RenderFrameSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698