Commit 21daa5f9 authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

[IntersectionObserver] Remove hack for on-stack wrapper tracing

The hack is no longer necessary. Also remove some other obsolete
TODO's.

BUG=796145
R=yukishiino@chromium.org

Change-Id: Ie84e143759d8e882f7403da48da6f882a962998a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1760984Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688494}
parent cc809876
......@@ -46,9 +46,6 @@ void IntersectionObservation::Compute(unsigned flags) {
return;
if (!(flags & kIgnoreDelay) &&
timestamp - last_run_time_ < observer_->GetEffectiveDelay()) {
// TODO(crbug.com/915495): Need to eventually notify the observer of the
// updated intersection because there's currently nothing to guarantee this
// Compute() method will be called again after the delay period has passed.
return;
}
if (target_->isConnected() && Observer()->trackVisibility()) {
......
......@@ -25,9 +25,6 @@ IntersectionObserverController::~IntersectionObserverController() = default;
void IntersectionObserverController::PostTaskToDeliverObservations() {
DCHECK(GetExecutionContext());
// TODO(ojan): These tasks decide whether to throttle a subframe, so they
// need to be unthrottled, but we should throttle all the other tasks
// (e.g. ones coming from the web page).
GetExecutionContext()
->GetTaskRunner(TaskType::kInternalIntersectionObserver)
->PostTask(
......@@ -53,18 +50,15 @@ void IntersectionObserverController::DeliverIntersectionObservations(
pending_intersection_observers_.clear();
return;
}
// TODO(yukishiino): Remove this CHECK once https://crbug.com/809784 gets
// resolved.
CHECK(!context->IsContextDestroyed());
HeapVector<Member<IntersectionObserver>> intersection_observers_being_invoked;
for (auto& observer : pending_intersection_observers_) {
if (observer->GetDeliveryBehavior() == behavior)
intersection_observers_being_invoked_.push_back(observer);
intersection_observers_being_invoked.push_back(observer);
}
for (auto& observer : intersection_observers_being_invoked_) {
for (auto& observer : intersection_observers_being_invoked) {
pending_intersection_observers_.erase(observer);
observer->Deliver();
}
intersection_observers_being_invoked_.clear();
}
bool IntersectionObserverController::ComputeTrackedIntersectionObservations(
......@@ -111,7 +105,6 @@ void IntersectionObserverController::RemoveTrackedTarget(Element& target) {
void IntersectionObserverController::Trace(blink::Visitor* visitor) {
visitor->Trace(tracked_observation_targets_);
visitor->Trace(pending_intersection_observers_);
visitor->Trace(intersection_observers_being_invoked_);
ContextClient::Trace(visitor);
}
......
......@@ -65,10 +65,6 @@ class IntersectionObserverController
// IntersectionObservers for which this is the execution context of the
// callback.
HeapHashSet<Member<IntersectionObserver>> pending_intersection_observers_;
// TODO(https://crbug.com/796145): Remove this hack once on-stack objects
// get supported by either of wrapper-tracing or unified GC.
HeapVector<Member<IntersectionObserver>>
intersection_observers_being_invoked_;
// This is 'true' if any tracked observation target is being tracked by an
// observer for which observer->trackVisibility() is true.
bool needs_occlusion_tracking_;
......
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