OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 18 matching lines...) Expand all Loading... | |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef PerformanceBase_h | 32 #ifndef PerformanceBase_h |
33 #define PerformanceBase_h | 33 #define PerformanceBase_h |
34 | 34 |
35 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
36 #include "core/dom/DOMHighResTimeStamp.h" | 36 #include "core/dom/DOMHighResTimeStamp.h" |
37 #include "core/events/EventTarget.h" | 37 #include "core/events/EventTarget.h" |
38 #include "core/timing/PerformanceEntry.h" | 38 #include "core/timing/PerformanceEntry.h" |
39 #include "core/timing/PerformancePaintTiming.h" | |
39 #include "platform/Timer.h" | 40 #include "platform/Timer.h" |
40 #include "platform/heap/Handle.h" | 41 #include "platform/heap/Handle.h" |
41 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
42 #include "wtf/HashSet.h" | 43 #include "wtf/HashSet.h" |
43 #include "wtf/ListHashSet.h" | 44 #include "wtf/ListHashSet.h" |
44 #include "wtf/Vector.h" | 45 #include "wtf/Vector.h" |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 class DOMWindow; | 49 class DOMWindow; |
49 class ExceptionState; | 50 class ExceptionState; |
50 class LocalFrame; | 51 class LocalFrame; |
51 class PerformanceObserver; | 52 class PerformanceObserver; |
52 class PerformanceTiming; | 53 class PerformanceTiming; |
53 class ResourceTimingInfo; | 54 class ResourceTimingInfo; |
54 class UserTiming; | 55 class UserTiming; |
55 | 56 |
56 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; | 57 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; |
58 using PerformancePaintTimingEntries = | |
59 HeapHashMap<String, Member<PerformanceEntry>>; | |
57 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; | 60 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; |
58 | 61 |
59 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { | 62 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { |
60 public: | 63 public: |
61 ~PerformanceBase() override; | 64 ~PerformanceBase() override; |
62 | 65 |
63 const AtomicString& interfaceName() const override; | 66 const AtomicString& interfaceName() const override; |
64 | 67 |
65 virtual PerformanceTiming* timing() const; | 68 virtual PerformanceTiming* timing() const; |
66 | 69 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 double endTime, | 103 double endTime, |
101 const String& name, | 104 const String& name, |
102 const String& culpritFrameSrc, | 105 const String& culpritFrameSrc, |
103 const String& culpritFrameId, | 106 const String& culpritFrameId, |
104 const String& culpritFrameName); | 107 const String& culpritFrameName); |
105 | 108 |
106 void addResourceTiming(const ResourceTimingInfo&); | 109 void addResourceTiming(const ResourceTimingInfo&); |
107 | 110 |
108 void addNavigationTiming(LocalFrame*); | 111 void addNavigationTiming(LocalFrame*); |
109 | 112 |
113 void addPaintTiming(PerformancePaintTiming::PaintType, double startTime); | |
114 | |
115 void clearPaintTimingBuffer(); | |
116 | |
110 void mark(const String& markName, ExceptionState&); | 117 void mark(const String& markName, ExceptionState&); |
111 void clearMarks(const String& markName); | 118 void clearMarks(const String& markName); |
112 | 119 |
113 void measure(const String& measureName, | 120 void measure(const String& measureName, |
114 const String& startMark, | 121 const String& startMark, |
115 const String& endMark, | 122 const String& endMark, |
116 ExceptionState&); | 123 ExceptionState&); |
117 void clearMeasures(const String& measureName); | 124 void clearMeasures(const String& measureName); |
118 | 125 |
119 void unregisterPerformanceObserver(PerformanceObserver&); | 126 void unregisterPerformanceObserver(PerformanceObserver&); |
(...skipping 16 matching lines...) Expand all Loading... | |
136 void notifyObserversOfEntry(PerformanceEntry&); | 143 void notifyObserversOfEntry(PerformanceEntry&); |
137 bool hasObserverFor(PerformanceEntry::EntryType) const; | 144 bool hasObserverFor(PerformanceEntry::EntryType) const; |
138 | 145 |
139 void deliverObservationsTimerFired(TimerBase*); | 146 void deliverObservationsTimerFired(TimerBase*); |
140 | 147 |
141 PerformanceEntryVector m_frameTimingBuffer; | 148 PerformanceEntryVector m_frameTimingBuffer; |
142 unsigned m_frameTimingBufferSize; | 149 unsigned m_frameTimingBufferSize; |
143 PerformanceEntryVector m_resourceTimingBuffer; | 150 PerformanceEntryVector m_resourceTimingBuffer; |
144 unsigned m_resourceTimingBufferSize; | 151 unsigned m_resourceTimingBufferSize; |
145 Member<PerformanceEntry> m_navigationTiming; | 152 Member<PerformanceEntry> m_navigationTiming; |
153 PerformancePaintTimingEntries m_paintTimingBuffer; | |
panicker
2016/11/29 22:21:15
This is not supposed to be buffer-able yet due to
sunjian
2016/12/02 21:39:57
Done.
| |
146 Member<UserTiming> m_userTiming; | 154 Member<UserTiming> m_userTiming; |
147 | 155 |
148 double m_timeOrigin; | 156 double m_timeOrigin; |
149 | 157 |
150 PerformanceEntryTypeMask m_observerFilterOptions; | 158 PerformanceEntryTypeMask m_observerFilterOptions; |
151 PerformanceObservers m_observers; | 159 PerformanceObservers m_observers; |
152 PerformanceObservers m_activeObservers; | 160 PerformanceObservers m_activeObservers; |
153 PerformanceObservers m_suspendedObservers; | 161 PerformanceObservers m_suspendedObservers; |
154 Timer<PerformanceBase> m_deliverObservationsTimer; | 162 Timer<PerformanceBase> m_deliverObservationsTimer; |
155 }; | 163 }; |
156 | 164 |
157 } // namespace blink | 165 } // namespace blink |
158 | 166 |
159 #endif // PerformanceBase_h | 167 #endif // PerformanceBase_h |
OLD | NEW |