| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; | 56 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; |
| 57 | 57 |
| 58 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { | 58 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { |
| 59 public: | 59 public: |
| 60 ~PerformanceBase() override; | 60 ~PerformanceBase() override; |
| 61 | 61 |
| 62 const AtomicString& interfaceName() const override; | 62 const AtomicString& interfaceName() const override; |
| 63 | 63 |
| 64 virtual PerformanceTiming* timing() const; | 64 virtual PerformanceTiming* timing() const; |
| 65 | 65 |
| 66 virtual void updateLongTaskInstrumentation() {} |
| 67 |
| 66 // Reduce the resolution to 5µs to prevent timing attacks. See: | 68 // Reduce the resolution to 5µs to prevent timing attacks. See: |
| 67 // http://www.w3.org/TR/hr-time-2/#privacy-security | 69 // http://www.w3.org/TR/hr-time-2/#privacy-security |
| 68 static double clampTimeResolution(double timeSeconds); | 70 static double clampTimeResolution(double timeSeconds); |
| 69 | 71 |
| 70 // Translate given platform monotonic time in seconds into a high resolution | 72 // Translate given platform monotonic time in seconds into a high resolution |
| 71 // DOMHighResTimeStamp in milliseconds. The result timestamp is relative to | 73 // DOMHighResTimeStamp in milliseconds. The result timestamp is relative to |
| 72 // document's time origin and has a time resolution that is safe for | 74 // document's time origin and has a time resolution that is safe for |
| 73 // exposing to web. | 75 // exposing to web. |
| 74 DOMHighResTimeStamp monotonicTimeToDOMHighResTimeStamp(double) const; | 76 DOMHighResTimeStamp monotonicTimeToDOMHighResTimeStamp(double) const; |
| 75 double monotonicTimeToDOMHighResTimeStampInMillis(DOMHighResTimeStamp) const
; | 77 double monotonicTimeToDOMHighResTimeStampInMillis(DOMHighResTimeStamp) const
; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool isResourceTimingBufferFull(); | 127 bool isResourceTimingBufferFull(); |
| 126 void addResourceTimingBuffer(PerformanceEntry&); | 128 void addResourceTimingBuffer(PerformanceEntry&); |
| 127 | 129 |
| 128 bool isFrameTimingBufferFull(); | 130 bool isFrameTimingBufferFull(); |
| 129 void addFrameTimingBuffer(PerformanceEntry&); | 131 void addFrameTimingBuffer(PerformanceEntry&); |
| 130 | 132 |
| 131 bool isLongTaskTimingBufferFull(); | 133 bool isLongTaskTimingBufferFull(); |
| 132 void addLongTaskTimingBuffer(PerformanceEntry&); | 134 void addLongTaskTimingBuffer(PerformanceEntry&); |
| 133 | 135 |
| 134 void notifyObserversOfEntry(PerformanceEntry&); | 136 void notifyObserversOfEntry(PerformanceEntry&); |
| 135 bool hasObserverFor(PerformanceEntry::EntryType); | 137 bool hasObserverFor(PerformanceEntry::EntryType) const; |
| 136 | 138 |
| 137 void deliverObservationsTimerFired(TimerBase*); | 139 void deliverObservationsTimerFired(TimerBase*); |
| 138 | 140 |
| 139 PerformanceEntryVector m_frameTimingBuffer; | 141 PerformanceEntryVector m_frameTimingBuffer; |
| 140 unsigned m_frameTimingBufferSize; | 142 unsigned m_frameTimingBufferSize; |
| 141 PerformanceEntryVector m_resourceTimingBuffer; | 143 PerformanceEntryVector m_resourceTimingBuffer; |
| 142 unsigned m_resourceTimingBufferSize; | 144 unsigned m_resourceTimingBufferSize; |
| 143 PerformanceEntryVector m_longTaskTimingBuffer; | 145 PerformanceEntryVector m_longTaskTimingBuffer; |
| 144 unsigned m_longTaskTimingBufferSize; | 146 unsigned m_longTaskTimingBufferSize; |
| 145 Member<UserTiming> m_userTiming; | 147 Member<UserTiming> m_userTiming; |
| 146 | 148 |
| 147 double m_timeOrigin; | 149 double m_timeOrigin; |
| 148 | 150 |
| 149 PerformanceEntryTypeMask m_observerFilterOptions; | 151 PerformanceEntryTypeMask m_observerFilterOptions; |
| 150 PerformanceObservers m_observers; | 152 PerformanceObservers m_observers; |
| 151 PerformanceObservers m_activeObservers; | 153 PerformanceObservers m_activeObservers; |
| 152 PerformanceObservers m_suspendedObservers; | 154 PerformanceObservers m_suspendedObservers; |
| 153 Timer<PerformanceBase> m_deliverObservationsTimer; | 155 Timer<PerformanceBase> m_deliverObservationsTimer; |
| 154 }; | 156 }; |
| 155 | 157 |
| 156 } // namespace blink | 158 } // namespace blink |
| 157 | 159 |
| 158 #endif // PerformanceBase_h | 160 #endif // PerformanceBase_h |
| OLD | NEW |