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 21 matching lines...) Expand all Loading... | |
| 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 "core/timing/PerformancePaintTiming.h" |
| 42 #include "core/timing/PerformanceServerTiming.h" | |
| 42 #include "platform/Timer.h" | 43 #include "platform/Timer.h" |
| 43 #include "platform/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
| 44 #include "platform/wtf/Forward.h" | 45 #include "platform/wtf/Forward.h" |
| 45 #include "platform/wtf/HashSet.h" | 46 #include "platform/wtf/HashSet.h" |
| 46 #include "platform/wtf/ListHashSet.h" | 47 #include "platform/wtf/ListHashSet.h" |
| 47 #include "platform/wtf/Vector.h" | 48 #include "platform/wtf/Vector.h" |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 class ExceptionState; | 52 class ExceptionState; |
| 52 class PerformanceObserver; | 53 class PerformanceObserver; |
| 53 class PerformanceTiming; | 54 class PerformanceTiming; |
| 54 class ResourceResponse; | 55 class ResourceResponse; |
| 55 class ResourceTimingInfo; | 56 class ResourceTimingInfo; |
| 56 class SecurityOrigin; | 57 class SecurityOrigin; |
| 57 class UserTiming; | 58 class UserTiming; |
| 58 | 59 |
| 59 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; | 60 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; |
| 60 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; | 61 using PerformanceObservers = HeapListHashSet<Member<PerformanceObserver>>; |
| 62 using PerformanceServerTimingVector = | |
| 63 HeapVector<Member<PerformanceServerTiming>>; | |
|
Yoav Weiss
2017/06/29 06:57:33
Remove the definition from here.
| |
| 61 | 64 |
| 62 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { | 65 class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData { |
| 63 | 66 |
| 64 public: | 67 public: |
| 65 ~PerformanceBase() override; | 68 ~PerformanceBase() override; |
| 66 | 69 |
| 67 const AtomicString& InterfaceName() const override; | 70 const AtomicString& InterfaceName() const override; |
| 68 | 71 |
| 69 virtual PerformanceTiming* timing() const; | 72 virtual PerformanceTiming* timing() const; |
| 70 | 73 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 | 108 |
| 106 void AddLongTaskTiming(double start_time, | 109 void AddLongTaskTiming(double start_time, |
| 107 double end_time, | 110 double end_time, |
| 108 const String& name, | 111 const String& name, |
| 109 const String& culprit_frame_src, | 112 const String& culprit_frame_src, |
| 110 const String& culprit_frame_id, | 113 const String& culprit_frame_id, |
| 111 const String& culprit_frame_name); | 114 const String& culprit_frame_name); |
| 112 | 115 |
| 113 void AddResourceTiming(const ResourceTimingInfo&); | 116 void AddResourceTiming(const ResourceTimingInfo&); |
| 114 | 117 |
| 115 enum class ShouldAddToBuffer { | |
| 116 Always, | |
| 117 Never, | |
| 118 }; | |
| 119 void AddServerTiming(const ResourceResponse&, ShouldAddToBuffer); | |
| 120 | |
| 121 void NotifyNavigationTimingToObservers(); | 118 void NotifyNavigationTimingToObservers(); |
| 122 | 119 |
| 123 void AddFirstPaintTiming(double start_time); | 120 void AddFirstPaintTiming(double start_time); |
| 124 | 121 |
| 125 void AddFirstContentfulPaintTiming(double start_time); | 122 void AddFirstContentfulPaintTiming(double start_time); |
| 126 | 123 |
| 127 void mark(const String& mark_name, ExceptionState&); | 124 void mark(const String& mark_name, ExceptionState&); |
| 128 void clearMarks(const String& mark_name); | 125 void clearMarks(const String& mark_name); |
| 129 | 126 |
| 130 void measure(const String& measure_name, | 127 void measure(const String& measure_name, |
| 131 const String& start_mark, | 128 const String& start_mark, |
| 132 const String& end_mark, | 129 const String& end_mark, |
| 133 ExceptionState&); | 130 ExceptionState&); |
| 134 void clearMeasures(const String& measure_name); | 131 void clearMeasures(const String& measure_name); |
| 135 | 132 |
| 136 void UnregisterPerformanceObserver(PerformanceObserver&); | 133 void UnregisterPerformanceObserver(PerformanceObserver&); |
| 137 void RegisterPerformanceObserver(PerformanceObserver&); | 134 void RegisterPerformanceObserver(PerformanceObserver&); |
| 138 void UpdatePerformanceObserverFilterOptions(); | 135 void UpdatePerformanceObserverFilterOptions(); |
| 139 void ActivateObserver(PerformanceObserver&); | 136 void ActivateObserver(PerformanceObserver&); |
| 140 void ResumeSuspendedObservers(); | 137 void ResumeSuspendedObservers(); |
| 141 | 138 |
| 142 static bool AllowsTimingRedirect(const Vector<ResourceResponse>&, | 139 static bool AllowsTimingRedirect(const Vector<ResourceResponse>&, |
| 143 const ResourceResponse&, | 140 const ResourceResponse&, |
| 144 const SecurityOrigin&, | 141 const SecurityOrigin&, |
| 145 ExecutionContext*); | 142 ExecutionContext*); |
| 143 static PerformanceServerTimingVector ParseServerTiming( | |
| 144 const ResourceTimingInfo&, | |
| 145 bool allowTimingDetails); | |
| 146 | 146 |
| 147 DECLARE_VIRTUAL_TRACE(); | 147 DECLARE_VIRTUAL_TRACE(); |
| 148 | 148 |
| 149 private: | 149 private: |
| 150 static bool PassesTimingAllowCheck(const ResourceResponse&, | 150 static bool PassesTimingAllowCheck(const ResourceResponse&, |
| 151 const SecurityOrigin&, | 151 const SecurityOrigin&, |
| 152 const AtomicString&, | 152 const AtomicString&, |
| 153 ExecutionContext*); | 153 ExecutionContext*); |
| 154 | 154 |
| 155 void AddPaintTiming(PerformancePaintTiming::PaintType, double start_time); | 155 void AddPaintTiming(PerformancePaintTiming::PaintType, double start_time); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 172 void NotifyObserversOfEntry(PerformanceEntry&); | 172 void NotifyObserversOfEntry(PerformanceEntry&); |
| 173 void NotifyObserversOfEntries(PerformanceEntryVector&); | 173 void NotifyObserversOfEntries(PerformanceEntryVector&); |
| 174 bool HasObserverFor(PerformanceEntry::EntryType) const; | 174 bool HasObserverFor(PerformanceEntry::EntryType) const; |
| 175 | 175 |
| 176 void DeliverObservationsTimerFired(TimerBase*); | 176 void DeliverObservationsTimerFired(TimerBase*); |
| 177 | 177 |
| 178 PerformanceEntryVector frame_timing_buffer_; | 178 PerformanceEntryVector frame_timing_buffer_; |
| 179 unsigned frame_timing_buffer_size_; | 179 unsigned frame_timing_buffer_size_; |
| 180 PerformanceEntryVector resource_timing_buffer_; | 180 PerformanceEntryVector resource_timing_buffer_; |
| 181 unsigned resource_timing_buffer_size_; | 181 unsigned resource_timing_buffer_size_; |
| 182 PerformanceEntryVector server_timing_buffer_; | |
| 183 Member<PerformanceEntry> navigation_timing_; | 182 Member<PerformanceEntry> navigation_timing_; |
| 184 Member<UserTiming> user_timing_; | 183 Member<UserTiming> user_timing_; |
| 185 Member<PerformanceEntry> first_paint_timing_; | 184 Member<PerformanceEntry> first_paint_timing_; |
| 186 Member<PerformanceEntry> first_contentful_paint_timing_; | 185 Member<PerformanceEntry> first_contentful_paint_timing_; |
| 187 | 186 |
| 188 double time_origin_; | 187 double time_origin_; |
| 189 | 188 |
| 190 PerformanceEntryTypeMask observer_filter_options_; | 189 PerformanceEntryTypeMask observer_filter_options_; |
| 191 PerformanceObservers observers_; | 190 PerformanceObservers observers_; |
| 192 PerformanceObservers active_observers_; | 191 PerformanceObservers active_observers_; |
| 193 PerformanceObservers suspended_observers_; | 192 PerformanceObservers suspended_observers_; |
| 194 TaskRunnerTimer<PerformanceBase> deliver_observations_timer_; | 193 TaskRunnerTimer<PerformanceBase> deliver_observations_timer_; |
| 195 }; | 194 }; |
| 196 | 195 |
| 197 } // namespace blink | 196 } // namespace blink |
| 198 | 197 |
| 199 #endif // PerformanceBase_h | 198 #endif // PerformanceBase_h |
| OLD | NEW |