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

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

Issue 235043002: TimelinePanel: make GC events synchronous. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 8 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/InspectorTimelineAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorTimelineAgent.cpp
diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
index d7d94a598f4e468fb905f14d0e22f73d9cd8ac08..9000d4eec4c07b0a33b34b086df6add0a4761ae8 100644
--- a/Source/core/inspector/InspectorTimelineAgent.cpp
+++ b/Source/core/inspector/InspectorTimelineAgent.cpp
@@ -216,16 +216,6 @@ struct TimelineThreadState {
unsigned long long decodedPixelRefId;
};
-struct TimelineGCEvent {
- TimelineGCEvent(double startTime, double endTime, size_t collectedBytes)
- : startTime(startTime), endTime(endTime), collectedBytes(collectedBytes)
- {
- }
- double startTime;
- double endTime;
- size_t collectedBytes;
-};
-
struct TimelineImageInfo {
int backendNodeId;
String url;
@@ -258,24 +248,15 @@ static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window,
return false;
}
-void InspectorTimelineAgent::pushGCEventRecords()
-{
- if (!m_gcEvents.size())
- return;
-
- GCEvents events = m_gcEvents;
- m_gcEvents.clear();
- for (GCEvents::iterator i = events.begin(); i != events.end(); ++i) {
- double ts = i->startTime * msPerSecond;
- RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ts, m_maxCallStackDepth, TimelineRecordType::GCEvent, TimelineRecordFactory::createGCEventData(i->collectedBytes));
- record->setEndTime(i->endTime * msPerSecond);
- addRecordToTimeline(record.release(), ts);
- }
-}
-
void InspectorTimelineAgent::didGC(double startTime, double endTime, size_t collectedBytesCount)
{
- m_gcEvents.append(TimelineGCEvent(startTime, endTime, collectedBytesCount));
+ RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(
+ startTime * msPerSecond,
+ 0,
+ TimelineRecordType::GCEvent,
+ TimelineRecordFactory::createGCEventData(collectedBytesCount));
+ record->setEndTime(endTime * msPerSecond);
+ addRecordToTimeline(record.release(), timestamp());
}
InspectorTimelineAgent::~InspectorTimelineAgent()
@@ -429,7 +410,6 @@ void InspectorTimelineAgent::innerStop(bool fromConsole)
clearRecordStack();
m_threadStates.clear();
- m_gcEvents.clear();
m_gpuTask.clear();
m_layerToNodeMap.clear();
m_pixelRefToImageInfo.clear();
@@ -1157,7 +1137,6 @@ void InspectorTimelineAgent::didCompleteCurrentRecord(const String& type)
PlatformInstrumentation::setClient(0);
}
- pushGCEventRecords();
TimelineRecordEntry entry = m_recordStack.last();
m_recordStack.removeLast();
while (entry.type != type && entry.skipWhenUnbalanced && !m_recordStack.isEmpty()) {
@@ -1210,7 +1189,6 @@ InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, In
void InspectorTimelineAgent::appendRecord(PassRefPtr<JSONObject> data, const String& type, bool captureCallStack, LocalFrame* frame)
{
- pushGCEventRecords();
double ts = timestamp();
RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ts, captureCallStack ? m_maxCallStackDepth : 0, type, data);
setFrameIdentifier(record.get(), frame);
@@ -1230,7 +1208,6 @@ void InspectorTimelineAgent::sendEvent(PassRefPtr<TimelineEvent> record)
void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<JSONObject> data, const String& type, bool captureCallStack, LocalFrame* frame, bool hasLowLevelDetails)
{
- pushGCEventRecords();
commitFrameRecord();
RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0, type, data.get());
setFrameIdentifier(record.get(), frame);
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698