Skip to content

Commit

Permalink
Connect LoAF origin trial name with feature
Browse files Browse the repository at this point in the history
(cherry picked from commit 8ae4587)

Bug: 1457098
Change-Id: I1796cdd1e234904807e1a4e9841d61de5f376531
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4633460
Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1161319}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4643268
Cr-Commit-Position: refs/branch-heads/5845@{#75}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
noamr authored and Chromium LUCI CQ committed Jun 26, 2023
1 parent edafb62 commit 15267f5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ void AnimationFrameTimingMonitor::OnTaskCompleted(
timing_info->SetDidPause();
}

if (RuntimeEnabledFeatures::LongAnimationFrameTimingEnabled()) {
if (RuntimeEnabledFeatures::LongAnimationFrameTimingEnabled(
frame->DomWindow())) {
DOMWindowPerformance::performance(*frame->DomWindow())
->ReportLongAnimationFrameTiming(timing_info);
}
Expand Down
10 changes: 6 additions & 4 deletions third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ WebFrameWidgetImpl::~WebFrameWidgetImpl() {

void WebFrameWidgetImpl::BindLocalRoot(WebLocalFrame& local_root) {
local_root_ = To<WebLocalFrameImpl>(local_root);
if (RuntimeEnabledFeatures::LongAnimationFrameMonitoringEnabled() &&
CHECK(local_root_ && local_root_->GetFrame());
if (RuntimeEnabledFeatures::LongAnimationFrameMonitoringEnabled(
local_root_->GetFrame()->DomWindow()) &&
!IsHidden()) {
DCHECK(local_root_->GetFrame());
animation_frame_timing_monitor_ =
MakeGarbageCollected<AnimationFrameTimingMonitor>(
*this, local_root_->GetFrame()->GetProbeSink());
Expand Down Expand Up @@ -4377,9 +4378,10 @@ void WebFrameWidgetImpl::WasShown(bool was_evicted) {
&RemoteFrame::ResendVisualProperties);
}

CHECK(local_root_ && local_root_->GetFrame());
if (!animation_frame_timing_monitor_ &&
RuntimeEnabledFeatures::LongAnimationFrameTimingEnabled()) {
DCHECK(local_root_->GetFrame());
RuntimeEnabledFeatures::LongAnimationFrameMonitoringEnabled(
local_root_->GetFrame()->DomWindow())) {
animation_frame_timing_monitor_ =
MakeGarbageCollected<AnimationFrameTimingMonitor>(
*this, local_root_->GetFrame()->GetProbeSink());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ Vector<AtomicString> PerformanceObserver::supportedEntryTypes(
performance_entry_names::kLargestContentfulPaint);
supportedEntryTypes.push_back(performance_entry_names::kLayoutShift);

if (RuntimeEnabledFeatures::LongAnimationFrameTimingEnabled()) {
if (RuntimeEnabledFeatures::LongAnimationFrameTimingEnabled(
execution_context)) {
supportedEntryTypes.push_back(
performance_entry_names::kLongAnimationFrame);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2168,13 +2168,15 @@
// frames. Can be used for UKM or for the perofrmance API.
name: "LongAnimationFrameMonitoring",
implied_by: ["LongAnimationFrameTiming", "LongAnimationFrameUKM", "LongTaskFromLongAnimationFrame"],
status: "experimental"
status: "experimental",
origin_trial_feature_name: "LongAnimationFrameTiming"
},
{
// Enables long aniamtion frames as a performance API (the
// "long-animation-frame" timeline entry)
name: "LongAnimationFrameTiming",
status: "experimental"
status: "experimental",
origin_trial_feature_name: "LongAnimationFrameTiming"
},
{
// Enables long aniamtion frame logging to UKM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2396,11 +2396,9 @@ void MainThreadSchedulerImpl::OnTaskCompleted(
if (queue) {
queue->OnTaskRunTimeReported(task_timing);

if (RuntimeEnabledFeatures::LongAnimationFrameMonitoringEnabled()) {
if (FrameSchedulerImpl* frame_scheduler = queue->GetFrameScheduler()) {
frame_scheduler->OnTaskCompleted(task_timing,
task.GetDesiredExecutionTime());
}
if (FrameSchedulerImpl* frame_scheduler = queue->GetFrameScheduler()) {
frame_scheduler->OnTaskCompleted(task_timing,
task.GetDesiredExecutionTime());
}
}

Expand Down

0 comments on commit 15267f5

Please sign in to comment.