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

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

Issue 46663010: DevTools: Show GPU utilization bar on timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 private: 75 private:
76 void send(PassRefPtr<JSONObject>); 76 void send(PassRefPtr<JSONObject>);
77 77
78 WeakPtr<InspectorTimelineAgent> m_timelineAgent; 78 WeakPtr<InspectorTimelineAgent> m_timelineAgent;
79 Vector<Entry> m_stack; 79 Vector<Entry> m_stack;
80 }; 80 };
81 81
82 class TimelineTraceEventProcessor : public ThreadSafeRefCounted<TimelineTraceEve ntProcessor> { 82 class TimelineTraceEventProcessor : public ThreadSafeRefCounted<TimelineTraceEve ntProcessor> {
83 public: 83 public:
84 TimelineTraceEventProcessor(WeakPtr<InspectorTimelineAgent>, InspectorClient *); 84 TimelineTraceEventProcessor(WeakPtr<InspectorTimelineAgent>, InspectorClient *, bool);
yurys 2013/10/31 15:06:52 bool collectGpuEvents for better readability?
alph 2013/10/31 16:58:00 Done.
85 ~TimelineTraceEventProcessor(); 85 ~TimelineTraceEventProcessor();
86 86
87 void shutdown(); 87 void shutdown();
88 void processEventOnAnyThread(double timestamp, char, const char* name, unsig ned long long id, 88 void processEventOnAnyThread(double timestamp, char, const char* name, unsig ned long long id,
89 int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues, 89 int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
90 unsigned char flags); 90 unsigned char flags);
91 91
92 private: 92 private:
93 struct TimelineThreadState { 93 struct TimelineThreadState {
94 TimelineThreadState() { } 94 TimelineThreadState() { }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void onRasterTaskBegin(const TraceEvent&); 212 void onRasterTaskBegin(const TraceEvent&);
213 void onRasterTaskEnd(const TraceEvent&); 213 void onRasterTaskEnd(const TraceEvent&);
214 void onPaint(const TraceEvent&); 214 void onPaint(const TraceEvent&);
215 void onImageDecodeTaskBegin(const TraceEvent&); 215 void onImageDecodeTaskBegin(const TraceEvent&);
216 void onImageDecodeTaskEnd(const TraceEvent&); 216 void onImageDecodeTaskEnd(const TraceEvent&);
217 void onImageDecodeBegin(const TraceEvent&); 217 void onImageDecodeBegin(const TraceEvent&);
218 void onImageDecodeEnd(const TraceEvent&); 218 void onImageDecodeEnd(const TraceEvent&);
219 void onLayerDeleted(const TraceEvent&); 219 void onLayerDeleted(const TraceEvent&);
220 void onDrawLazyPixelRef(const TraceEvent&); 220 void onDrawLazyPixelRef(const TraceEvent&);
221 void onLazyPixelRefDeleted(const TraceEvent&); 221 void onLazyPixelRefDeleted(const TraceEvent&);
222 void onGpuTaskBegin(const TraceEvent&);
223 void onGpuTaskEnd(const TraceEvent&);
222 224
223 WeakPtr<InspectorTimelineAgent> m_timelineAgent; 225 WeakPtr<InspectorTimelineAgent> m_timelineAgent;
224 TimelineTimeConverter m_timeConverter; 226 TimelineTimeConverter m_timeConverter;
225 InspectorClient* m_inspectorClient; 227 InspectorClient* m_inspectorClient;
226 unsigned long long m_pageId; 228 unsigned long long m_pageId;
227 int m_layerTreeId; 229 int m_layerTreeId;
228 230
229 typedef HashMap<std::pair<String, int>, TraceEventHandler> HandlersMap; 231 typedef HashMap<std::pair<String, int>, TraceEventHandler> HandlersMap;
230 HandlersMap m_handlersByType; 232 HandlersMap m_handlersByType;
231 Mutex m_backgroundEventsMutex; 233 Mutex m_backgroundEventsMutex;
232 Vector<TraceEvent> m_backgroundEvents; 234 Vector<TraceEvent> m_backgroundEvents;
233 double m_lastEventProcessingTime; 235 double m_lastEventProcessingTime;
234 bool m_processEventsTaskInFlight; 236 bool m_processEventsTaskInFlight;
235 237
236 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap; 238 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap;
237 ThreadStateMap m_threadStates; 239 ThreadStateMap m_threadStates;
238 240
239 HashMap<unsigned long long, long long> m_layerToNodeMap; 241 HashMap<unsigned long long, long long> m_layerToNodeMap;
240 unsigned long long m_layerId; 242 unsigned long long m_layerId;
241 double m_paintSetupStart; 243 double m_paintSetupStart;
242 double m_paintSetupEnd; 244 double m_paintSetupEnd;
245 double m_gpuTaskStart;
246 unsigned m_gpuTaskRendererPid;
243 247
244 struct ImageInfo { 248 struct ImageInfo {
245 int backendNodeId; 249 int backendNodeId;
246 String url; 250 String url;
247 251
248 ImageInfo() { } 252 ImageInfo() { }
249 ImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId), url(url) { } 253 ImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId), url(url) { }
250 }; 254 };
251 typedef HashMap<unsigned long long, ImageInfo> PixelRefToImageInfoMap; 255 typedef HashMap<unsigned long long, ImageInfo> PixelRefToImageInfoMap;
252 PixelRefToImageInfoMap m_pixelRefToImageInfo; 256 PixelRefToImageInfoMap m_pixelRefToImageInfo;
253 }; 257 };
254 258
255 } // namespace WebCore 259 } // namespace WebCore
256 260
257 #endif // !defined(TimelineTraceEventProcessor_h) 261 #endif // !defined(TimelineTraceEventProcessor_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698