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 20 matching lines...) Expand all Loading... |
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 "platform/Timer.h" | 39 #include "platform/Timer.h" |
40 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
41 #include "wtf/RefCounted.h" | 41 #include "wtf/Forward.h" |
42 #include "wtf/RefPtr.h" | 42 #include "wtf/HashSet.h" |
43 #include "wtf/text/WTFString.h" | 43 #include "wtf/ListHashSet.h" |
| 44 #include "wtf/Vector.h" |
44 | 45 |
45 namespace blink { | 46 namespace blink { |
46 | 47 |
47 class Document; | 48 class Document; |
48 class ExceptionState; | 49 class ExceptionState; |
49 class PerformanceObserver; | 50 class PerformanceObserver; |
50 class PerformanceTiming; | 51 class PerformanceTiming; |
51 class ResourceTimingInfo; | 52 class ResourceTimingInfo; |
52 class UserTiming; | 53 class UserTiming; |
53 | 54 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 void unregisterPerformanceObserver(PerformanceObserver&); | 106 void unregisterPerformanceObserver(PerformanceObserver&); |
106 void registerPerformanceObserver(PerformanceObserver&); | 107 void registerPerformanceObserver(PerformanceObserver&); |
107 void updatePerformanceObserverFilterOptions(); | 108 void updatePerformanceObserverFilterOptions(); |
108 void activateObserver(PerformanceObserver&); | 109 void activateObserver(PerformanceObserver&); |
109 void resumeSuspendedObservers(); | 110 void resumeSuspendedObservers(); |
110 | 111 |
111 DECLARE_VIRTUAL_TRACE(); | 112 DECLARE_VIRTUAL_TRACE(); |
112 | 113 |
113 protected: | 114 protected: |
| 115 explicit PerformanceBase(double timeOrigin); |
114 | 116 |
115 explicit PerformanceBase(double timeOrigin); | |
116 bool isResourceTimingBufferFull(); | 117 bool isResourceTimingBufferFull(); |
117 void addResourceTimingBuffer(PerformanceEntry&); | 118 void addResourceTimingBuffer(PerformanceEntry&); |
118 | 119 |
119 bool isFrameTimingBufferFull(); | 120 bool isFrameTimingBufferFull(); |
120 void addFrameTimingBuffer(PerformanceEntry&); | 121 void addFrameTimingBuffer(PerformanceEntry&); |
121 | 122 |
122 void notifyObserversOfEntry(PerformanceEntry&); | 123 void notifyObserversOfEntry(PerformanceEntry&); |
123 bool hasObserverFor(PerformanceEntry::EntryType); | 124 bool hasObserverFor(PerformanceEntry::EntryType); |
124 | 125 |
125 void deliverObservationsTimerFired(Timer<PerformanceBase>*); | 126 void deliverObservationsTimerFired(Timer<PerformanceBase>*); |
126 | 127 |
127 PerformanceEntryVector m_frameTimingBuffer; | 128 PerformanceEntryVector m_frameTimingBuffer; |
128 unsigned m_frameTimingBufferSize; | 129 unsigned m_frameTimingBufferSize; |
129 PerformanceEntryVector m_resourceTimingBuffer; | 130 PerformanceEntryVector m_resourceTimingBuffer; |
130 unsigned m_resourceTimingBufferSize; | 131 unsigned m_resourceTimingBufferSize; |
131 double m_timeOrigin; | 132 double m_timeOrigin; |
132 | 133 |
133 Member<UserTiming> m_userTiming; | 134 Member<UserTiming> m_userTiming; |
134 | 135 |
135 PerformanceEntryTypeMask m_observerFilterOptions; | 136 PerformanceEntryTypeMask m_observerFilterOptions; |
136 PerformanceObservers m_observers; | 137 PerformanceObservers m_observers; |
137 PerformanceObservers m_activeObservers; | 138 PerformanceObservers m_activeObservers; |
138 PerformanceObservers m_suspendedObservers; | 139 PerformanceObservers m_suspendedObservers; |
139 Timer<PerformanceBase> m_deliverObservationsTimer; | 140 Timer<PerformanceBase> m_deliverObservationsTimer; |
140 }; | 141 }; |
141 | 142 |
142 } // namespace blink | 143 } // namespace blink |
143 | 144 |
144 #endif // PerformanceBase_h | 145 #endif // PerformanceBase_h |
OLD | NEW |