Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
| 41 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
| 42 #include "wtf/HashSet.h" | 42 #include "wtf/HashSet.h" |
| 43 #include "wtf/ListHashSet.h" | 43 #include "wtf/ListHashSet.h" |
| 44 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class DOMWindow; | 48 class DOMWindow; |
| 49 class Document; | 49 class Document; |
| 50 class DocumentLoader; | |
| 51 class DocumentLoadTiming; | |
| 52 class DocumentTiming; | |
| 50 class ExceptionState; | 53 class ExceptionState; |
| 54 class LocalFrame; | |
| 51 class PerformanceObserver; | 55 class PerformanceObserver; |
| 52 class PerformanceTiming; | 56 class PerformanceTiming; |
| 53 class ResourceTimingInfo; | 57 class ResourceTimingInfo; |
| 54 class UserTiming; | 58 class UserTiming; |
| 55 | 59 |
| 56 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; | 60 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; |
| 57 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; | 61 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; |
| 58 | 62 |
| 59 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { | 63 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { |
| 60 public: | 64 public: |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 79 DOMHighResTimeStamp now() const; | 83 DOMHighResTimeStamp now() const; |
| 80 | 84 |
| 81 double timeOrigin() const { return m_timeOrigin; } | 85 double timeOrigin() const { return m_timeOrigin; } |
| 82 | 86 |
| 83 PerformanceEntryVector getEntries() const; | 87 PerformanceEntryVector getEntries() const; |
| 84 PerformanceEntryVector getEntriesByType(const String& entryType); | 88 PerformanceEntryVector getEntriesByType(const String& entryType); |
| 85 PerformanceEntryVector getEntriesByName(const String& name, | 89 PerformanceEntryVector getEntriesByName(const String& name, |
| 86 const String& entryType); | 90 const String& entryType); |
| 87 | 91 |
| 88 void clearResourceTimings(); | 92 void clearResourceTimings(); |
| 93 void clearNavigationTimings(); | |
| 89 void setResourceTimingBufferSize(unsigned); | 94 void setResourceTimingBufferSize(unsigned); |
| 90 | 95 |
| 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(resourcetimingbufferfull); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(resourcetimingbufferfull); |
| 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitresourcetimingbufferfull); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitresourcetimingbufferfull); |
| 93 | 98 |
| 94 void clearFrameTimings(); | 99 void clearFrameTimings(); |
| 95 void setFrameTimingBufferSize(unsigned); | 100 void setFrameTimingBufferSize(unsigned); |
| 96 | 101 |
| 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(frametimingbufferfull); | 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(frametimingbufferfull); |
| 98 | 103 |
| 99 void addLongTaskTiming(double, double, const String&, DOMWindow*); | 104 void addLongTaskTiming(double, double, const String&, DOMWindow*); |
| 100 | 105 |
| 101 void addResourceTiming(const ResourceTimingInfo&); | 106 void addResourceTiming(const ResourceTimingInfo&); |
| 102 | 107 |
| 108 void addNavigationTiming(LocalFrame*); | |
| 109 | |
| 103 void mark(const String& markName, ExceptionState&); | 110 void mark(const String& markName, ExceptionState&); |
| 104 void clearMarks(const String& markName); | 111 void clearMarks(const String& markName); |
| 105 | 112 |
| 106 void measure(const String& measureName, | 113 void measure(const String& measureName, |
| 107 const String& startMark, | 114 const String& startMark, |
| 108 const String& endMark, | 115 const String& endMark, |
| 109 ExceptionState&); | 116 ExceptionState&); |
| 110 void clearMeasures(const String& measureName); | 117 void clearMeasures(const String& measureName); |
| 111 | 118 |
| 112 void unregisterPerformanceObserver(PerformanceObserver&); | 119 void unregisterPerformanceObserver(PerformanceObserver&); |
| 113 void registerPerformanceObserver(PerformanceObserver&); | 120 void registerPerformanceObserver(PerformanceObserver&); |
| 114 void updatePerformanceObserverFilterOptions(); | 121 void updatePerformanceObserverFilterOptions(); |
| 115 void activateObserver(PerformanceObserver&); | 122 void activateObserver(PerformanceObserver&); |
| 116 void resumeSuspendedObservers(); | 123 void resumeSuspendedObservers(); |
| 117 | 124 |
| 125 static const DocumentLoader* documentLoader(LocalFrame*); | |
|
panicker
2016/11/02 20:12:37
why are these public?
Prefer moving them to anonym
sunjian
2016/11/04 01:12:39
Done.
| |
| 126 static const DocumentLoadTiming* documentLoadTiming(LocalFrame*); | |
| 127 static const DocumentTiming* documentTiming(LocalFrame*); | |
| 128 static AtomicString getNavigationType(LocalFrame*); | |
| 129 | |
| 118 DECLARE_VIRTUAL_TRACE(); | 130 DECLARE_VIRTUAL_TRACE(); |
| 119 | 131 |
| 120 protected: | 132 protected: |
| 121 explicit PerformanceBase(double timeOrigin); | 133 explicit PerformanceBase(double timeOrigin); |
| 122 | 134 |
| 123 bool isResourceTimingBufferFull(); | 135 bool isResourceTimingBufferFull(); |
| 124 void addResourceTimingBuffer(PerformanceEntry&); | 136 void addResourceTimingBuffer(PerformanceEntry&); |
| 125 | 137 |
| 126 bool isFrameTimingBufferFull(); | 138 bool isFrameTimingBufferFull(); |
| 127 void addFrameTimingBuffer(PerformanceEntry&); | 139 void addFrameTimingBuffer(PerformanceEntry&); |
| 128 | 140 |
| 129 void notifyObserversOfEntry(PerformanceEntry&); | 141 void notifyObserversOfEntry(PerformanceEntry&); |
| 130 bool hasObserverFor(PerformanceEntry::EntryType) const; | 142 bool hasObserverFor(PerformanceEntry::EntryType) const; |
| 131 | 143 |
| 132 void deliverObservationsTimerFired(TimerBase*); | 144 void deliverObservationsTimerFired(TimerBase*); |
| 133 | 145 |
| 134 PerformanceEntryVector m_frameTimingBuffer; | 146 PerformanceEntryVector m_frameTimingBuffer; |
| 135 unsigned m_frameTimingBufferSize; | 147 unsigned m_frameTimingBufferSize; |
| 136 PerformanceEntryVector m_resourceTimingBuffer; | 148 PerformanceEntryVector m_resourceTimingBuffer; |
| 137 unsigned m_resourceTimingBufferSize; | 149 unsigned m_resourceTimingBufferSize; |
| 150 PerformanceEntryVector m_navigationTimingBuffer; | |
| 138 Member<UserTiming> m_userTiming; | 151 Member<UserTiming> m_userTiming; |
| 139 | 152 |
| 140 double m_timeOrigin; | 153 double m_timeOrigin; |
| 141 | 154 |
| 142 PerformanceEntryTypeMask m_observerFilterOptions; | 155 PerformanceEntryTypeMask m_observerFilterOptions; |
| 143 PerformanceObservers m_observers; | 156 PerformanceObservers m_observers; |
| 144 PerformanceObservers m_activeObservers; | 157 PerformanceObservers m_activeObservers; |
| 145 PerformanceObservers m_suspendedObservers; | 158 PerformanceObservers m_suspendedObservers; |
| 146 Timer<PerformanceBase> m_deliverObservationsTimer; | 159 Timer<PerformanceBase> m_deliverObservationsTimer; |
| 147 }; | 160 }; |
| 148 | 161 |
| 149 } // namespace blink | 162 } // namespace blink |
| 150 | 163 |
| 151 #endif // PerformanceBase_h | 164 #endif // PerformanceBase_h |
| OLD | NEW |