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

Unified 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: Rebased Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/InspectorTimelineAgent.cpp
diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
index f2002cc2daccc56e96aa410fbd3cbfbfb30bb0d8..38dcbb094a818897142f346eca9edf5115b473ff 100644
--- a/Source/core/inspector/InspectorTimelineAgent.cpp
+++ b/Source/core/inspector/InspectorTimelineAgent.cpp
@@ -158,6 +158,7 @@ struct TimelineRecordEntry {
};
class TimelineRecordStack {
+ DISALLOW_ALLOCATION();
private:
struct Entry {
Entry(PassRefPtr<TimelineEvent> record, const String& type)
@@ -177,7 +178,7 @@ private:
};
public:
- TimelineRecordStack() : m_timelineAgent(0) { }
+ TimelineRecordStack() : m_timelineAgent(nullptr) { }
TimelineRecordStack(InspectorTimelineAgent*);
haraken 2014/06/19 05:49:53 Add explicit.
keishi 2014/07/24 02:15:02 Done.
void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type);
@@ -188,14 +189,16 @@ public:
bool isOpenRecordOfType(const String& type);
#endif
+ void trace(Visitor*);
+
private:
void send(PassRefPtr<JSONObject>);
- InspectorTimelineAgent* m_timelineAgent;
+ RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent;
Vector<Entry> m_stack;
};
-struct TimelineThreadState {
+struct TimelineThreadState : public NoBaseWillBeGarbageCollectedFinalized<TimelineThreadState> {
haraken 2014/06/19 05:49:53 I think you can use ALLOW_ONLY_INLINE_ALLOCATION i
haraken 2014/06/19 05:49:53 Nit: struct => class
keishi 2014/07/24 02:15:02 Done.
keishi 2014/07/24 02:15:02 Should this be a class? The accessors are public.
TimelineThreadState() { }
TimelineThreadState(InspectorTimelineAgent* timelineAgent)
@@ -205,6 +208,8 @@ struct TimelineThreadState {
{
}
+ void trace(Visitor*);
+
TimelineRecordStack recordStack;
bool inKnownLayerTask;
unsigned long long decodedPixelRefId;
@@ -265,6 +270,7 @@ void InspectorTimelineAgent::trace(Visitor* visitor)
{
visitor->trace(m_pageAgent);
visitor->trace(m_layerTreeAgent);
+ visitor->trace(m_threadStates);
InspectorBaseAgent::trace(visitor);
}
@@ -1208,8 +1214,8 @@ TimelineThreadState& InspectorTimelineAgent::threadState(ThreadIdentifier thread
{
ThreadStateMap::iterator it = m_threadStates.find(thread);
if (it != m_threadStates.end())
- return it->value;
- return m_threadStates.add(thread, TimelineThreadState(this)).storedValue->value;
+ return *(it->value);
+ return *(m_threadStates.add(thread, adoptPtrWillBeNoop(new TimelineThreadState(this))).storedValue->value);
}
void InspectorTimelineAgent::commitFrameRecord()
@@ -1317,5 +1323,15 @@ bool TimelineRecordStack::isOpenRecordOfType(const String& type)
}
#endif
+void TimelineRecordStack::trace(Visitor* visitor)
+{
+ visitor->trace(m_timelineAgent);
+}
+
+void TimelineThreadState::trace(Visitor* visitor)
+{
+ recordStack.trace(visitor);
haraken 2014/06/19 05:49:53 visitor->trace(recordStack) should work.
keishi 2014/07/24 02:15:02 Done.
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698