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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made InspectorBaseAgent RefCounted Created 7 years, 6 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 entry.record->setObject("data", entry.data); 724 entry.record->setObject("data", entry.data);
725 entry.record->setArray("children", entry.children); 725 entry.record->setArray("children", entry.children);
726 entry.record->setNumber("endTime", timestamp()); 726 entry.record->setNumber("endTime", timestamp());
727 size_t usedHeapSizeDelta = getUsedHeapSize() - entry.usedHeapSizeAtStart ; 727 size_t usedHeapSizeDelta = getUsedHeapSize() - entry.usedHeapSizeAtStart ;
728 if (usedHeapSizeDelta) 728 if (usedHeapSizeDelta)
729 entry.record->setNumber("usedHeapSizeDelta", usedHeapSizeDelta); 729 entry.record->setNumber("usedHeapSizeDelta", usedHeapSizeDelta);
730 addRecordToTimeline(entry.record); 730 addRecordToTimeline(entry.record);
731 } 731 }
732 } 732 }
733 733
734 InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents* instrumentin gAgents, InspectorPageAgent* pageAgent, InspectorMemoryAgent* memoryAgent, Inspe ctorDOMAgent* domAgent, InspectorCompositeState* state, InspectorType type, Insp ectorClient* client) 734 PassRefPtr<InspectorTimelineAgent> InspectorTimelineAgent::create(InstrumentingA gents* instrumentingAgents, InspectorState* state, PassRefPtr<InspectorPageAgent > pageAgent, PassRefPtr<InspectorMemoryAgent> memoryAgent, PassRefPtr<InspectorD OMAgent> domAgent, InspectorType type, InspectorClient* client)
735 : InspectorBaseAgent<InspectorTimelineAgent>("Timeline", instrumentingAgents , state) 735 {
736 return adoptRef(new InspectorTimelineAgent(instrumentingAgents, state, pageA gent, memoryAgent, domAgent, type, client));
737 }
738
739 InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents* instrumentin gAgents, InspectorState* state, PassRefPtr<InspectorPageAgent> pageAgent, PassRe fPtr<InspectorMemoryAgent> memoryAgent, PassRefPtr<InspectorDOMAgent> domAgent, InspectorType type, InspectorClient* client)
740 : InspectorBaseAgent(instrumentingAgents, state)
736 , m_pageAgent(pageAgent) 741 , m_pageAgent(pageAgent)
737 , m_memoryAgent(memoryAgent) 742 , m_memoryAgent(memoryAgent)
738 , m_domAgent(domAgent) 743 , m_domAgent(domAgent)
739 , m_frontend(0) 744 , m_frontend(0)
740 , m_id(1) 745 , m_id(1)
741 , m_maxCallStackDepth(5) 746 , m_maxCallStackDepth(5)
742 , m_platformInstrumentationClientInstalledAtStackDepth(0) 747 , m_platformInstrumentationClientInstalledAtStackDepth(0)
743 , m_inspectorType(type) 748 , m_inspectorType(type)
744 , m_client(client) 749 , m_client(client)
745 , m_weakFactory(this) 750 , m_weakFactory(this)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 double InspectorTimelineAgent::timestamp() 827 double InspectorTimelineAgent::timestamp()
823 { 828 {
824 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime()); 829 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime());
825 } 830 }
826 831
827 Page* InspectorTimelineAgent::page() 832 Page* InspectorTimelineAgent::page()
828 { 833 {
829 return m_pageAgent ? m_pageAgent->page() : 0; 834 return m_pageAgent ? m_pageAgent->page() : 0;
830 } 835 }
831 836
837 InspectorTimelineController::InspectorTimelineController(InstrumentingAgents* in strumentingAgents, InspectorCompositeState* compositeState, InspectorPageControl ler* pageController, InspectorMemoryController* memoryController, InspectorDOMCo ntroller* domController, InspectorTimelineAgent::InspectorType type, InspectorCl ient* client)
838 : InspectorBaseController<InspectorTimelineController, InspectorTimelineAgen t>("Timeline", instrumentingAgents, compositeState)
839 {
840 setAgent(InspectorTimelineAgent::create(m_instrumentingAgents, m_state, page Controller ? pageController->getAgent() : 0, memoryController ? memoryController ->getAgent() : 0, domController ? domController->getAgent() : 0, type, client));
841 }
842
832 } // namespace WebCore 843 } // namespace WebCore
833 844
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698