| OLD | NEW |
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 class ScriptArguments; | 82 class ScriptArguments; |
| 83 class ScriptCallStack; | 83 class ScriptCallStack; |
| 84 class TimelineRecordStack; | 84 class TimelineRecordStack; |
| 85 class WebSocketHandshakeRequest; | 85 class WebSocketHandshakeRequest; |
| 86 class WebSocketHandshakeResponse; | 86 class WebSocketHandshakeResponse; |
| 87 class XMLHttpRequest; | 87 class XMLHttpRequest; |
| 88 | 88 |
| 89 typedef String ErrorString; | 89 typedef String ErrorString; |
| 90 | 90 |
| 91 class InspectorTimelineAgent FINAL | 91 class InspectorTimelineAgent FINAL |
| 92 : public TraceEventTarget<InspectorTimelineAgent> | 92 : public InspectorBaseAgent<InspectorTimelineAgent> |
| 93 , public InspectorBaseAgent<InspectorTimelineAgent> | 93 , public TraceEventTarget<InspectorTimelineAgent> |
| 94 , public ScriptGCEventListener | 94 , public ScriptGCEventListener |
| 95 , public InspectorBackendDispatcher::TimelineCommandHandler | 95 , public InspectorBackendDispatcher::TimelineCommandHandler |
| 96 , public PlatformInstrumentationClient { | 96 , public PlatformInstrumentationClient { |
| 97 WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent); | 97 WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent); |
| 98 public: | 98 public: |
| 99 enum InspectorType { PageInspector, WorkerInspector }; | 99 enum InspectorType { PageInspector, WorkerInspector }; |
| 100 | 100 |
| 101 class GPUEvent { | 101 class GPUEvent { |
| 102 public: | 102 public: |
| 103 enum Phase { PhaseBegin, PhaseEnd }; | 103 enum Phase { PhaseBegin, PhaseEnd }; |
| 104 GPUEvent(double timestamp, int phase, bool foreign, uint64_t usedGPUMemo
ryBytes, uint64_t limitGPUMemoryBytes) : | 104 GPUEvent(double timestamp, int phase, bool foreign, uint64_t usedGPUMemo
ryBytes, uint64_t limitGPUMemoryBytes) : |
| 105 timestamp(timestamp), | 105 timestamp(timestamp), |
| 106 phase(static_cast<Phase>(phase)), | 106 phase(static_cast<Phase>(phase)), |
| 107 foreign(foreign), | 107 foreign(foreign), |
| 108 usedGPUMemoryBytes(usedGPUMemoryBytes), | 108 usedGPUMemoryBytes(usedGPUMemoryBytes), |
| 109 limitGPUMemoryBytes(limitGPUMemoryBytes) { } | 109 limitGPUMemoryBytes(limitGPUMemoryBytes) { } |
| 110 double timestamp; | 110 double timestamp; |
| 111 Phase phase; | 111 Phase phase; |
| 112 bool foreign; | 112 bool foreign; |
| 113 uint64_t usedGPUMemoryBytes; | 113 uint64_t usedGPUMemoryBytes; |
| 114 uint64_t limitGPUMemoryBytes; | 114 uint64_t limitGPUMemoryBytes; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 static PassOwnPtr<InspectorTimelineAgent> create(InspectorPageAgent* pageAge
nt, InspectorLayerTreeAgent* layerTreeAgent, | 117 static PassOwnPtrWillBeRawPtr<InspectorTimelineAgent> create(InspectorPageAg
ent* pageAgent, InspectorLayerTreeAgent* layerTreeAgent, |
| 118 InspectorOverlay* overlay, InspectorType type, InspectorClient* client) | 118 InspectorOverlay* overlay, InspectorType type, InspectorClient* client) |
| 119 { | 119 { |
| 120 return adoptPtr(new InspectorTimelineAgent(pageAgent, layerTreeAgent, ov
erlay, type, client)); | 120 return adoptPtrWillBeNoop(new InspectorTimelineAgent(pageAgent, layerTre
eAgent, overlay, type, client)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 virtual ~InspectorTimelineAgent(); | 123 virtual ~InspectorTimelineAgent(); |
| 124 virtual void trace(Visitor*) OVERRIDE; |
| 124 | 125 |
| 125 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 126 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 126 virtual void clearFrontend() OVERRIDE; | 127 virtual void clearFrontend() OVERRIDE; |
| 127 virtual void restore() OVERRIDE; | 128 virtual void restore() OVERRIDE; |
| 128 | 129 |
| 129 virtual void enable(ErrorString*) OVERRIDE; | 130 virtual void enable(ErrorString*) OVERRIDE; |
| 130 virtual void disable(ErrorString*) OVERRIDE; | 131 virtual void disable(ErrorString*) OVERRIDE; |
| 131 virtual void start(ErrorString*, const int* maxCallStackDepth, const bool* b
ufferEvents, const String* liveEvents, const bool* includeCounters, const bool*
includeGPUEvents) OVERRIDE; | 132 virtual void start(ErrorString*, const int* maxCallStackDepth, const bool* b
ufferEvents, const String* liveEvents, const bool* includeCounters, const bool*
includeGPUEvents) OVERRIDE; |
| 132 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Timel
ine::TimelineEvent> >& events) OVERRIDE; | 133 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Timel
ine::TimelineEvent> >& events) OVERRIDE; |
| 133 | 134 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 280 |
| 280 double timestamp(); | 281 double timestamp(); |
| 281 | 282 |
| 282 LocalFrame* mainFrame() const; | 283 LocalFrame* mainFrame() const; |
| 283 | 284 |
| 284 bool isStarted(); | 285 bool isStarted(); |
| 285 void innerStart(); | 286 void innerStart(); |
| 286 void innerStop(bool fromConsole); | 287 void innerStop(bool fromConsole); |
| 287 void setLiveEvents(const String&); | 288 void setLiveEvents(const String&); |
| 288 | 289 |
| 289 InspectorPageAgent* m_pageAgent; | 290 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 290 InspectorLayerTreeAgent* m_layerTreeAgent; | 291 RawPtrWillBeMember<InspectorLayerTreeAgent> m_layerTreeAgent; |
| 291 InspectorFrontend::Timeline* m_frontend; | 292 InspectorFrontend::Timeline* m_frontend; |
| 292 InspectorClient* m_client; | 293 InspectorClient* m_client; |
| 293 InspectorOverlay* m_overlay; | 294 InspectorOverlay* m_overlay; |
| 294 InspectorType m_inspectorType; | 295 InspectorType m_inspectorType; |
| 295 | 296 |
| 296 int m_id; | 297 int m_id; |
| 297 unsigned long long m_layerTreeId; | 298 unsigned long long m_layerTreeId; |
| 298 | 299 |
| 299 int m_maxCallStackDepth; | 300 int m_maxCallStackDepth; |
| 300 | 301 |
| 301 Vector<TimelineRecordEntry> m_recordStack; | 302 Vector<TimelineRecordEntry> m_recordStack; |
| 302 RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_buffered
Events; | 303 RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_buffered
Events; |
| 303 Vector<String> m_consoleTimelines; | 304 Vector<String> m_consoleTimelines; |
| 304 | 305 |
| 305 unsigned m_platformInstrumentationClientInstalledAtStackDepth; | 306 unsigned m_platformInstrumentationClientInstalledAtStackDepth; |
| 306 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingFrameRecord; | 307 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingFrameRecord; |
| 307 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingGPURecord; | 308 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingGPURecord; |
| 308 typedef HashMap<unsigned long long, TimelineImageInfo> PixelRefToImageInfoMa
p; | 309 typedef HashMap<unsigned long long, TimelineImageInfo> PixelRefToImageInfoMa
p; |
| 309 PixelRefToImageInfoMap m_pixelRefToImageInfo; | 310 PixelRefToImageInfoMap m_pixelRefToImageInfo; |
| 310 RenderImage* m_imageBeingPainted; | 311 RenderImage* m_imageBeingPainted; |
| 311 HashMap<unsigned long long, long long> m_layerToNodeMap; | 312 HashMap<unsigned long long, long long> m_layerToNodeMap; |
| 312 double m_paintSetupStart; | 313 double m_paintSetupStart; |
| 313 double m_paintSetupEnd; | 314 double m_paintSetupEnd; |
| 314 RefPtr<JSONObject> m_gpuTask; | 315 RefPtr<JSONObject> m_gpuTask; |
| 315 RefPtr<JSONValue> m_pendingLayerTreeData; | 316 RefPtr<JSONValue> m_pendingLayerTreeData; |
| 316 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap; | 317 typedef WillBeHeapHashMap<ThreadIdentifier, OwnPtrWillBeMember<TimelineThrea
dState> > ThreadStateMap; |
| 317 ThreadStateMap m_threadStates; | 318 ThreadStateMap m_threadStates; |
| 318 bool m_mayEmitFirstPaint; | 319 bool m_mayEmitFirstPaint; |
| 319 HashSet<String> m_liveEvents; | 320 HashSet<String> m_liveEvents; |
| 320 double m_lastProgressTimestamp; | 321 double m_lastProgressTimestamp; |
| 321 }; | 322 }; |
| 322 | 323 |
| 323 } // namespace WebCore | 324 } // namespace WebCore |
| 324 | 325 |
| 325 #endif // !defined(InspectorTimelineAgent_h) | 326 #endif // !defined(InspectorTimelineAgent_h) |
| OLD | NEW |