Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Unified Diff: third_party/WebKit/Source/web/WebFrameSerializer.cpp

Issue 2841223002: Add UMA for popup overlays removed from saved MHTML page (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebFrameSerializer.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameSerializer.cpp b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
index 8dd4fd826ff07edc13d1bf0c8f2067da67d865fd..65b672735241165c428d7db46da6c389b6bc88f5 100644
--- a/third_party/WebKit/Source/web/WebFrameSerializer.cpp
+++ b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
@@ -105,11 +105,12 @@ class MHTMLFrameSerializerDelegate final : public FrameSerializer::Delegate {
Vector<Attribute>*);
WebFrameSerializer::MHTMLPartsGenerationDelegate& web_delegate_;
+ bool has_popup_overlays_skipped_;
};
MHTMLFrameSerializerDelegate::MHTMLFrameSerializerDelegate(
WebFrameSerializer::MHTMLPartsGenerationDelegate& web_delegate)
- : web_delegate_(web_delegate) {}
+ : web_delegate_(web_delegate), has_popup_overlays_skipped_(false) {}
bool MHTMLFrameSerializerDelegate::ShouldIgnoreElement(const Element& element) {
if (ShouldIgnoreHiddenElement(element))
@@ -170,6 +171,12 @@ bool MHTMLFrameSerializerDelegate::ShouldIgnorePopupOverlayElement(
if (box->Style()->ZIndex() < kPopupOverlayZIndexThreshold)
return false;
+ if (!has_popup_overlays_skipped_) {
+ has_popup_overlays_skipped_ = true;
+ UMA_HISTOGRAM_BOOLEAN(
+ "PageSerialization.MhtmlGeneration.PopupOverlaySkippedCount", true);
Steven Holte 2017/04/27 23:41:53 Actually the name of this histogram and how you ar
jianli 2017/04/28 00:52:07 Done.
+ }
+
return true;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698