Commit 9fff0be7 authored by Aaron Krajeski's avatar Aaron Krajeski Committed by Chromium LUCI CQ

Make sure metrics are recorded in HTMLCanvasElement dispose

The call to DiscardResourceProvider is causing a lot of false negatives.
https://uma.googleplex.com/p/chrome/histograms?sid=03450a933557bea663d8de9368d8d279

"Blink.Canvas.IsComposited" is redundant with "IsAccelerated", so I'm
just getting rid of it.

Bug: 1165879a
Change-Id: Ib3d1ce31d5225215155378dfb1eecaa95e4c7b48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625289Reviewed-by: default avatarJuanmi Huertas <juanmihd@chromium.org>
Reviewed-by: default avatarAaron Krajeski <aaronhk@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843525}
parent cbcf7691
......@@ -142,9 +142,10 @@ HTMLCanvasElement::~HTMLCanvasElement() {
}
void HTMLCanvasElement::Dispose() {
if (OffscreenCanvasFrame()) {
ReleaseOffscreenCanvasFrame();
}
// We need to record metrics before we dispose of anything
if (context_)
UMA_HISTOGRAM_BOOLEAN("Blink.Canvas.HasRendered", bool(ResourceProvider()));
// It's possible that the placeholder frame has been disposed but its ID still
// exists. Make sure that it gets unregistered here
UnregisterPlaceholderCanvas();
......@@ -154,12 +155,8 @@ void HTMLCanvasElement::Dispose() {
DiscardResourceProvider();
if (context_) {
UMA_HISTOGRAM_BOOLEAN("Blink.Canvas.HasRendered", bool(ResourceProvider()));
if (context_->Host()) {
UMA_HISTOGRAM_BOOLEAN("Blink.Canvas.IsComposited",
context_->IsComposited());
if (context_->Host())
context_->DetachHost();
}
context_ = nullptr;
}
......
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