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

Side by Side Diff: Source/modules/accessibility/AXScrollView.h

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 19 matching lines...) Expand all
30 30
31 namespace blink { 31 namespace blink {
32 32
33 class AXObjectCacheImpl; 33 class AXObjectCacheImpl;
34 class AXScrollbar; 34 class AXScrollbar;
35 class Scrollbar; 35 class Scrollbar;
36 class FrameView; 36 class FrameView;
37 37
38 class AXScrollView final : public AXObject { 38 class AXScrollView final : public AXObject {
39 public: 39 public:
40 static PassRefPtr<AXScrollView> create(FrameView*, AXObjectCacheImpl&); 40 static PassRefPtrWillBeRawPtr<AXScrollView> create(FrameView*, AXObjectCache Impl&);
41 virtual AccessibilityRole roleValue() const override { return ScrollAreaRole ; } 41 virtual AccessibilityRole roleValue() const override { return ScrollAreaRole ; }
42 FrameView* scrollView() const { return m_scrollView; } 42 FrameView* scrollView() const { return m_scrollView; }
43 43
44 virtual ~AXScrollView(); 44 virtual ~AXScrollView();
45 DECLARE_VIRTUAL_TRACE();
45 virtual void detach() override; 46 virtual void detach() override;
46 47
47 protected: 48 protected:
48 virtual ScrollableArea* getScrollableAreaIfScrollable() const override; 49 virtual ScrollableArea* getScrollableAreaIfScrollable() const override;
49 50
50 private: 51 private:
51 AXScrollView(FrameView*, AXObjectCacheImpl&); 52 AXScrollView(FrameView*, AXObjectCacheImpl&);
52 53
53 virtual bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; 54 virtual bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override;
54 virtual bool isAXScrollView() const override { return true; } 55 virtual bool isAXScrollView() const override { return true; }
(...skipping 13 matching lines...) Expand all
68 virtual FrameView* documentFrameView() const override; 69 virtual FrameView* documentFrameView() const override;
69 virtual LayoutRect elementRect() const override; 70 virtual LayoutRect elementRect() const override;
70 virtual AXObject* computeParent() const override; 71 virtual AXObject* computeParent() const override;
71 virtual AXObject* computeParentIfExists() const override; 72 virtual AXObject* computeParentIfExists() const override;
72 73
73 AXObject* webAreaObject() const; 74 AXObject* webAreaObject() const;
74 virtual AXObject* firstChild() const override { return webAreaObject(); } 75 virtual AXObject* firstChild() const override { return webAreaObject(); }
75 AXScrollbar* addChildScrollbar(Scrollbar*); 76 AXScrollbar* addChildScrollbar(Scrollbar*);
76 void removeChildScrollbar(AXObject*); 77 void removeChildScrollbar(AXObject*);
77 78
78 // FIXME: Oilpan: Frame/ScrollView is on the heap and its 79 // FIXME: Oilpan: Frame/ScrollView is on the heap and its
haraken 2015/06/23 06:33:29 Remove this FIXME.
keishi 2015/06/24 05:08:22 Done.
79 // AXScrollView is detached&removed from the AX cache when the 80 // AXScrollView is detached&removed from the AX cache when the
80 // FrameView is disposed. Which clears m_scrollView, hence this 81 // FrameView is disposed. Which clears m_scrollView, hence this
81 // bare pointer will not be stale, so the bare pointer use is safe 82 // bare pointer will not be stale, so the bare pointer use is safe
82 // & acceptable. 83 // & acceptable.
83 // 84 RawPtrWillBeWeakMember<FrameView> m_scrollView;
84 // However, it would be preferable to have it be normally traced 85 RefPtrWillBeMember<AXObject> m_horizontalScrollbar;
85 // as part of moving the AX objects to the heap. Temporarily using 86 RefPtrWillBeMember<AXObject> m_verticalScrollbar;
86 // a Persistent risks creating a FrameView leak, and brings no
87 // real benefits overall.
88 FrameView* m_scrollView;
89 RefPtr<AXObject> m_horizontalScrollbar;
90 RefPtr<AXObject> m_verticalScrollbar;
91 bool m_childrenDirty; 87 bool m_childrenDirty;
92 }; 88 };
93 89
94 DEFINE_AX_OBJECT_TYPE_CASTS(AXScrollView, isAXScrollView()); 90 DEFINE_AX_OBJECT_TYPE_CASTS(AXScrollView, isAXScrollView());
95 91
96 } // namespace blink 92 } // namespace blink
97 93
98 #endif // AXScrollView_h 94 #endif // AXScrollView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698