Commit d9373636 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

Matching ScrollableArea pre-finalizer scheme to new docs

Existing code executed parent pre-finalizer before subclass
pre-finalizer. Corrected the order.

Bug: 981043
Change-Id: I4b25cf8c6ee1d8145f77e5ed46e87eeae22357f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1696964Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676352}
parent 24f7d417
...@@ -1207,7 +1207,7 @@ std::unique_ptr<TracedValue> VisualViewport::ViewportToTracedValue() const { ...@@ -1207,7 +1207,7 @@ std::unique_ptr<TracedValue> VisualViewport::ViewportToTracedValue() const {
return value; return value;
} }
void VisualViewport::PreFinalize() { void VisualViewport::DisposeImpl() {
root_transform_layer_.reset(); root_transform_layer_.reset();
inner_viewport_container_layer_.reset(); inner_viewport_container_layer_.reset();
overscroll_elasticity_layer_.reset(); overscroll_elasticity_layer_.reset();
...@@ -1226,6 +1226,7 @@ void VisualViewport::PreFinalize() { ...@@ -1226,6 +1226,7 @@ void VisualViewport::PreFinalize() {
scroll_node_.reset(); scroll_node_.reset();
horizontal_scrollbar_effect_node_.reset(); horizontal_scrollbar_effect_node_.reset();
vertical_scrollbar_effect_node_.reset(); vertical_scrollbar_effect_node_.reset();
ScrollableArea::DisposeImpl();
} }
} // namespace blink } // namespace blink
...@@ -274,7 +274,7 @@ class CORE_EXPORT VisualViewport final ...@@ -274,7 +274,7 @@ class CORE_EXPORT VisualViewport final
void SetNeedsPaintPropertyUpdate() { needs_paint_property_update_ = true; } void SetNeedsPaintPropertyUpdate() { needs_paint_property_update_ = true; }
bool NeedsPaintPropertyUpdate() const { return needs_paint_property_update_; } bool NeedsPaintPropertyUpdate() const { return needs_paint_property_update_; }
void PreFinalize() override; void DisposeImpl() override;
private: private:
bool DidSetScaleOrLocation(float scale, bool DidSetScaleOrLocation(float scale,
......
...@@ -2928,10 +2928,11 @@ bool PaintLayerScrollableArea::ScrollingBackgroundDisplayItemClient:: ...@@ -2928,10 +2928,11 @@ bool PaintLayerScrollableArea::ScrollingBackgroundDisplayItemClient::
->PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); ->PaintedOutputOfObjectHasNoEffectRegardlessOfSize();
} }
void PaintLayerScrollableArea::PreFinalize() { void PaintLayerScrollableArea::DisposeImpl() {
if (!HasBeenDisposed()) if (!HasBeenDisposed())
Dispose(); Dispose();
rare_data_.reset(); rare_data_.reset();
ScrollableArea::DisposeImpl();
} }
} // namespace blink } // namespace blink
...@@ -545,7 +545,7 @@ class CORE_EXPORT PaintLayerScrollableArea final ...@@ -545,7 +545,7 @@ class CORE_EXPORT PaintLayerScrollableArea final
return scrolling_background_display_item_client_; return scrolling_background_display_item_client_;
} }
void PreFinalize() override; void DisposeImpl() override;
private: private:
bool NeedsScrollbarReconstruction() const; bool NeedsScrollbarReconstruction() const;
......
...@@ -139,8 +139,9 @@ class MockScrollableAreaForAnimatorTest ...@@ -139,8 +139,9 @@ class MockScrollableAreaForAnimatorTest
ScrollableArea::Trace(visitor); ScrollableArea::Trace(visitor);
} }
virtual void PreFinalize() { void DisposeImpl() override {
timer_task_runner_.reset(); timer_task_runner_.reset();
ScrollableArea::DisposeImpl();
} }
private: private:
......
...@@ -96,13 +96,14 @@ ScrollableArea::ScrollableArea() ...@@ -96,13 +96,14 @@ ScrollableArea::ScrollableArea()
ScrollableArea::~ScrollableArea() = default; ScrollableArea::~ScrollableArea() = default;
void ScrollableArea::Dispose() { void ScrollableArea::Dispose() {
DisposeImpl();
}
void ScrollableArea::DisposeImpl() {
RunScrollCompleteCallbacks(); RunScrollCompleteCallbacks();
fade_overlay_scrollbars_timer_.reset(); fade_overlay_scrollbars_timer_.reset();
PreFinalize();
} }
void ScrollableArea::PreFinalize() {}
void ScrollableArea::ClearScrollableArea() { void ScrollableArea::ClearScrollableArea() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
if (scroll_animator_) if (scroll_animator_)
......
...@@ -351,7 +351,7 @@ class CORE_EXPORT ScrollableArea : public GarbageCollectedMixin { ...@@ -351,7 +351,7 @@ class CORE_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual ~ScrollableArea(); virtual ~ScrollableArea();
void Dispose(); void Dispose();
virtual void PreFinalize(); virtual void DisposeImpl();
// Called when any of horizontal scrollbar, vertical scrollbar and scroll // Called when any of horizontal scrollbar, vertical scrollbar and scroll
// corner is setNeedsPaintInvalidation. // corner is setNeedsPaintInvalidation.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment