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

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

Issue 212893002: Use monotonicallyIncreasingTime for Timeline timestamps (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed a test, it's not applicable now Created 6 years, 8 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 class ScriptArguments; 83 class ScriptArguments;
84 class ScriptCallStack; 84 class ScriptCallStack;
85 class ScriptState; 85 class ScriptState;
86 class TimelineRecordStack; 86 class TimelineRecordStack;
87 class WebSocketHandshakeRequest; 87 class WebSocketHandshakeRequest;
88 class WebSocketHandshakeResponse; 88 class WebSocketHandshakeResponse;
89 class XMLHttpRequest; 89 class XMLHttpRequest;
90 90
91 typedef String ErrorString; 91 typedef String ErrorString;
92 92
93 class TimelineTimeConverter {
94 public:
95 TimelineTimeConverter()
96 : m_startOffset(0)
97 {
98 }
99 double fromMonotonicallyIncreasingTime(double time) const { return (time - m_startOffset) * 1000.0; }
100 void reset();
101
102 private:
103 double m_startOffset;
104 };
105
106 class InspectorTimelineAgent FINAL 93 class InspectorTimelineAgent FINAL
107 : public TraceEventTarget<InspectorTimelineAgent> 94 : public TraceEventTarget<InspectorTimelineAgent>
108 , public InspectorBaseAgent<InspectorTimelineAgent> 95 , public InspectorBaseAgent<InspectorTimelineAgent>
109 , public ScriptGCEventListener 96 , public ScriptGCEventListener
110 , public InspectorBackendDispatcher::TimelineCommandHandler 97 , public InspectorBackendDispatcher::TimelineCommandHandler
111 , public PlatformInstrumentationClient { 98 , public PlatformInstrumentationClient {
112 WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent); 99 WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
113 public: 100 public:
114 enum InspectorType { PageInspector, WorkerInspector }; 101 enum InspectorType { PageInspector, WorkerInspector };
115 102
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 InspectorDOMAgent* m_domAgent; 296 InspectorDOMAgent* m_domAgent;
310 InspectorLayerTreeAgent* m_layerTreeAgent; 297 InspectorLayerTreeAgent* m_layerTreeAgent;
311 InspectorFrontend::Timeline* m_frontend; 298 InspectorFrontend::Timeline* m_frontend;
312 InspectorClient* m_client; 299 InspectorClient* m_client;
313 InspectorOverlay* m_overlay; 300 InspectorOverlay* m_overlay;
314 InspectorType m_inspectorType; 301 InspectorType m_inspectorType;
315 302
316 int m_id; 303 int m_id;
317 unsigned long long m_layerTreeId; 304 unsigned long long m_layerTreeId;
318 305
319 TimelineTimeConverter m_timeConverter;
320 int m_maxCallStackDepth; 306 int m_maxCallStackDepth;
321 307
322 Vector<TimelineRecordEntry> m_recordStack; 308 Vector<TimelineRecordEntry> m_recordStack;
323 RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_buffered Events; 309 RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_buffered Events;
324 Vector<String> m_consoleTimelines; 310 Vector<String> m_consoleTimelines;
325 311
326 typedef Vector<TimelineGCEvent> GCEvents; 312 typedef Vector<TimelineGCEvent> GCEvents;
327 GCEvents m_gcEvents; 313 GCEvents m_gcEvents;
328 unsigned m_platformInstrumentationClientInstalledAtStackDepth; 314 unsigned m_platformInstrumentationClientInstalledAtStackDepth;
329 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingFrameRecord; 315 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingFrameRecord;
330 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingGPURecord; 316 RefPtr<TypeBuilder::Timeline::TimelineEvent> m_pendingGPURecord;
331 typedef HashMap<unsigned long long, TimelineImageInfo> PixelRefToImageInfoMa p; 317 typedef HashMap<unsigned long long, TimelineImageInfo> PixelRefToImageInfoMa p;
332 PixelRefToImageInfoMap m_pixelRefToImageInfo; 318 PixelRefToImageInfoMap m_pixelRefToImageInfo;
333 RenderImage* m_imageBeingPainted; 319 RenderImage* m_imageBeingPainted;
334 HashMap<unsigned long long, long long> m_layerToNodeMap; 320 HashMap<unsigned long long, long long> m_layerToNodeMap;
335 double m_paintSetupStart; 321 double m_paintSetupStart;
336 double m_paintSetupEnd; 322 double m_paintSetupEnd;
337 RefPtr<JSONObject> m_gpuTask; 323 RefPtr<JSONObject> m_gpuTask;
338 unsigned m_styleRecalcElementCounter; 324 unsigned m_styleRecalcElementCounter;
339 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap; 325 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap;
340 ThreadStateMap m_threadStates; 326 ThreadStateMap m_threadStates;
341 bool m_mayEmitFirstPaint; 327 bool m_mayEmitFirstPaint;
342 HashSet<String> m_liveEvents; 328 HashSet<String> m_liveEvents;
343 double m_lastProgressTimestamp; 329 double m_lastProgressTimestamp;
344 }; 330 };
345 331
346 } // namespace WebCore 332 } // namespace WebCore
347 333
348 #endif // !defined(InspectorTimelineAgent_h) 334 #endif // !defined(InspectorTimelineAgent_h)
OLDNEW
« no previous file with comments | « LayoutTests/inspector/timeline/timeline-start-time-expected.txt ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698