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

Unified Diff: Source/core/rendering/RenderScrollbarPart.cpp

Issue 693803002: Add a UseCounter for CustomScrollbar (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased to latest Created 6 years, 1 month 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 | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderScrollbarPart.cpp
diff --git a/Source/core/rendering/RenderScrollbarPart.cpp b/Source/core/rendering/RenderScrollbarPart.cpp
index ce8ed17311751b0ce89b52491a42b660fb50240f..2aea3ef9db6a00226bdf4bb4ebbe9f201c86ce03 100644
--- a/Source/core/rendering/RenderScrollbarPart.cpp
+++ b/Source/core/rendering/RenderScrollbarPart.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "core/rendering/RenderScrollbarPart.h"
+#include "core/frame/UseCounter.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderScrollbar.h"
#include "core/rendering/RenderScrollbarTheme.h"
@@ -45,9 +46,38 @@ RenderScrollbarPart::~RenderScrollbarPart()
{
}
+static void recordScrollbarPartStats(Document& document, ScrollbarPart part)
+{
+ switch (part) {
+ case BackButtonStartPart:
+ case ForwardButtonStartPart:
+ case BackButtonEndPart:
+ case ForwardButtonEndPart:
+ UseCounter::count(document, UseCounter::CSSSelectorPseudoScrollbarButton);
+ break;
+ case BackTrackPart:
+ case ForwardTrackPart:
+ UseCounter::count(document, UseCounter::CSSSelectorPseudoScrollbarTrackPiece);
+ break;
+ case ThumbPart:
+ UseCounter::count(document, UseCounter::CSSSelectorPseudoScrollbarThumb);
+ break;
+ case TrackBGPart:
+ UseCounter::count(document, UseCounter::CSSSelectorPseudoScrollbarTrack);
+ break;
+ case ScrollbarBGPart:
+ UseCounter::count(document, UseCounter::CSSSelectorPseudoScrollbar);
+ break;
+ case NoPart:
+ case AllParts:
+ break;
+ }
+}
+
RenderScrollbarPart* RenderScrollbarPart::createAnonymous(Document* document, RenderScrollbar* scrollbar, ScrollbarPart part)
{
RenderScrollbarPart* renderer = new RenderScrollbarPart(scrollbar, part);
+ recordScrollbarPartStats(*document, part);
renderer->setDocumentForAnonymous(document);
return renderer;
}
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698