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

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

Issue 423093002: Oilpan: Prepare to move RenderObject and RenderObjectChildList to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add more trace Created 6 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
Index: Source/core/rendering/RenderWidget.cpp
diff --git a/Source/core/rendering/RenderWidget.cpp b/Source/core/rendering/RenderWidget.cpp
index 6ef116ab80bd2d1248136cc5520074c6add6c8bd..a6a92aa2690f14f5d1318cf8b5e9bd5a0765ddb6 100644
--- a/Source/core/rendering/RenderWidget.cpp
+++ b/Source/core/rendering/RenderWidget.cpp
@@ -40,10 +40,12 @@ namespace blink {
RenderWidget::RenderWidget(Element* element)
: RenderReplaced(element)
+#if !ENABLE(OILPAN)
// Reference counting is used to prevent the widget from being
// destroyed while inside the Widget code, which might not be
// able to handle that.
, m_refCount(1)
+#endif
{
ASSERT(element);
frameView()->addWidget(this);
@@ -67,14 +69,25 @@ void RenderWidget::willBeDestroyed()
void RenderWidget::destroy()
{
+#if ENABLE(ASSERT) && ENABLE(OILPAN)
+ m_didCallDestroy = true;
+#endif
willBeDestroyed();
clearNode();
+#if ENABLE(OILPAN)
+ // In Oilpan, postDestroy doesn't delete |this|. So calling it here is safe
+ // though |this| will be referred in FrameView.
+ postDestroy();
+#else
deref();
+#endif
}
RenderWidget::~RenderWidget()
{
+#if !ENABLE(OILPAN)
ASSERT(m_refCount <= 0);
+#endif
}
Widget* RenderWidget::widget() const
@@ -109,7 +122,7 @@ bool RenderWidget::setWidgetGeometry(const LayoutRect& frame)
if (widget->frameRect() == newFrame)
return false;
- RefPtr<RenderWidget> protector(this);
+ RefPtrWillBeRawPtr<RenderWidget> protector(this);
RefPtrWillBeRawPtr<Node> protectedNode(node());
widget->setFrameRect(newFrame);
return widget->frameRect().size() != newFrame.size();
@@ -248,11 +261,13 @@ void RenderWidget::setIsOverlapped(bool isOverlapped)
toFrameView(widget)->setIsOverlapped(isOverlapped);
}
+#if !ENABLE(OILPAN)
void RenderWidget::deref()
{
if (--m_refCount <= 0)
postDestroy();
}
+#endif
void RenderWidget::updateOnWidgetChange()
{

Powered by Google App Engine
This is Rietveld 408576698