1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef InspectorTraceEvents_h 6 #define InspectorTraceEvents_h 7 8 #include "platform/EventTracer.h" 9 #include "platform/TraceEvent.h" 10 #include "wtf/Forward.h" 11 12 namespace blink { 13 14 class Document; 15 class Event; 16 class ExecutionContext; 17 class FrameView; 18 class GraphicsContext; 19 class GraphicsLayer; 20 class KURL; 21 class LayoutRect; 22 class LocalFrame; 23 class RenderImage; 24 class RenderLayer; 25 class RenderObject; 26 class ResourceRequest; 27 class ResourceResponse; 28 class ScriptSourceCode; 29 class ScriptCallStack; 30 class WorkerThread; 31 class XMLHttpRequest; 32 33 class InspectorLayoutEvent { 34 public: 35 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> beginData(FrameView*); 36 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> endData(RenderObject* rootForThisLayout); 37 }; 38 39 class InspectorLayoutInvalidationTrackingEvent { 40 public: 41 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const RenderObject*); 42 }; 43 44 class InspectorPaintInvalidationTrackingEvent { 45 public: 46 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const RenderObject* renderer, const RenderObject* paintContainer); 47 }; 48 49 class InspectorSendRequestEvent { 50 public: 51 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, LocalFrame*, const ResourceRequest&); 52 }; 53 54 class InspectorReceiveResponseEvent { 55 public: 56 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, LocalFrame*, const ResourceResponse&); 57 }; 58 59 class InspectorReceiveDataEvent { 60 public: 61 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, LocalFrame*, int encodedDataLength); 62 }; 63 64 class InspectorResourceFinishEvent { 65 public: 66 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, double finishTime, bool didFail); 67 }; 68 69 class InspectorTimerInstallEvent { 70 public: 71 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int timerId, int timeout, bool singleShot); 72 }; 73 74 class InspectorTimerRemoveEvent { 75 public: 76 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int timerId); 77 }; 78 79 class InspectorTimerFireEvent { 80 public: 81 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int timerId); 82 }; 83 84 class InspectorAnimationFrameEvent { 85 public: 86 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(Document*, int callbackId); 87 }; 88 89 class InspectorWebSocketCreateEvent { 90 public: 91 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(Document*, unsigned long identifier, const KURL&, const String& protocol); 92 }; 93 94 class InspectorWebSocketEvent { 95 public: 96 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(Document*, unsigned long identifier); 97 }; 98 99 class InspectorParseHtmlEvent { 100 public: 101 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> beginData(Document*, unsigned startLine); 102 }; 103 104 class InspectorXhrReadyStateChangeEvent { 105 public: 106 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, XMLHttpRequest*); 107 }; 108 109 class InspectorXhrLoadEvent { 110 public: 111 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, XMLHttpRequest*); 112 }; 113 114 class InspectorLayerInvalidationTrackingEvent { 115 public: 116 static const char SquashingLayerGeometryWasUpdated[]; 117 static const char AddedToSquashingLayer[]; 118 static const char RemovedFromSquashingLayer[]; 119 static const char ReflectionLayerChanged[]; 120 static const char NewCompositedLayer[]; 121 static const char AncestorRequiresNewLayer[]; 122 123 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const RenderLayer*, const char* reason); 124 }; 125 #define TRACE_LAYER_INVALIDATION(LAYER, REASON) \ 126 TRACE_EVENT_INSTANT1( \ 127 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), \ 128 "LayerInvalidationTracking", \ 129 "data", \ 130 InspectorLayerInvalidationTrackingEvent::data((LAYER), (REASON))) 131 132 class InspectorPaintEvent { 133 public: 134 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(RenderObject*, const LayoutRect& clipRect, const GraphicsLayer*); 135 }; 136 137 class InspectorPaintImageEvent { 138 public: 139 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const RenderImage&); 140 }; 141 142 class InspectorMarkLoadEvent { 143 public: 144 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*); 145 }; 146 147 class InspectorScrollLayerEvent { 148 public: 149 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(RenderObject*); 150 }; 151 152 class InspectorEvaluateScriptEvent { 153 public: 154 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*, const String& url, int lineNumber); 155 }; 156 157 class InspectorFunctionCallEvent { 158 public: 159 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int scriptId, const String& scriptName, int scriptLine); 160 }; 161 162 class InspectorUpdateCountersEvent { 163 public: 164 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(); 165 }; 166 167 class InspectorCallStackEvent { 168 public: 169 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> currentCallStack(); 170 }; 171 172 class InspectorEventDispatchEvent { 173 public: 174 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const Event&); 175 }; 176 177 class InspectorTimeStampEvent { 178 public: 179 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, const String& message); 180 }; 181 182 class InspectorTracingSessionIdForWorkerEvent { 183 public: 184 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const String& sessionId, WorkerThread*); 185 }; 186 187 } // namespace blink 188 189 190 #endif // !defined(InspectorTraceEvents_h) 191