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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1652983005: Remove Enumeration Histograms from the Blink Platform API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_blink_histograms_5a
Patch Set: Rebase two new histograms were added today Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 24 matching lines...) Expand all
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "core/frame/Settings.h" 36 #include "core/frame/Settings.h"
37 #include "core/inspector/InspectorInstrumentation.h" 37 #include "core/inspector/InspectorInstrumentation.h"
38 #include "core/layout/LayoutView.h" 38 #include "core/layout/LayoutView.h"
39 #include "core/layout/TextAutosizer.h" 39 #include "core/layout/TextAutosizer.h"
40 #include "core/layout/compositing/PaintLayerCompositor.h" 40 #include "core/layout/compositing/PaintLayerCompositor.h"
41 #include "core/loader/FrameLoaderClient.h" 41 #include "core/loader/FrameLoaderClient.h"
42 #include "core/page/ChromeClient.h" 42 #include "core/page/ChromeClient.h"
43 #include "core/page/Page.h" 43 #include "core/page/Page.h"
44 #include "core/page/scrolling/ScrollingCoordinator.h" 44 #include "core/page/scrolling/ScrollingCoordinator.h"
45 #include "platform/Histogram.h"
45 #include "platform/TraceEvent.h" 46 #include "platform/TraceEvent.h"
46 #include "platform/geometry/DoubleRect.h" 47 #include "platform/geometry/DoubleRect.h"
47 #include "platform/geometry/FloatSize.h" 48 #include "platform/geometry/FloatSize.h"
48 #include "platform/graphics/GraphicsLayer.h" 49 #include "platform/graphics/GraphicsLayer.h"
49 #include "platform/graphics/GraphicsLayerFactory.h" 50 #include "platform/graphics/GraphicsLayerFactory.h"
50 #include "platform/scroll/Scrollbar.h" 51 #include "platform/scroll/Scrollbar.h"
51 #include "platform/scroll/ScrollbarThemeOverlay.h" 52 #include "platform/scroll/ScrollbarThemeOverlay.h"
52 #include "public/platform/Platform.h"
53 #include "public/platform/WebCompositorSupport.h" 53 #include "public/platform/WebCompositorSupport.h"
54 #include "public/platform/WebLayer.h" 54 #include "public/platform/WebLayer.h"
55 #include "public/platform/WebLayerTreeView.h" 55 #include "public/platform/WebLayerTreeView.h"
56 #include "public/platform/WebScrollbar.h" 56 #include "public/platform/WebScrollbar.h"
57 #include "public/platform/WebScrollbarLayer.h" 57 #include "public/platform/WebScrollbarLayer.h"
58 58
59 using blink::WebLayer; 59 using blink::WebLayer;
60 using blink::WebLayerTreeView; 60 using blink::WebLayerTreeView;
61 using blink::WebScrollbar; 61 using blink::WebScrollbar;
62 using blink::WebScrollbarLayer; 62 using blink::WebScrollbarLayer;
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 return; 679 return;
680 680
681 m_maxPageScale = std::max(m_maxPageScale, m_scale); 681 m_maxPageScale = std::max(m_maxPageScale, m_scale);
682 } 682 }
683 683
684 void VisualViewport::sendUMAMetrics() 684 void VisualViewport::sendUMAMetrics()
685 { 685 {
686 if (m_trackPinchZoomStatsForPage) { 686 if (m_trackPinchZoomStatsForPage) {
687 bool didScale = m_maxPageScale > 0; 687 bool didScale = m_maxPageScale > 0;
688 688
689 Platform::current()->histogramEnumeration("Viewport.DidScalePage", didSc ale ? 1 : 0, 2); 689 DEFINE_STATIC_LOCAL(EnumerationHistogram, didScaleHistogram, ("Viewport. DidScalePage", 2));
690 didScaleHistogram.count(didScale ? 1 : 0);
690 691
691 if (didScale) { 692 if (didScale) {
692 int zoomPercentage = floor(m_maxPageScale * 100); 693 int zoomPercentage = floor(m_maxPageScale * 100);
693 694
694 // See the PageScaleFactor enumeration in histograms.xml for the buc ket ranges. 695 // See the PageScaleFactor enumeration in histograms.xml for the buc ket ranges.
695 int bucket = floor(zoomPercentage / 25.f); 696 int bucket = floor(zoomPercentage / 25.f);
696 697
697 Platform::current()->histogramEnumeration("Viewport.MaxPageScale", b ucket, 21); 698 DEFINE_STATIC_LOCAL(EnumerationHistogram, maxScaleHistogram, ("Viewp ort.MaxPageScale", 21));
699 maxScaleHistogram.count(bucket);
698 } 700 }
699 } 701 }
700 702
701 m_maxPageScale = -1; 703 m_maxPageScale = -1;
702 m_trackPinchZoomStatsForPage = false; 704 m_trackPinchZoomStatsForPage = false;
703 } 705 }
704 706
705 bool VisualViewport::shouldDisableDesktopWorkarounds() const 707 bool VisualViewport::shouldDisableDesktopWorkarounds() const
706 { 708 {
707 if (!mainFrame() || !mainFrame()->view()) 709 if (!mainFrame() || !mainFrame()->view())
(...skipping 30 matching lines...) Expand all
738 } else if (graphicsLayer == m_rootTransformLayer) { 740 } else if (graphicsLayer == m_rootTransformLayer) {
739 name = "Root Transform Layer"; 741 name = "Root Transform Layer";
740 } else { 742 } else {
741 ASSERT_NOT_REACHED(); 743 ASSERT_NOT_REACHED();
742 } 744 }
743 745
744 return name; 746 return name;
745 } 747 }
746 748
747 } // namespace blink 749 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698