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

Unified Diff: Source/WebCore/rendering/RenderScrollbar.h

Issue 10442005: Merge 116476 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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/WebCore/rendering/RenderMenuList.cpp ('k') | Source/WebCore/rendering/RenderScrollbar.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderScrollbar.h
===================================================================
--- Source/WebCore/rendering/RenderScrollbar.h (revision 118271)
+++ Source/WebCore/rendering/RenderScrollbar.h (working copy)
@@ -26,6 +26,7 @@
#ifndef RenderScrollbar_h
#define RenderScrollbar_h
+#include "Node.h"
#include "RenderStyleConstants.h"
#include "Scrollbar.h"
#include <wtf/HashMap.h>
@@ -39,18 +40,17 @@
class RenderScrollbar : public Scrollbar {
protected:
- RenderScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame*);
+ RenderScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, Frame*);
public:
friend class Scrollbar;
- static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame* owningFrame = 0);
+ static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, Frame* owningFrame = 0);
virtual ~RenderScrollbar();
static ScrollbarPart partForStyleResolve();
static RenderScrollbar* scrollbarForStyleResolve();
RenderBox* owningRenderer() const;
- void clearOwningRenderer() { m_owner = 0; }
void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&);
@@ -80,7 +80,12 @@
PassRefPtr<RenderStyle> getScrollbarPseudoStyle(ScrollbarPart, PseudoId);
void updateScrollbarPart(ScrollbarPart, bool destroy = false);
- RenderBox* m_owner;
+ // This Scrollbar(Widget) may outlive the DOM which created it (during tear down),
+ // so we keep a reference to the Node which caused this custom scrollbar creation.
+ // This will not create a reference cycle as the Widget tree is owned by our containing
+ // FrameView which this Node pointer can in no way keep alive. See webkit bug 80610.
+ RefPtr<Node> m_owner;
+
Frame* m_owningFrame;
HashMap<unsigned, RenderScrollbarPart*> m_parts;
};
« no previous file with comments | « Source/WebCore/rendering/RenderMenuList.cpp ('k') | Source/WebCore/rendering/RenderScrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698