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

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

Issue 323043002: Oilpan: Prepare moving InspectorAgent related classes to oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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) 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 { 182 {
183 } 183 }
184 RefPtr<TimelineEvent> record; 184 RefPtr<TimelineEvent> record;
185 RefPtr<JSONObject> data; 185 RefPtr<JSONObject> data;
186 RefPtr<TypeBuilder::Array<TimelineEvent> > children; 186 RefPtr<TypeBuilder::Array<TimelineEvent> > children;
187 String type; 187 String type;
188 bool skipWhenUnbalanced; 188 bool skipWhenUnbalanced;
189 }; 189 };
190 190
191 class TimelineRecordStack { 191 class TimelineRecordStack {
192 DISALLOW_ALLOCATION();
192 private: 193 private:
193 struct Entry { 194 struct Entry {
194 Entry(PassRefPtr<TimelineEvent> record, const String& type) 195 Entry(PassRefPtr<TimelineEvent> record, const String& type)
195 : record(record) 196 : record(record)
196 , children(TypeBuilder::Array<TimelineEvent>::create()) 197 , children(TypeBuilder::Array<TimelineEvent>::create())
197 #if ENABLE(ASSERT) 198 #if ENABLE(ASSERT)
198 , type(type) 199 , type(type)
199 #endif 200 #endif
200 { 201 {
201 } 202 }
202 203
203 RefPtr<TimelineEvent> record; 204 RefPtr<TimelineEvent> record;
204 RefPtr<TypeBuilder::Array<TimelineEvent> > children; 205 RefPtr<TypeBuilder::Array<TimelineEvent> > children;
205 #if ENABLE(ASSERT) 206 #if ENABLE(ASSERT)
206 String type; 207 String type;
207 #endif 208 #endif
208 }; 209 };
209 210
210 public: 211 public:
211 TimelineRecordStack() : m_timelineAgent(0) { } 212 TimelineRecordStack() : m_timelineAgent(nullptr) { }
212 TimelineRecordStack(InspectorTimelineAgent*); 213 explicit TimelineRecordStack(InspectorTimelineAgent*);
213 214
214 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type); 215 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type);
215 void closeScopedRecord(double endTime); 216 void closeScopedRecord(double endTime);
216 void addInstantRecord(PassRefPtr<TimelineEvent> record); 217 void addInstantRecord(PassRefPtr<TimelineEvent> record);
217 218
218 #if ENABLE(ASSERT) 219 #if ENABLE(ASSERT)
219 bool isOpenRecordOfType(const String& type); 220 bool isOpenRecordOfType(const String& type);
220 #endif 221 #endif
221 222
223 void trace(Visitor*);
224
222 private: 225 private:
223 void send(PassRefPtr<JSONObject>); 226 void send(PassRefPtr<JSONObject>);
224 227
225 InspectorTimelineAgent* m_timelineAgent; 228 RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent;
226 Vector<Entry> m_stack; 229 Vector<Entry> m_stack;
227 }; 230 };
228 231
229 struct TimelineThreadState { 232 struct TimelineThreadState {
233 ALLOW_ONLY_INLINE_ALLOCATION();
234 public:
230 TimelineThreadState() { } 235 TimelineThreadState() { }
231 236
232 TimelineThreadState(InspectorTimelineAgent* timelineAgent) 237 TimelineThreadState(InspectorTimelineAgent* timelineAgent)
233 : recordStack(timelineAgent) 238 : recordStack(timelineAgent)
234 , inKnownLayerTask(false) 239 , inKnownLayerTask(false)
235 , decodedPixelRefId(0) 240 , decodedPixelRefId(0)
236 { 241 {
237 } 242 }
238 243
244 void trace(Visitor*);
245
239 TimelineRecordStack recordStack; 246 TimelineRecordStack recordStack;
240 bool inKnownLayerTask; 247 bool inKnownLayerTask;
241 unsigned long long decodedPixelRefId; 248 unsigned long long decodedPixelRefId;
242 }; 249 };
243 250
244 struct TimelineImageInfo { 251 struct TimelineImageInfo {
245 int backendNodeId; 252 int backendNodeId;
246 String url; 253 String url;
247 254
248 TimelineImageInfo() : backendNodeId(0) { } 255 TimelineImageInfo() : backendNodeId(0) { }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 296 }
290 297
291 InspectorTimelineAgent::~InspectorTimelineAgent() 298 InspectorTimelineAgent::~InspectorTimelineAgent()
292 { 299 {
293 } 300 }
294 301
295 void InspectorTimelineAgent::trace(Visitor* visitor) 302 void InspectorTimelineAgent::trace(Visitor* visitor)
296 { 303 {
297 visitor->trace(m_pageAgent); 304 visitor->trace(m_pageAgent);
298 visitor->trace(m_layerTreeAgent); 305 visitor->trace(m_layerTreeAgent);
306 #if ENABLE(OILPAN)
307 visitor->trace(m_threadStates);
308 #endif
299 InspectorBaseAgent::trace(visitor); 309 InspectorBaseAgent::trace(visitor);
300 } 310 }
301 311
302 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend) 312 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend)
303 { 313 {
304 m_frontend = frontend->timeline(); 314 m_frontend = frontend->timeline();
305 } 315 }
306 316
307 void InspectorTimelineAgent::clearFrontend() 317 void InspectorTimelineAgent::clearFrontend()
308 { 318 {
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 m_stack.last().children->addItem(record); 1349 m_stack.last().children->addItem(record);
1340 } 1350 }
1341 1351
1342 #if ENABLE(ASSERT) 1352 #if ENABLE(ASSERT)
1343 bool TimelineRecordStack::isOpenRecordOfType(const String& type) 1353 bool TimelineRecordStack::isOpenRecordOfType(const String& type)
1344 { 1354 {
1345 return !m_stack.isEmpty() && m_stack.last().type == type; 1355 return !m_stack.isEmpty() && m_stack.last().type == type;
1346 } 1356 }
1347 #endif 1357 #endif
1348 1358
1359 void TimelineRecordStack::trace(Visitor* visitor)
1360 {
1361 visitor->trace(m_timelineAgent);
1362 }
1363
1364 void TimelineThreadState::trace(Visitor* visitor)
1365 {
1366 visitor->trace(recordStack);
1367 }
1368
1349 } // namespace blink 1369 } // namespace blink
1350 1370
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.h ('k') | Source/core/inspector/WorkerInspectorController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698