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

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

Issue 307943002: Oilpan: Prepare moving InspectorController and InspectorAgents to oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
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>
94 , public ScriptGCEventListener 93 , public ScriptGCEventListener
95 , public InspectorBackendDispatcher::TimelineCommandHandler 94 , public InspectorBackendDispatcher::TimelineCommandHandler
96 , public PlatformInstrumentationClient { 95 , public PlatformInstrumentationClient {
97 WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent); 96 WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
98 public: 97 public:
99 enum InspectorType { PageInspector, WorkerInspector }; 98 enum InspectorType { PageInspector, WorkerInspector };
100 99
101 class GPUEvent { 100 class GPUEvent {
102 public: 101 public:
103 enum Phase { PhaseBegin, PhaseEnd }; 102 enum Phase { PhaseBegin, PhaseEnd };
104 GPUEvent(double timestamp, int phase, bool foreign, uint64_t usedGPUMemo ryBytes, uint64_t limitGPUMemoryBytes) : 103 GPUEvent(double timestamp, int phase, bool foreign, uint64_t usedGPUMemo ryBytes, uint64_t limitGPUMemoryBytes) :
105 timestamp(timestamp), 104 timestamp(timestamp),
106 phase(static_cast<Phase>(phase)), 105 phase(static_cast<Phase>(phase)),
107 foreign(foreign), 106 foreign(foreign),
108 usedGPUMemoryBytes(usedGPUMemoryBytes), 107 usedGPUMemoryBytes(usedGPUMemoryBytes),
109 limitGPUMemoryBytes(limitGPUMemoryBytes) { } 108 limitGPUMemoryBytes(limitGPUMemoryBytes) { }
110 double timestamp; 109 double timestamp;
111 Phase phase; 110 Phase phase;
112 bool foreign; 111 bool foreign;
113 uint64_t usedGPUMemoryBytes; 112 uint64_t usedGPUMemoryBytes;
114 uint64_t limitGPUMemoryBytes; 113 uint64_t limitGPUMemoryBytes;
115 }; 114 };
116 115
117 static PassOwnPtr<InspectorTimelineAgent> create(InspectorPageAgent* pageAge nt, InspectorLayerTreeAgent* layerTreeAgent, 116 class TraceEventListener : public TraceEventDispatcher::TraceEventListener {
haraken 2014/07/14 12:33:40 Can we rename this to TimelineAgentTraceEventListe
keishi 2014/07/15 05:52:52 Done. Changed to InspectorTimelineAgentTraceEventL
117 public:
118 typedef void (InspectorTimelineAgent::*TraceEventHandlerMethod)(const Tr aceEventDispatcher::TraceEvent&);
119 TraceEventListener(InspectorTimelineAgent* instance, TraceEventHandlerMe thod method)
120 : m_instance(instance)
121 , m_method(method)
122 {
123 }
124 virtual void call(const TraceEventDispatcher::TraceEvent& event) OVERRID E
125 {
126 (m_instance->*m_method)(event);
127 }
128 virtual void* target() OVERRIDE
129 {
130 return m_instance;
131 }
132 virtual void trace(Visitor* visitor) OVERRIDE
133 {
134 visitor->trace(m_instance);
135 TraceEventDispatcher::TraceEventListener::trace(visitor);
136 }
137
138 private:
139 RawPtrWillBeMember<InspectorTimelineAgent> m_instance;
140 TraceEventHandlerMethod m_method;
141 };
142
143 static PassOwnPtrWillBeRawPtr<InspectorTimelineAgent> create(InspectorPageAg ent* pageAgent, InspectorLayerTreeAgent* layerTreeAgent,
118 InspectorOverlay* overlay, InspectorType type, InspectorClient* client) 144 InspectorOverlay* overlay, InspectorType type, InspectorClient* client)
119 { 145 {
120 return adoptPtr(new InspectorTimelineAgent(pageAgent, layerTreeAgent, ov erlay, type, client)); 146 return adoptPtrWillBeNoop(new InspectorTimelineAgent(pageAgent, layerTre eAgent, overlay, type, client));
121 } 147 }
122 148
123 virtual ~InspectorTimelineAgent(); 149 virtual ~InspectorTimelineAgent();
150 virtual void trace(Visitor*) OVERRIDE;
124 151
125 virtual void setFrontend(InspectorFrontend*) OVERRIDE; 152 virtual void setFrontend(InspectorFrontend*) OVERRIDE;
126 virtual void clearFrontend() OVERRIDE; 153 virtual void clearFrontend() OVERRIDE;
127 virtual void restore() OVERRIDE; 154 virtual void restore() OVERRIDE;
128 155
129 virtual void enable(ErrorString*) OVERRIDE; 156 virtual void enable(ErrorString*) OVERRIDE;
130 virtual void disable(ErrorString*) OVERRIDE; 157 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; 158 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; 159 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Timel ine::TimelineEvent> >& events) OVERRIDE;
133 160
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 306
280 double timestamp(); 307 double timestamp();
281 308
282 LocalFrame* mainFrame() const; 309 LocalFrame* mainFrame() const;
283 310
284 bool isStarted(); 311 bool isStarted();
285 void innerStart(); 312 void innerStart();
286 void innerStop(bool fromConsole); 313 void innerStop(bool fromConsole);
287 void setLiveEvents(const String&); 314 void setLiveEvents(const String&);
288 315
289 InspectorPageAgent* m_pageAgent; 316 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
290 InspectorLayerTreeAgent* m_layerTreeAgent; 317 RawPtrWillBeMember<InspectorLayerTreeAgent> m_layerTreeAgent;
291 InspectorFrontend::Timeline* m_frontend; 318 InspectorFrontend::Timeline* m_frontend;
292 InspectorClient* m_client; 319 InspectorClient* m_client;
293 InspectorOverlay* m_overlay; 320 InspectorOverlay* m_overlay;
294 InspectorType m_inspectorType; 321 InspectorType m_inspectorType;
295 322
296 int m_id; 323 int m_id;
297 unsigned long long m_layerTreeId; 324 unsigned long long m_layerTreeId;
298 325
299 int m_maxCallStackDepth; 326 int m_maxCallStackDepth;
300 327
(...skipping 15 matching lines...) Expand all
316 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap; 343 typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap;
317 ThreadStateMap m_threadStates; 344 ThreadStateMap m_threadStates;
318 bool m_mayEmitFirstPaint; 345 bool m_mayEmitFirstPaint;
319 HashSet<String> m_liveEvents; 346 HashSet<String> m_liveEvents;
320 double m_lastProgressTimestamp; 347 double m_lastProgressTimestamp;
321 }; 348 };
322 349
323 } // namespace WebCore 350 } // namespace WebCore
324 351
325 #endif // !defined(InspectorTimelineAgent_h) 352 #endif // !defined(InspectorTimelineAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698