| OLD | NEW |
| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 { | 190 { |
| 191 ThreadStateMap::iterator it = m_threadStates.find(thread); | 191 ThreadStateMap::iterator it = m_threadStates.find(thread); |
| 192 if (it != m_threadStates.end()) | 192 if (it != m_threadStates.end()) |
| 193 return it->value; | 193 return it->value; |
| 194 return m_threadStates.add(thread, TimelineThreadState(m_timelineAgent)).
iterator->value; | 194 return m_threadStates.add(thread, TimelineThreadState(m_timelineAgent)).
iterator->value; |
| 195 } | 195 } |
| 196 bool maybeEnterLayerTask(const TraceEvent&, TimelineThreadState&); | 196 bool maybeEnterLayerTask(const TraceEvent&, TimelineThreadState&); |
| 197 void leaveLayerTask(TimelineThreadState&); | 197 void leaveLayerTask(TimelineThreadState&); |
| 198 | 198 |
| 199 void processBackgroundEvents(); | 199 void processBackgroundEvents(); |
| 200 void processBackgroundEventsTask(); |
| 200 PassRefPtr<JSONObject> createRecord(const TraceEvent&, const String& recordT
ype, PassRefPtr<JSONObject> data = 0); | 201 PassRefPtr<JSONObject> createRecord(const TraceEvent&, const String& recordT
ype, PassRefPtr<JSONObject> data = 0); |
| 201 | 202 |
| 202 void registerHandler(const char* name, char, TraceEventHandler); | 203 void registerHandler(const char* name, char, TraceEventHandler); |
| 203 | 204 |
| 204 void onBeginFrame(const TraceEvent&); | 205 void onBeginFrame(const TraceEvent&); |
| 205 void onUpdateLayerBegin(const TraceEvent&); | 206 void onUpdateLayerBegin(const TraceEvent&); |
| 206 void onUpdateLayerEnd(const TraceEvent&); | 207 void onUpdateLayerEnd(const TraceEvent&); |
| 207 void onPaintLayerBegin(const TraceEvent&); | 208 void onPaintLayerBegin(const TraceEvent&); |
| 208 void onPaintLayerEnd(const TraceEvent&); | 209 void onPaintLayerEnd(const TraceEvent&); |
| 209 void onPaintSetupBegin(const TraceEvent&); | 210 void onPaintSetupBegin(const TraceEvent&); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 222 WeakPtr<InspectorTimelineAgent> m_timelineAgent; | 223 WeakPtr<InspectorTimelineAgent> m_timelineAgent; |
| 223 TimelineTimeConverter m_timeConverter; | 224 TimelineTimeConverter m_timeConverter; |
| 224 InspectorClient* m_inspectorClient; | 225 InspectorClient* m_inspectorClient; |
| 225 unsigned long long m_pageId; | 226 unsigned long long m_pageId; |
| 226 int m_layerTreeId; | 227 int m_layerTreeId; |
| 227 | 228 |
| 228 typedef HashMap<std::pair<String, int>, TraceEventHandler> HandlersMap; | 229 typedef HashMap<std::pair<String, int>, TraceEventHandler> HandlersMap; |
| 229 HandlersMap m_handlersByType; | 230 HandlersMap m_handlersByType; |
| 230 Mutex m_backgroundEventsMutex; | 231 Mutex m_backgroundEventsMutex; |
| 231 Vector<TraceEvent> m_backgroundEvents; | 232 Vector<TraceEvent> m_backgroundEvents; |
| 233 double m_lastEventProcessingTime; |
| 234 bool m_processEventsTaskPosted; |
| 232 | 235 |
| 233 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap; | 236 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap; |
| 234 ThreadStateMap m_threadStates; | 237 ThreadStateMap m_threadStates; |
| 235 | 238 |
| 236 HashMap<unsigned long long, long long> m_layerToNodeMap; | 239 HashMap<unsigned long long, long long> m_layerToNodeMap; |
| 237 unsigned long long m_layerId; | 240 unsigned long long m_layerId; |
| 238 double m_paintSetupStart; | 241 double m_paintSetupStart; |
| 239 double m_paintSetupEnd; | 242 double m_paintSetupEnd; |
| 240 | 243 |
| 241 struct ImageInfo { | 244 struct ImageInfo { |
| 242 int backendNodeId; | 245 int backendNodeId; |
| 243 String url; | 246 String url; |
| 244 | 247 |
| 245 ImageInfo() { } | 248 ImageInfo() { } |
| 246 ImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId),
url(url) { } | 249 ImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId),
url(url) { } |
| 247 }; | 250 }; |
| 248 typedef HashMap<unsigned long long, ImageInfo> PixelRefToImageInfoMap; | 251 typedef HashMap<unsigned long long, ImageInfo> PixelRefToImageInfoMap; |
| 249 PixelRefToImageInfoMap m_pixelRefToImageInfo; | 252 PixelRefToImageInfoMap m_pixelRefToImageInfo; |
| 250 }; | 253 }; |
| 251 | 254 |
| 252 } // namespace WebCore | 255 } // namespace WebCore |
| 253 | 256 |
| 254 #endif // !defined(TimelineTraceEventProcessor_h) | 257 #endif // !defined(TimelineTraceEventProcessor_h) |
| OLD | NEW |