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 {
return value;
}
void VisualViewport::PreFinalize() {
void VisualViewport::DisposeImpl() {
root_transform_layer_.reset();
inner_viewport_container_layer_.reset();
overscroll_elasticity_layer_.reset();
......@@ -1226,6 +1226,7 @@ void VisualViewport::PreFinalize() {
scroll_node_.reset();
horizontal_scrollbar_effect_node_.reset();
vertical_scrollbar_effect_node_.reset();
ScrollableArea::DisposeImpl();
}
} // namespace blink
......@@ -274,7 +274,7 @@ class CORE_EXPORT VisualViewport final
void SetNeedsPaintPropertyUpdate() { needs_paint_property_update_ = true; }
bool NeedsPaintPropertyUpdate() const { return needs_paint_property_update_; }
void PreFinalize() override;
void DisposeImpl() override;
private:
bool DidSetScaleOrLocation(float scale,
......
......@@ -2928,10 +2928,11 @@ bool PaintLayerScrollableArea::ScrollingBackgroundDisplayItemClient::
->PaintedOutputOfObjectHasNoEffectRegardlessOfSize();
}
void PaintLayerScrollableArea::PreFinalize() {
void PaintLayerScrollableArea::DisposeImpl() {
if (!HasBeenDisposed())
Dispose();
rare_data_.reset();
ScrollableArea::DisposeImpl();
}
} // namespace blink
......@@ -545,7 +545,7 @@ class CORE_EXPORT PaintLayerScrollableArea final
return scrolling_background_display_item_client_;
}
void PreFinalize() override;
void DisposeImpl() override;
private:
bool NeedsScrollbarReconstruction() const;
......
......@@ -139,8 +139,9 @@ class MockScrollableAreaForAnimatorTest
ScrollableArea::Trace(visitor);
}
virtual void PreFinalize() {
void DisposeImpl() override {
timer_task_runner_.reset();
ScrollableArea::DisposeImpl();
}
private:
......
......@@ -96,13 +96,14 @@ ScrollableArea::ScrollableArea()
ScrollableArea::~ScrollableArea() = default;
void ScrollableArea::Dispose() {
DisposeImpl();
}
void ScrollableArea::DisposeImpl() {
RunScrollCompleteCallbacks();
fade_overlay_scrollbars_timer_.reset();
PreFinalize();
}
void ScrollableArea::PreFinalize() {}
void ScrollableArea::ClearScrollableArea() {
#if defined(OS_MACOSX)
if (scroll_animator_)
......
......@@ -351,7 +351,7 @@ class CORE_EXPORT ScrollableArea : public GarbageCollectedMixin {
virtual ~ScrollableArea();
void Dispose();
virtual void PreFinalize();
virtual void DisposeImpl();
// Called when any of horizontal scrollbar, vertical scrollbar and scroll
// 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