| 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/loader/FrameLoaderTypes.h" | 38 #include "core/loader/FrameLoaderTypes.h" |
| 39 #include "core/timing/PerformanceEntry.h" | 39 #include "core/timing/PerformanceEntry.h" |
| 40 #include "core/timing/PerformanceNavigationTiming.h" | 40 #include "core/timing/PerformanceNavigationTiming.h" |
| 41 #include "core/timing/PerformancePaintTiming.h" |
| 41 #include "platform/Timer.h" | 42 #include "platform/Timer.h" |
| 42 #include "platform/heap/Handle.h" | 43 #include "platform/heap/Handle.h" |
| 43 #include "wtf/Forward.h" | 44 #include "wtf/Forward.h" |
| 44 #include "wtf/HashSet.h" | 45 #include "wtf/HashSet.h" |
| 45 #include "wtf/ListHashSet.h" | 46 #include "wtf/ListHashSet.h" |
| 46 #include "wtf/Vector.h" | 47 #include "wtf/Vector.h" |
| 47 | 48 |
| 48 namespace blink { | 49 namespace blink { |
| 49 | 50 |
| 50 class ExceptionState; | 51 class ExceptionState; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 double endTime, | 104 double endTime, |
| 104 const String& name, | 105 const String& name, |
| 105 const String& culpritFrameSrc, | 106 const String& culpritFrameSrc, |
| 106 const String& culpritFrameId, | 107 const String& culpritFrameId, |
| 107 const String& culpritFrameName); | 108 const String& culpritFrameName); |
| 108 | 109 |
| 109 void addResourceTiming(const ResourceTimingInfo&); | 110 void addResourceTiming(const ResourceTimingInfo&); |
| 110 | 111 |
| 111 void addNavigationTiming(LocalFrame*); | 112 void addNavigationTiming(LocalFrame*); |
| 112 | 113 |
| 114 void addFirstPaintTiming(double startTime); |
| 115 |
| 116 void addFirstContentfulPaintTiming(double startTime); |
| 117 |
| 113 void mark(const String& markName, ExceptionState&); | 118 void mark(const String& markName, ExceptionState&); |
| 114 void clearMarks(const String& markName); | 119 void clearMarks(const String& markName); |
| 115 | 120 |
| 116 void measure(const String& measureName, | 121 void measure(const String& measureName, |
| 117 const String& startMark, | 122 const String& startMark, |
| 118 const String& endMark, | 123 const String& endMark, |
| 119 ExceptionState&); | 124 ExceptionState&); |
| 120 void clearMeasures(const String& measureName); | 125 void clearMeasures(const String& measureName); |
| 121 | 126 |
| 122 void unregisterPerformanceObserver(PerformanceObserver&); | 127 void unregisterPerformanceObserver(PerformanceObserver&); |
| 123 void registerPerformanceObserver(PerformanceObserver&); | 128 void registerPerformanceObserver(PerformanceObserver&); |
| 124 void updatePerformanceObserverFilterOptions(); | 129 void updatePerformanceObserverFilterOptions(); |
| 125 void activateObserver(PerformanceObserver&); | 130 void activateObserver(PerformanceObserver&); |
| 126 void resumeSuspendedObservers(); | 131 void resumeSuspendedObservers(); |
| 127 | 132 |
| 128 DECLARE_VIRTUAL_TRACE(); | 133 DECLARE_VIRTUAL_TRACE(); |
| 129 | 134 |
| 130 private: | 135 private: |
| 131 static PerformanceNavigationTiming::NavigationType getNavigationType( | 136 static PerformanceNavigationTiming::NavigationType getNavigationType( |
| 132 NavigationType, | 137 NavigationType, |
| 133 const Document*); | 138 const Document*); |
| 134 | 139 |
| 140 void addPaintTiming(PerformancePaintTiming::PaintType, double startTime); |
| 141 |
| 135 protected: | 142 protected: |
| 136 explicit PerformanceBase(double timeOrigin); | 143 explicit PerformanceBase(double timeOrigin); |
| 137 | 144 |
| 138 bool isResourceTimingBufferFull(); | 145 bool isResourceTimingBufferFull(); |
| 139 void addResourceTimingBuffer(PerformanceEntry&); | 146 void addResourceTimingBuffer(PerformanceEntry&); |
| 140 | 147 |
| 141 bool isFrameTimingBufferFull(); | 148 bool isFrameTimingBufferFull(); |
| 142 void addFrameTimingBuffer(PerformanceEntry&); | 149 void addFrameTimingBuffer(PerformanceEntry&); |
| 143 | 150 |
| 144 void notifyObserversOfEntry(PerformanceEntry&); | 151 void notifyObserversOfEntry(PerformanceEntry&); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 158 PerformanceEntryTypeMask m_observerFilterOptions; | 165 PerformanceEntryTypeMask m_observerFilterOptions; |
| 159 PerformanceObservers m_observers; | 166 PerformanceObservers m_observers; |
| 160 PerformanceObservers m_activeObservers; | 167 PerformanceObservers m_activeObservers; |
| 161 PerformanceObservers m_suspendedObservers; | 168 PerformanceObservers m_suspendedObservers; |
| 162 Timer<PerformanceBase> m_deliverObservationsTimer; | 169 Timer<PerformanceBase> m_deliverObservationsTimer; |
| 163 }; | 170 }; |
| 164 | 171 |
| 165 } // namespace blink | 172 } // namespace blink |
| 166 | 173 |
| 167 #endif // PerformanceBase_h | 174 #endif // PerformanceBase_h |
| OLD | NEW |