Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: Source/core/inspector/InspectorTimelineAgent.h

Issue 24027002: DevTools: implement console.timeline/timelineEnd. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comments addressed. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 class Page; 64 class Page;
65 class RenderImage; 65 class RenderImage;
66 class RenderObject; 66 class RenderObject;
67 class ResourceError; 67 class ResourceError;
68 class ResourceLoader; 68 class ResourceLoader;
69 class ResourceRequest; 69 class ResourceRequest;
70 class ResourceResponse; 70 class ResourceResponse;
71 class ScriptArguments; 71 class ScriptArguments;
72 class ScriptCallStack; 72 class ScriptCallStack;
73 class ScriptExecutionContext; 73 class ScriptExecutionContext;
74 class ScriptState;
74 class TimelineTraceEventProcessor; 75 class TimelineTraceEventProcessor;
75 class WebSocketHandshakeRequest; 76 class WebSocketHandshakeRequest;
76 class WebSocketHandshakeResponse; 77 class WebSocketHandshakeResponse;
77 class XMLHttpRequest; 78 class XMLHttpRequest;
78 79
79 typedef String ErrorString; 80 typedef String ErrorString;
80 81
81 namespace TimelineRecordType { 82 namespace TimelineRecordType {
82 extern const char DecodeImage[]; 83 extern const char DecodeImage[];
83 extern const char Rasterize[]; 84 extern const char Rasterize[];
(...skipping 26 matching lines...) Expand all
110 { 111 {
111 return adoptPtr(new InspectorTimelineAgent(instrumentingAgents, pageAgen t, memoryAgent, domAgent, state, type, client)); 112 return adoptPtr(new InspectorTimelineAgent(instrumentingAgents, pageAgen t, memoryAgent, domAgent, state, type, client));
112 } 113 }
113 114
114 ~InspectorTimelineAgent(); 115 ~InspectorTimelineAgent();
115 116
116 virtual void setFrontend(InspectorFrontend*); 117 virtual void setFrontend(InspectorFrontend*);
117 virtual void clearFrontend(); 118 virtual void clearFrontend();
118 virtual void restore(); 119 virtual void restore();
119 120
121 virtual void enable(ErrorString*);
122 virtual void disable(ErrorString*);
120 virtual void start(ErrorString*, const int* maxCallStackDepth, const bool* i ncludeDomCounters, const bool* includeNativeMemoryStatistics); 123 virtual void start(ErrorString*, const int* maxCallStackDepth, const bool* i ncludeDomCounters, const bool* includeNativeMemoryStatistics);
121 virtual void stop(ErrorString*); 124 virtual void stop(ErrorString*);
122 125
123 void setLayerTreeId(int layerTreeId) { m_layerTreeId = layerTreeId; } 126 void setLayerTreeId(int layerTreeId) { m_layerTreeId = layerTreeId; }
124 int layerTreeId() const { return m_layerTreeId; } 127 int layerTreeId() const { return m_layerTreeId; }
125 int id() const { return m_id; } 128 int id() const { return m_id; }
126 129
127 void didCommitLoad(); 130 void didCommitLoad();
128 131
129 // Methods called from WebCore. 132 // Methods called from WebCore.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 void didFireTimer(); 171 void didFireTimer();
169 172
170 bool willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, X MLHttpRequest* request); 173 bool willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, X MLHttpRequest* request);
171 void didDispatchXHRReadyStateChangeEvent(); 174 void didDispatchXHRReadyStateChangeEvent();
172 bool willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpReques t* request); 175 bool willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpReques t* request);
173 void didDispatchXHRLoadEvent(); 176 void didDispatchXHRLoadEvent();
174 177
175 bool willEvaluateScript(Frame*, const String&, int); 178 bool willEvaluateScript(Frame*, const String&, int);
176 void didEvaluateScript(); 179 void didEvaluateScript();
177 180
178 void consoleTimeStamp(ScriptExecutionContext*, PassRefPtr<ScriptArguments>); 181 void consoleTimeStamp(ScriptExecutionContext*, const String& title);
179 void domContentLoadedEventFired(Frame*); 182 void domContentLoadedEventFired(Frame*);
180 void loadEventFired(Frame*); 183 void loadEventFired(Frame*);
181 184
182 void startConsoleTiming(ScriptExecutionContext*, const String&); 185 void consoleTime(ScriptExecutionContext*, const String&);
183 void stopConsoleTiming(ScriptExecutionContext*, const String&, PassRefPtr<Sc riptCallStack>); 186 void consoleTimeEnd(ScriptExecutionContext*, const String&, ScriptState*);
187 void consoleTimeline(ScriptExecutionContext*, const String& title, ScriptSta te*);
188 void consoleTimelineEnd(ScriptExecutionContext*, const String& title, Script State*);
184 189
185 void didScheduleResourceRequest(Document*, const String& url); 190 void didScheduleResourceRequest(Document*, const String& url);
186 void willSendRequest(unsigned long, DocumentLoader*, const ResourceRequest&, const ResourceResponse&, const FetchInitiatorInfo&); 191 void willSendRequest(unsigned long, DocumentLoader*, const ResourceRequest&, const ResourceResponse&, const FetchInitiatorInfo&);
187 bool willReceiveResourceResponse(Frame*, unsigned long, const ResourceRespon se&); 192 bool willReceiveResourceResponse(Frame*, unsigned long, const ResourceRespon se&);
188 void didReceiveResourceResponse(unsigned long, DocumentLoader*, const Resour ceResponse&, ResourceLoader*); 193 void didReceiveResourceResponse(unsigned long, DocumentLoader*, const Resour ceResponse&, ResourceLoader*);
189 void didFinishLoading(unsigned long, DocumentLoader*, double monotonicFinish Time); 194 void didFinishLoading(unsigned long, DocumentLoader*, double monotonicFinish Time);
190 void didFailLoading(unsigned long identifier, DocumentLoader* loader, const ResourceError& error); 195 void didFailLoading(unsigned long identifier, DocumentLoader* loader, const ResourceError& error);
191 bool willReceiveResourceData(Frame*, unsigned long identifier, int length); 196 bool willReceiveResourceData(Frame*, unsigned long identifier, int length);
192 void didReceiveResourceData(); 197 void didReceiveResourceData();
193 198
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void clearRecordStack(); 257 void clearRecordStack();
253 258
254 void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQ uad*); 259 void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQ uad*);
255 const TimelineTimeConverter& timeConverter() const { return m_timeConverter; } 260 const TimelineTimeConverter& timeConverter() const { return m_timeConverter; }
256 long long idForNode(Node*); 261 long long idForNode(Node*);
257 void releaseNodeIds(); 262 void releaseNodeIds();
258 263
259 double timestamp(); 264 double timestamp();
260 Page* page(); 265 Page* page();
261 266
267 bool isStarted();
268 void innerStart();
269 void innerStop(bool fromConsole);
270
262 InspectorPageAgent* m_pageAgent; 271 InspectorPageAgent* m_pageAgent;
263 InspectorMemoryAgent* m_memoryAgent; 272 InspectorMemoryAgent* m_memoryAgent;
264 InspectorDOMAgent* m_domAgent; 273 InspectorDOMAgent* m_domAgent;
265 TimelineTimeConverter m_timeConverter; 274 TimelineTimeConverter m_timeConverter;
266 275
267 InspectorFrontend::Timeline* m_frontend; 276 InspectorFrontend::Timeline* m_frontend;
268 double m_timestampOffset; 277 double m_timestampOffset;
269 278
270 Vector<TimelineRecordEntry> m_recordStack; 279 Vector<TimelineRecordEntry> m_recordStack;
271 280
(...skipping 12 matching lines...) Expand all
284 int m_maxCallStackDepth; 293 int m_maxCallStackDepth;
285 unsigned m_platformInstrumentationClientInstalledAtStackDepth; 294 unsigned m_platformInstrumentationClientInstalledAtStackDepth;
286 RefPtr<JSONObject> m_pendingFrameRecord; 295 RefPtr<JSONObject> m_pendingFrameRecord;
287 InspectorType m_inspectorType; 296 InspectorType m_inspectorType;
288 InspectorClient* m_client; 297 InspectorClient* m_client;
289 WeakPtrFactory<InspectorTimelineAgent> m_weakFactory; 298 WeakPtrFactory<InspectorTimelineAgent> m_weakFactory;
290 RefPtr<TimelineTraceEventProcessor> m_traceEventProcessor; 299 RefPtr<TimelineTraceEventProcessor> m_traceEventProcessor;
291 unsigned m_styleRecalcElementCounter; 300 unsigned m_styleRecalcElementCounter;
292 int m_layerTreeId; 301 int m_layerTreeId;
293 RenderImage* m_imageBeingPainted; 302 RenderImage* m_imageBeingPainted;
303 Vector<String> m_consoleTimelines;
294 }; 304 };
295 305
296 } // namespace WebCore 306 } // namespace WebCore
297 307
298 #endif // !defined(InspectorTimelineAgent_h) 308 #endif // !defined(InspectorTimelineAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698