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

Side by Side Diff: Source/core/rendering/RenderScrollbar.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase upto and resolve r182737 conflict. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 18 matching lines...) Expand all
29 #include "core/css/PseudoStyleRequest.h" 29 #include "core/css/PseudoStyleRequest.h"
30 #include "core/frame/FrameView.h" 30 #include "core/frame/FrameView.h"
31 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
32 #include "core/rendering/RenderPart.h" 32 #include "core/rendering/RenderPart.h"
33 #include "core/rendering/RenderScrollbarPart.h" 33 #include "core/rendering/RenderScrollbarPart.h"
34 #include "core/rendering/RenderScrollbarTheme.h" 34 #include "core/rendering/RenderScrollbarTheme.h"
35 #include "platform/graphics/GraphicsContext.h" 35 #include "platform/graphics/GraphicsContext.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scr ollableArea, ScrollbarOrientation orientation, Node* ownerNode, LocalFrame* owni ngFrame) 39 PassRefPtrWillBeRawPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(Scrolla bleArea* scrollableArea, ScrollbarOrientation orientation, Node* ownerNode, Loca lFrame* owningFrame)
40 { 40 {
41 return adoptRef(new RenderScrollbar(scrollableArea, orientation, ownerNode, owningFrame)); 41 return adoptRefWillBeNoop(new RenderScrollbar(scrollableArea, orientation, o wnerNode, owningFrame));
42 } 42 }
43 43
44 RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrient ation orientation, Node* ownerNode, LocalFrame* owningFrame) 44 RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrient ation orientation, Node* ownerNode, LocalFrame* owningFrame)
45 : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTh eme::renderScrollbarTheme()) 45 : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTh eme::renderScrollbarTheme())
46 , m_owner(ownerNode) 46 , m_owner(ownerNode)
47 , m_owningFrame(owningFrame) 47 , m_owningFrame(owningFrame)
48 { 48 {
49 ASSERT(ownerNode || owningFrame); 49 ASSERT(ownerNode || owningFrame);
50 50
51 // FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created. 51 // FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created.
(...skipping 16 matching lines...) Expand all
68 68
69 RenderScrollbar::~RenderScrollbar() 69 RenderScrollbar::~RenderScrollbar()
70 { 70 {
71 if (!m_parts.isEmpty()) { 71 if (!m_parts.isEmpty()) {
72 // When a scrollbar is detached from its parent (causing all parts remov al) and 72 // When a scrollbar is detached from its parent (causing all parts remov al) and
73 // ready to be destroyed, its destruction can be delayed because of RefP tr 73 // ready to be destroyed, its destruction can be delayed because of RefP tr
74 // maintained in other classes such as EventHandler (m_lastScrollbarUnde rMouse). 74 // maintained in other classes such as EventHandler (m_lastScrollbarUnde rMouse).
75 // Meanwhile, we can have a call to updateScrollbarPart which recreates the 75 // Meanwhile, we can have a call to updateScrollbarPart which recreates the
76 // scrollbar part. So, we need to destroy these parts since we don't wan t them 76 // scrollbar part. So, we need to destroy these parts since we don't wan t them
77 // to call on a destroyed scrollbar. See webkit bug 68009. 77 // to call on a destroyed scrollbar. See webkit bug 68009.
78 //
79 // Oilpan: see comment next to m_parts declaration why this is
80 // safe to do and required.
78 updateScrollbarParts(true); 81 updateScrollbarParts(true);
79 } 82 }
80 } 83 }
81 84
85 void RenderScrollbar::trace(Visitor* visitor)
86 {
87 #if ENABLE(OILPAN)
88 visitor->trace(m_owner);
89 visitor->trace(m_owningFrame);
90 #endif
91 Scrollbar::trace(visitor);
92 }
93
82 RenderBox* RenderScrollbar::owningRenderer() const 94 RenderBox* RenderScrollbar::owningRenderer() const
83 { 95 {
84 if (m_owningFrame) { 96 if (m_owningFrame) {
85 RenderBox* currentRenderer = m_owningFrame->ownerRenderer(); 97 RenderBox* currentRenderer = m_owningFrame->ownerRenderer();
86 return currentRenderer; 98 return currentRenderer;
87 } 99 }
88 return m_owner && m_owner->renderer() ? m_owner->renderer()->enclosingBox() : 0; 100 return m_owner && m_owner->renderer() ? m_owner->renderer()->enclosingBox() : 0;
89 } 101 }
90 102
91 void RenderScrollbar::setParent(Widget* parent) 103 void RenderScrollbar::setParent(Widget* parent)
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 int RenderScrollbar::minimumThumbLength() 354 int RenderScrollbar::minimumThumbLength()
343 { 355 {
344 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); 356 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart);
345 if (!partRenderer) 357 if (!partRenderer)
346 return 0; 358 return 0;
347 partRenderer->layout(); 359 partRenderer->layout();
348 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe nderer->height(); 360 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe nderer->height();
349 } 361 }
350 362
351 } 363 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698