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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1647883004: Support caching histograms so that a lookup isn't done in each iteration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 public: 59 public:
60 HitTestLatencyRecorder(bool allowsChildFrameContent) 60 HitTestLatencyRecorder(bool allowsChildFrameContent)
61 : m_start(WTF::monotonicallyIncreasingTime()) 61 : m_start(WTF::monotonicallyIncreasingTime())
62 , m_allowsChildFrameContent(allowsChildFrameContent) 62 , m_allowsChildFrameContent(allowsChildFrameContent)
63 { 63 {
64 } 64 }
65 65
66 ~HitTestLatencyRecorder() 66 ~HitTestLatencyRecorder()
67 { 67 {
68 int duration = static_cast<int>((WTF::monotonicallyIncreasingTime() - m_ start) * 1000000); 68 int duration = static_cast<int>((WTF::monotonicallyIncreasingTime() - m_ start) * 1000000);
69 Platform::current()->histogramCustomCounts(m_allowsChildFrameContent ? " Event.Latency.HitTestRecursive" : "Event.Latency.HitTest", duration, 0, 10000000 , 100); 69 if (m_allowsChildFrameContent) {
70 static Platform::HistogramCacheSlot histogramCache = 0;
71 Platform::current()->histogramCustomCounts("Event.Latency.HitTestRec ursive", duration, 0, 10000000, 100, &histogramCache);
esprehn 2016/01/29 23:05:40 DEFINE_STATIC_LOCAL(Histogram, hitTestLatency, ("E
72 } else {
73 static Platform::HistogramCacheSlot histogramCache = 0;
74 Platform::current()->histogramCustomCounts("Event.Latency.HitTest", duration, 0, 10000000, 100, &histogramCache);
75 }
70 } 76 }
71 77
72 private: 78 private:
73 double m_start; 79 double m_start;
74 bool m_allowsChildFrameContent; 80 bool m_allowsChildFrameContent;
75 }; 81 };
76 82
77 } // namespace 83 } // namespace
78 84
79 LayoutView::LayoutView(Document* document) 85 LayoutView::LayoutView(Document* document)
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 } 994 }
989 995
990 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect ) 996 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect )
991 { 997 {
992 for (auto& media : m_mediaForPositionNotification) { 998 for (auto& media : m_mediaForPositionNotification) {
993 media->notifyPositionMayHaveChanged(visibleRect); 999 media->notifyPositionMayHaveChanged(visibleRect);
994 } 1000 }
995 } 1001 }
996 1002
997 } // namespace blink 1003 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/HitTestCache.cpp ('k') | third_party/WebKit/public/platform/Platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698