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

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

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) 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 addRecordToTimeline(record.release(), time); 254 addRecordToTimeline(record.release(), time);
255 if (m_state->getBoolean(TimelineAgentState::includeCounters)) { 255 if (m_state->getBoolean(TimelineAgentState::includeCounters)) {
256 addRecordToTimeline(createCountersUpdate(), time); 256 addRecordToTimeline(createCountersUpdate(), time);
257 } 257 }
258 } 258 }
259 259
260 InspectorTimelineAgent::~InspectorTimelineAgent() 260 InspectorTimelineAgent::~InspectorTimelineAgent()
261 { 261 {
262 } 262 }
263 263
264 void InspectorTimelineAgent::trace(Visitor* visitor)
265 {
266 visitor->trace(m_pageAgent);
267 visitor->trace(m_layerTreeAgent);
268 InspectorBaseAgent::trace(visitor);
269 }
270
264 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend) 271 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend)
265 { 272 {
266 m_frontend = frontend->timeline(); 273 m_frontend = frontend->timeline();
267 } 274 }
268 275
269 void InspectorTimelineAgent::clearFrontend() 276 void InspectorTimelineAgent::clearFrontend()
270 { 277 {
271 ErrorString error; 278 ErrorString error;
272 RefPtr<TypeBuilder::Array<TimelineEvent> > events; 279 RefPtr<TypeBuilder::Array<TimelineEvent> > events;
273 stop(&error, events); 280 stop(&error, events);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 351
345 void InspectorTimelineAgent::innerStart() 352 void InspectorTimelineAgent::innerStart()
346 { 353 {
347 if (m_overlay) 354 if (m_overlay)
348 m_overlay->startedRecordingProfile(); 355 m_overlay->startedRecordingProfile();
349 m_state->setBoolean(TimelineAgentState::started, true); 356 m_state->setBoolean(TimelineAgentState::started, true);
350 m_instrumentingAgents->setInspectorTimelineAgent(this); 357 m_instrumentingAgents->setInspectorTimelineAgent(this);
351 ScriptGCEvent::addEventListener(this); 358 ScriptGCEvent::addEventListener(this);
352 if (m_client) { 359 if (m_client) {
353 TraceEventDispatcher* dispatcher = TraceEventDispatcher::instance(); 360 TraceEventDispatcher* dispatcher = TraceEventDispatcher::instance();
354 dispatcher->addListener(InstrumentationEvents::BeginFrame, TRACE_EVENT_P HASE_INSTANT, this, &InspectorTimelineAgent::onBeginImplSideFrame, m_client); 361 dispatcher->addListener(InstrumentationEvents::BeginFrame, TRACE_EVENT_P HASE_INSTANT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener( this, &InspectorTimelineAgent::onBeginImplSideFrame)), m_client);
haraken 2014/07/14 12:33:39 Shall we add a create() method?
keishi 2014/07/15 05:52:52 Done.
355 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P HASE_BEGIN, this, &InspectorTimelineAgent::onPaintSetupBegin, m_client); 362 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P HASE_BEGIN, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener(th is, &InspectorTimelineAgent::onPaintSetupBegin)), m_client);
356 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P HASE_END, this, &InspectorTimelineAgent::onPaintSetupEnd, m_client); 363 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P HASE_END, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener(this , &InspectorTimelineAgent::onPaintSetupEnd)), m_client);
357 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P HASE_BEGIN, this, &InspectorTimelineAgent::onRasterTaskBegin, m_client); 364 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P HASE_BEGIN, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener(th is, &InspectorTimelineAgent::onRasterTaskBegin)), m_client);
358 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P HASE_END, this, &InspectorTimelineAgent::onRasterTaskEnd, m_client); 365 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P HASE_END, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener(this , &InspectorTimelineAgent::onRasterTaskEnd)), m_client);
359 dispatcher->addListener(InstrumentationEvents::Layer, TRACE_EVENT_PHASE_ DELETE_OBJECT, this, &InspectorTimelineAgent::onLayerDeleted, m_client); 366 dispatcher->addListener(InstrumentationEvents::Layer, TRACE_EVENT_PHASE_ DELETE_OBJECT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener (this, &InspectorTimelineAgent::onLayerDeleted)), m_client);
360 dispatcher->addListener(InstrumentationEvents::RequestMainThreadFrame, T RACE_EVENT_PHASE_INSTANT, this, &InspectorTimelineAgent::onRequestMainThreadFram e, m_client); 367 dispatcher->addListener(InstrumentationEvents::RequestMainThreadFrame, T RACE_EVENT_PHASE_INSTANT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEv entListener(this, &InspectorTimelineAgent::onRequestMainThreadFrame)), m_client) ;
361 dispatcher->addListener(InstrumentationEvents::ActivateLayerTree, TRACE_ EVENT_PHASE_INSTANT, this, &InspectorTimelineAgent::onActivateLayerTree, m_clien t); 368 dispatcher->addListener(InstrumentationEvents::ActivateLayerTree, TRACE_ EVENT_PHASE_INSTANT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventLi stener(this, &InspectorTimelineAgent::onActivateLayerTree)), m_client);
362 dispatcher->addListener(InstrumentationEvents::DrawFrame, TRACE_EVENT_PH ASE_INSTANT, this, &InspectorTimelineAgent::onDrawFrame, m_client); 369 dispatcher->addListener(InstrumentationEvents::DrawFrame, TRACE_EVENT_PH ASE_INSTANT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListener(t his, &InspectorTimelineAgent::onDrawFrame)), m_client);
363 dispatcher->addListener(PlatformInstrumentation::ImageDecodeEvent, TRACE _EVENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onImageDecodeBegin, m_client) ; 370 dispatcher->addListener(PlatformInstrumentation::ImageDecodeEvent, TRACE _EVENT_PHASE_BEGIN, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventLis tener(this, &InspectorTimelineAgent::onImageDecodeBegin)), m_client);
364 dispatcher->addListener(PlatformInstrumentation::ImageDecodeEvent, TRACE _EVENT_PHASE_END, this, &InspectorTimelineAgent::onImageDecodeEnd, m_client); 371 dispatcher->addListener(PlatformInstrumentation::ImageDecodeEvent, TRACE _EVENT_PHASE_END, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListe ner(this, &InspectorTimelineAgent::onImageDecodeEnd)), m_client);
365 dispatcher->addListener(PlatformInstrumentation::DrawLazyPixelRefEvent, TRACE_EVENT_PHASE_INSTANT, this, &InspectorTimelineAgent::onDrawLazyPixelRef, m_ client); 372 dispatcher->addListener(PlatformInstrumentation::DrawLazyPixelRefEvent, TRACE_EVENT_PHASE_INSTANT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceE ventListener(this, &InspectorTimelineAgent::onDrawLazyPixelRef)), m_client);
366 dispatcher->addListener(PlatformInstrumentation::DecodeLazyPixelRefEvent , TRACE_EVENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onDecodeLazyPixelRefBe gin, m_client); 373 dispatcher->addListener(PlatformInstrumentation::DecodeLazyPixelRefEvent , TRACE_EVENT_PHASE_BEGIN, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceE ventListener(this, &InspectorTimelineAgent::onDecodeLazyPixelRefBegin)), m_clien t);
367 dispatcher->addListener(PlatformInstrumentation::DecodeLazyPixelRefEvent , TRACE_EVENT_PHASE_END, this, &InspectorTimelineAgent::onDecodeLazyPixelRefEnd, m_client); 374 dispatcher->addListener(PlatformInstrumentation::DecodeLazyPixelRefEvent , TRACE_EVENT_PHASE_END, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEve ntListener(this, &InspectorTimelineAgent::onDecodeLazyPixelRefEnd)), m_client);
368 dispatcher->addListener(PlatformInstrumentation::LazyPixelRef, TRACE_EVE NT_PHASE_DELETE_OBJECT, this, &InspectorTimelineAgent::onLazyPixelRefDeleted, m_ client); 375 dispatcher->addListener(PlatformInstrumentation::LazyPixelRef, TRACE_EVE NT_PHASE_DELETE_OBJECT, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEven tListener(this, &InspectorTimelineAgent::onLazyPixelRefDeleted)), m_client);
369 dispatcher->addListener(InstrumentationEvents::EmbedderCallback, TRACE_E VENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onEmbedderCallbackBegin, m_clie nt); 376 dispatcher->addListener(InstrumentationEvents::EmbedderCallback, TRACE_E VENT_PHASE_BEGIN, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListe ner(this, &InspectorTimelineAgent::onEmbedderCallbackBegin)), m_client);
370 dispatcher->addListener(InstrumentationEvents::EmbedderCallback, TRACE_E VENT_PHASE_END, this, &InspectorTimelineAgent::onEmbedderCallbackEnd, m_client); 377 dispatcher->addListener(InstrumentationEvents::EmbedderCallback, TRACE_E VENT_PHASE_END, adoptPtrWillBeNoop(new InspectorTimelineAgent::TraceEventListene r(this, &InspectorTimelineAgent::onEmbedderCallbackEnd)), m_client);
371 378
372 if (m_state->getBoolean(TimelineAgentState::includeGPUEvents)) { 379 if (m_state->getBoolean(TimelineAgentState::includeGPUEvents)) {
373 m_pendingGPURecord.clear(); 380 m_pendingGPURecord.clear();
374 m_client->startGPUEventsRecording(); 381 m_client->startGPUEventsRecording();
375 } 382 }
376 } 383 }
377 } 384 }
378 385
379 void InspectorTimelineAgent::stop(ErrorString* errorString, RefPtr<TypeBuilder:: Array<TimelineEvent> >& events) 386 void InspectorTimelineAgent::stop(ErrorString* errorString, RefPtr<TypeBuilder:: Array<TimelineEvent> >& events)
380 { 387 {
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 1312
1306 #ifndef NDEBUG 1313 #ifndef NDEBUG
1307 bool TimelineRecordStack::isOpenRecordOfType(const String& type) 1314 bool TimelineRecordStack::isOpenRecordOfType(const String& type)
1308 { 1315 {
1309 return !m_stack.isEmpty() && m_stack.last().type == type; 1316 return !m_stack.isEmpty() && m_stack.last().type == type;
1310 } 1317 }
1311 #endif 1318 #endif
1312 1319
1313 } // namespace WebCore 1320 } // namespace WebCore
1314 1321
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698