This CL adds a new per-frame metrics table to the Ads panel to track and
display ad iframes, showing Element ID, Initial origin, CPU time, and
Network bytes.
State Caching and Delta Updates:
The frontend polls for metrics using a delta-update mechanism. It caches
frame data locally, merging partial updates via updateAdFrames
(preserving unchanged fields like initial origin) and deleting removed
frames via removeAdFrames.
Asynchronous Element ID Fetching:
Element IDs are fetched asynchronously via DOMModel, with duplicate
requests prevented. The table displays an empty string while pending,
the resolved ID, or an <unnamed> placeholder if the element lacks an ID
attribute.
Screenshot:
https://issues.chromium.org/u/1/action/issues/514957134/attachments/79101281?download=false
Design doc:
https://docs.google.com/document/d/13WoAT_bSMTMvIAtNl47FgnLZqspXw_h_C6LgELmvXa4
Bug: 514957134
Change-Id: I6239a6de0045f85a961e32d7b1311751b02fa473
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7995155
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>