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

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

Issue 46663010: DevTools: Show GPU utilization bar on timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tune PID to hue magic const Created 7 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "wtf/CurrentTime.h" 59 #include "wtf/CurrentTime.h"
60 60
61 namespace WebCore { 61 namespace WebCore {
62 62
63 namespace TimelineAgentState { 63 namespace TimelineAgentState {
64 static const char enabled[] = "enabled"; 64 static const char enabled[] = "enabled";
65 static const char started[] = "started"; 65 static const char started[] = "started";
66 static const char startedFromProtocol[] = "startedFromProtocol"; 66 static const char startedFromProtocol[] = "startedFromProtocol";
67 static const char timelineMaxCallStackDepth[] = "timelineMaxCallStackDepth"; 67 static const char timelineMaxCallStackDepth[] = "timelineMaxCallStackDepth";
68 static const char includeDomCounters[] = "includeDomCounters"; 68 static const char includeDomCounters[] = "includeDomCounters";
69 static const char includeGPUEvents[] = "includeGPUEvents";
69 static const char bufferEvents[] = "bufferEvents"; 70 static const char bufferEvents[] = "bufferEvents";
70 } 71 }
71 72
72 // Must be kept in sync with WebInspector.TimelineModel.RecordType in TimelineMo del.js 73 // Must be kept in sync with WebInspector.TimelineModel.RecordType in TimelineMo del.js
73 namespace TimelineRecordType { 74 namespace TimelineRecordType {
74 static const char Program[] = "Program"; 75 static const char Program[] = "Program";
75 76
76 static const char EventDispatch[] = "EventDispatch"; 77 static const char EventDispatch[] = "EventDispatch";
77 static const char BeginFrame[] = "BeginFrame"; 78 static const char BeginFrame[] = "BeginFrame";
78 static const char ScheduleStyleRecalculation[] = "ScheduleStyleRecalculation"; 79 static const char ScheduleStyleRecalculation[] = "ScheduleStyleRecalculation";
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 static const char WebSocketCreate[] = "WebSocketCreate"; 120 static const char WebSocketCreate[] = "WebSocketCreate";
120 static const char WebSocketSendHandshakeRequest[] = "WebSocketSendHandshakeReque st"; 121 static const char WebSocketSendHandshakeRequest[] = "WebSocketSendHandshakeReque st";
121 static const char WebSocketReceiveHandshakeResponse[] = "WebSocketReceiveHandsha keResponse"; 122 static const char WebSocketReceiveHandshakeResponse[] = "WebSocketReceiveHandsha keResponse";
122 static const char WebSocketDestroy[] = "WebSocketDestroy"; 123 static const char WebSocketDestroy[] = "WebSocketDestroy";
123 124
124 // Event names visible to other modules. 125 // Event names visible to other modules.
125 const char DecodeImage[] = "DecodeImage"; 126 const char DecodeImage[] = "DecodeImage";
126 const char Rasterize[] = "Rasterize"; 127 const char Rasterize[] = "Rasterize";
127 const char PaintSetup[] = "PaintSetup"; 128 const char PaintSetup[] = "PaintSetup";
129 const char GPUTask[] = "GPUTask";
128 } 130 }
129 131
130 namespace { 132 namespace {
131 const char BackendNodeIdGroup[] = "timeline"; 133 const char BackendNodeIdGroup[] = "timeline";
132 const char InternalEventCategory[] = "instrumentation"; 134 const char InternalEventCategory[] = "instrumentation";
133 } 135 }
134 136
135 static Frame* frameForExecutionContext(ExecutionContext* context) 137 static Frame* frameForExecutionContext(ExecutionContext* context)
136 { 138 {
137 Frame* frame = 0; 139 Frame* frame = 0;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 void InspectorTimelineAgent::enable(ErrorString*) 220 void InspectorTimelineAgent::enable(ErrorString*)
219 { 221 {
220 m_state->setBoolean(TimelineAgentState::enabled, true); 222 m_state->setBoolean(TimelineAgentState::enabled, true);
221 } 223 }
222 224
223 void InspectorTimelineAgent::disable(ErrorString*) 225 void InspectorTimelineAgent::disable(ErrorString*)
224 { 226 {
225 m_state->setBoolean(TimelineAgentState::enabled, false); 227 m_state->setBoolean(TimelineAgentState::enabled, false);
226 } 228 }
227 229
228 void InspectorTimelineAgent::start(ErrorString* errorString, const int* maxCallS tackDepth, const bool* bufferEvents, const bool* includeDomCounters) 230 void InspectorTimelineAgent::start(ErrorString* errorString, const int* maxCallS tackDepth, const bool* bufferEvents, const bool* includeDomCounters, const bool* includeGPUEvents)
229 { 231 {
230 if (!m_frontend) 232 if (!m_frontend)
231 return; 233 return;
232 m_state->setBoolean(TimelineAgentState::startedFromProtocol, true); 234 m_state->setBoolean(TimelineAgentState::startedFromProtocol, true);
233 235
234 if (isStarted()) { 236 if (isStarted()) {
235 *errorString = "Timeline is already started"; 237 *errorString = "Timeline is already started";
236 return; 238 return;
237 } 239 }
238 240
239 releaseNodeIds(); 241 releaseNodeIds();
240 if (maxCallStackDepth && *maxCallStackDepth >= 0) 242 if (maxCallStackDepth && *maxCallStackDepth >= 0)
241 m_maxCallStackDepth = *maxCallStackDepth; 243 m_maxCallStackDepth = *maxCallStackDepth;
242 else 244 else
243 m_maxCallStackDepth = 5; 245 m_maxCallStackDepth = 5;
244 246
245 if (bufferEvents && *bufferEvents) 247 if (bufferEvents && *bufferEvents)
246 m_bufferedEvents = TypeBuilder::Array<TypeBuilder::Timeline::TimelineEve nt>::create(); 248 m_bufferedEvents = TypeBuilder::Array<TypeBuilder::Timeline::TimelineEve nt>::create();
247 249
248 m_state->setLong(TimelineAgentState::timelineMaxCallStackDepth, m_maxCallSta ckDepth); 250 m_state->setLong(TimelineAgentState::timelineMaxCallStackDepth, m_maxCallSta ckDepth);
249 m_state->setBoolean(TimelineAgentState::includeDomCounters, includeDomCounte rs && *includeDomCounters); 251 m_state->setBoolean(TimelineAgentState::includeDomCounters, includeDomCounte rs && *includeDomCounters);
252 m_state->setBoolean(TimelineAgentState::includeGPUEvents, includeGPUEvents & & *includeGPUEvents);
250 m_state->setBoolean(TimelineAgentState::bufferEvents, bufferEvents && *buffe rEvents); 253 m_state->setBoolean(TimelineAgentState::bufferEvents, bufferEvents && *buffe rEvents);
251 254
252 innerStart(); 255 innerStart();
253 bool fromConsole = false; 256 bool fromConsole = false;
254 m_frontend->started(&fromConsole); 257 m_frontend->started(&fromConsole);
255 } 258 }
256 259
257 bool InspectorTimelineAgent::isStarted() 260 bool InspectorTimelineAgent::isStarted()
258 { 261 {
259 return m_state->getBoolean(TimelineAgentState::started); 262 return m_state->getBoolean(TimelineAgentState::started);
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 double InspectorTimelineAgent::timestamp() 953 double InspectorTimelineAgent::timestamp()
951 { 954 {
952 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime()); 955 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime());
953 } 956 }
954 957
955 Page* InspectorTimelineAgent::page() 958 Page* InspectorTimelineAgent::page()
956 { 959 {
957 return m_pageAgent ? m_pageAgent->page() : 0; 960 return m_pageAgent ? m_pageAgent->page() : 0;
958 } 961 }
959 962
963 bool InspectorTimelineAgent::isCollectingGPUEvents() const
964 {
965 return m_state->getBoolean(TimelineAgentState::includeGPUEvents);
966 }
967
960 } // namespace WebCore 968 } // namespace WebCore
961 969
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.h ('k') | Source/core/inspector/TimelineRecordFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698