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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 HeapStatsUpdateTask(InspectorHeapProfilerAgent*); 53 HeapStatsUpdateTask(InspectorHeapProfilerAgent*);
54 void startTimer(); 54 void startTimer();
55 void resetTimer() { m_timer.stop(); } 55 void resetTimer() { m_timer.stop(); }
56 void onTimer(Timer<HeapStatsUpdateTask>*); 56 void onTimer(Timer<HeapStatsUpdateTask>*);
57 57
58 private: 58 private:
59 InspectorHeapProfilerAgent* m_heapProfilerAgent; 59 InspectorHeapProfilerAgent* m_heapProfilerAgent;
60 Timer<HeapStatsUpdateTask> m_timer; 60 Timer<HeapStatsUpdateTask> m_timer;
61 }; 61 };
62 62
63 PassOwnPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(Instru mentingAgents* instrumentingAgents, InspectorCompositeState* inspectorState, Inj ectedScriptManager* injectedScriptManager) 63 PassRefPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(Instru mentingAgents* instrumentingAgents, InspectorState* inspectorState, InjectedScri ptManager* injectedScriptManager)
64 { 64 {
65 return adoptPtr(new InspectorHeapProfilerAgent(instrumentingAgents, inspecto rState, injectedScriptManager)); 65 return adoptRef(new InspectorHeapProfilerAgent(instrumentingAgents, inspecto rState, injectedScriptManager));
66 } 66 }
67 67
68 InspectorHeapProfilerAgent::InspectorHeapProfilerAgent(InstrumentingAgents* inst rumentingAgents, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager) 68 InspectorHeapProfilerAgent::InspectorHeapProfilerAgent(InstrumentingAgents* inst rumentingAgents, InspectorState* inspectorState, InjectedScriptManager* injected ScriptManager)
69 : InspectorBaseAgent<InspectorHeapProfilerAgent>("HeapProfiler", instrumenti ngAgents, inspectorState) 69 : InspectorBaseAgent(instrumentingAgents, inspectorState)
70 , m_injectedScriptManager(injectedScriptManager) 70 , m_injectedScriptManager(injectedScriptManager)
71 , m_frontend(0) 71 , m_frontend(0)
72 , m_nextUserInitiatedHeapSnapshotNumber(1) 72 , m_nextUserInitiatedHeapSnapshotNumber(1)
73 { 73 {
74 } 74 }
75 75
76 InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent() 76 InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent()
77 { 77 {
78 } 78 }
79 79
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 *errorString = "Object with given id not found"; 312 *errorString = "Object with given id not found";
313 return; 313 return;
314 } 314 }
315 unsigned id = ScriptProfiler::getHeapObjectId(value); 315 unsigned id = ScriptProfiler::getHeapObjectId(value);
316 *heapSnapshotObjectId = String::number(id); 316 *heapSnapshotObjectId = String::number(id);
317 } 317 }
318 318
319 void InspectorHeapProfilerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjec tInfo) const 319 void InspectorHeapProfilerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjec tInfo) const
320 { 320 {
321 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorPr ofilerAgent); 321 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorPr ofilerAgent);
322 InspectorBaseAgent<InspectorHeapProfilerAgent>::reportMemoryUsage(memoryObje ctInfo); 322 InspectorBaseAgent::reportMemoryUsage(memoryObjectInfo);
323 info.addMember(m_injectedScriptManager, "injectedScriptManager"); 323 info.addMember(m_injectedScriptManager, "injectedScriptManager");
324 info.addWeakPointer(m_frontend); 324 info.addWeakPointer(m_frontend);
325 info.addMember(m_snapshots, "snapshots"); 325 info.addMember(m_snapshots, "snapshots");
326 } 326 }
327 327
328 } // namespace WebCore 328 } // namespace WebCore
329 329
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorHeapProfilerAgent.h ('k') | Source/core/inspector/InspectorIndexedDBAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698