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

Unified Diff: Source/core/inspector/InspectorHeapProfilerAgent.cpp

Issue 306053010: Tried using CrossThreadPersistent for workerDebuggerAgents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorHeapProfilerAgent.h ('k') | Source/core/inspector/InspectorHistory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorHeapProfilerAgent.cpp
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index 1e556282bd717a59ae0bc5cb67424bf9a67a7c7f..a2425ffac998eb80edb666cdfe7e70e3ed32b3de 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
@@ -48,21 +48,22 @@ static const char heapObjectsTrackingEnabled[] = "heapObjectsTrackingEnabled";
static const char allocationTrackingEnabled[] = "allocationTrackingEnabled";
}
-class InspectorHeapProfilerAgent::HeapStatsUpdateTask {
+class InspectorHeapProfilerAgent::HeapStatsUpdateTask : public NoBaseWillBeGarbageCollectedFinalized<InspectorHeapProfilerAgent::HeapStatsUpdateTask> {
public:
HeapStatsUpdateTask(InspectorHeapProfilerAgent*);
void startTimer();
void resetTimer() { m_timer.stop(); }
void onTimer(Timer<HeapStatsUpdateTask>*);
+ void trace(Visitor*);
private:
- InspectorHeapProfilerAgent* m_heapProfilerAgent;
+ RawPtrWillBeMember<InspectorHeapProfilerAgent> m_heapProfilerAgent;
Timer<HeapStatsUpdateTask> m_timer;
};
-PassOwnPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(InjectedScriptManager* injectedScriptManager)
+PassOwnPtrWillBeRawPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(InjectedScriptManager* injectedScriptManager)
{
- return adoptPtr(new InspectorHeapProfilerAgent(injectedScriptManager));
+ return adoptPtrWillBeNoop(new InspectorHeapProfilerAgent(injectedScriptManager));
}
InspectorHeapProfilerAgent::InspectorHeapProfilerAgent(InjectedScriptManager* injectedScriptManager)
@@ -126,6 +127,11 @@ void InspectorHeapProfilerAgent::HeapStatsUpdateTask::startTimer()
m_timer.startRepeating(0.05, FROM_HERE);
}
+void InspectorHeapProfilerAgent::HeapStatsUpdateTask::trace(Visitor* visitor)
+{
+ visitor->trace(m_heapProfilerAgent);
+}
+
class InspectorHeapProfilerAgent::HeapStatsStream FINAL : public ScriptProfiler::OutputStream {
public:
HeapStatsStream(InspectorHeapProfilerAgent* heapProfilerAgent)
@@ -186,7 +192,7 @@ void InspectorHeapProfilerAgent::startTrackingHeapObjectsInternal(bool trackAllo
if (m_heapStatsUpdateTask)
return;
ScriptProfiler::startTrackingHeapObjects(trackAllocations);
- m_heapStatsUpdateTask = adoptPtr(new HeapStatsUpdateTask(this));
+ m_heapStatsUpdateTask = adoptPtrWillBeNoop(new HeapStatsUpdateTask(this));
m_heapStatsUpdateTask->startTimer();
}
@@ -312,5 +318,11 @@ void InspectorHeapProfilerAgent::getHeapObjectId(ErrorString* errorString, const
*heapSnapshotObjectId = String::number(id);
}
+void InspectorHeapProfilerAgent::trace(Visitor* visitor)
+{
+ visitor->trace(m_heapStatsUpdateTask);
+ InspectorBaseAgent::trace(visitor);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/InspectorHeapProfilerAgent.h ('k') | Source/core/inspector/InspectorHistory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698