Exemplo n.º 1
0
void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack)
{
    pushGCEventRecords();
    commitCancelableRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
    m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type));
}
Exemplo n.º 2
0
void InspectorTimelineAgent::didMarkTimeline(const String& message)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
    record->setObject("data", TimelineRecordFactory::createMarkTimelineData(message));
    addRecordToTimeline(record.release(), MarkTimelineRecordType);
}
Exemplo n.º 3
0
void InspectorTimelineAgent::didRemoveTimer(int timerId)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
    record->setObject("data", TimelineRecordFactory::createGenericTimerData(timerId));
    addRecordToTimeline(record.release(), TimerRemoveTimelineRecordType);
}
Exemplo n.º 4
0
void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool singleShot)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
    record->setObject("data", TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot));
    addRecordToTimeline(record.release(), TimerInstallTimelineRecordType);
}
Exemplo n.º 5
0
void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, TimelineRecordType type, bool captureCallStack, Frame* frame)
{
    pushGCEventRecords();
    commitFrameRecord();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
    setFrameIdentifier(record.get(), frame);
    m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type, getUsedHeapSize()));
}
Exemplo n.º 6
0
void InspectorTimelineAgent::appendRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack, Frame* frame)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
    record->setObject("data", data);
    setFrameIdentifier(record.get(), frame);
    addRecordToTimeline(record.release(), type);
}
Exemplo n.º 7
0
void InspectorTimelineAgent::didScheduleResourceRequest(const String& url)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
    record->setObject("data", TimelineRecordFactory::createScheduleResourceRequestData(url));
    record->setNumber("type", ScheduleResourceRequestTimelineRecordType);
    addRecordToTimeline(record.release(), ScheduleResourceRequestTimelineRecordType);
}
Exemplo n.º 8
0
void InspectorTimelineAgent::appendRecord(PassRefPtr<InspectorObject> data, const String& type)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth);
    record->setObject("data", data);
    record->setString("type", type);
    addRecordToTimeline(record.release(), type);
}
Exemplo n.º 9
0
void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail, double finishTime)
{
    pushGCEventRecords();
    // Sometimes network stack can provide for us exact finish loading time. In the other case we will use currentTime.
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(finishTime ? finishTime * 1000 : WTF::currentTimeMS());
    record->setObject("data", TimelineRecordFactory::createResourceFinishData(identifier, didFail));
    record->setNumber("type", ResourceFinishTimelineRecordType);
    setHeapSizeStatistic(record.get());
    m_frontend->addRecordToTimeline(record.release());
}
Exemplo n.º 10
0
void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, bool isMainResource,
    const ResourceRequest& request)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
    record->setObject("data", TimelineRecordFactory::createResourceSendRequestData(identifier, isMainResource, request));
    record->setNumber("type", ResourceSendRequestTimelineRecordType);
    setHeapSizeStatistic(record.get());
    m_frontend->addRecordToTimeline(record.release());
}
Exemplo n.º 11
0
void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, const ResourceRequest& request)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth);
    String requestId = IdentifiersFactory::requestId(identifier);
    record->setObject("data", TimelineRecordFactory::createResourceSendRequestData(requestId, request));
    record->setString("type", TimelineRecordType::ResourceSendRequest);
    setHeapSizeStatistic(record.get());
    m_frontend->eventRecorded(record.release());
}
Exemplo n.º 12
0
void InspectorTimelineAgent::appendRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack, Frame* frame)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
    record->setObject("data", data);
    record->setString("type", type);
    String frameId;
    if (frame && m_pageAgent)
        frameId = m_pageAgent->frameId(frame);
    addRecordToTimeline(record.release(), type, frameId);
}
Exemplo n.º 13
0
void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack, Frame* frame, bool hasLowLevelDetails)
{
    pushGCEventRecords();
    commitFrameRecord();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
    setFrameIdentifier(record.get(), frame);
    m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type, getUsedHeapSize()));
    if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDepth && !PlatformInstrumentation::hasClient()) {
        m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
        PlatformInstrumentation::setClient(this);
    }
}
Exemplo n.º 14
0
void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, const ResourceRequest& request)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> recordRaw = TimelineRecordFactory::createGenericRecord(timestamp(), m_maxCallStackDepth);
    String requestId = IdentifiersFactory::requestId(identifier);
    recordRaw->setObject("data", TimelineRecordFactory::createResourceSendRequestData(requestId, request));
    recordRaw->setString("type", TimelineRecordType::ResourceSendRequest);
    setHeapSizeStatistic(recordRaw.get());
    // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now.
    RefPtr<TypeBuilder::Timeline::TimelineEvent> record = TypeBuilder::Timeline::TimelineEvent::runtimeCast(recordRaw.release());
    m_frontend->eventRecorded(record.release());
}
Exemplo n.º 15
0
void InspectorTimelineAgent::didCompleteCurrentRecord(const String& type)
{
    // An empty stack could merely mean that the timeline agent was turned on in the middle of
    // an event.  Don't treat as an error.
    if (!m_recordStack.isEmpty()) {
        pushGCEventRecords();
        TimelineRecordEntry entry = m_recordStack.last();
        m_recordStack.removeLast();
        ASSERT(entry.type == type);
        entry.record->setObject("data", entry.data);
        entry.record->setArray("children", entry.children);
        entry.record->setNumber("endTime", WTF::currentTimeMS());
        addRecordToTimeline(entry.record, type);
    }
}
Exemplo n.º 16
0
void InspectorTimelineAgent::didCompleteCurrentRecord(TimelineRecordType type)
{
    // An empty stack could merely mean that the timeline agent was turned on in the middle of
    // an event.  Don't treat as an error.
    if (!m_recordStack.isEmpty()) {
        pushGCEventRecords();
        TimelineRecordEntry entry = m_recordStack.last();
        m_recordStack.removeLast();
        ASSERT(entry.type == type);
        entry.record->setObject("data", entry.data);
        entry.record->setArray("children", entry.children);
        entry.record->setNumber("endTime", timestamp());
        size_t usedHeapSizeDelta = getUsedHeapSize() - entry.usedHeapSizeAtStart;
        if (usedHeapSizeDelta)
            entry.record->setNumber("usedHeapSizeDelta", usedHeapSizeDelta);
        addRecordToTimeline(entry.record, type);
    }
}
Exemplo n.º 17
0
void InspectorTimelineAgent::didCompleteCurrentRecord(const String& type)
{
    // An empty stack could merely mean that the timeline agent was turned on in the middle of
    // an event.  Don't treat as an error.
    if (!m_recordStack.isEmpty()) {
        if (m_platformInstrumentationClientInstalledAtStackDepth == m_recordStack.size()) {
            m_platformInstrumentationClientInstalledAtStackDepth = 0;
            PlatformInstrumentation::setClient(0);
        }

        pushGCEventRecords();
        TimelineRecordEntry entry = m_recordStack.last();
        m_recordStack.removeLast();
        ASSERT(entry.type == type);
        entry.record->setObject("data", entry.data);
        entry.record->setArray("children", entry.children);
        entry.record->setNumber("endTime", timestamp());
        size_t usedHeapSizeDelta = getUsedHeapSize() - entry.usedHeapSizeAtStart;
        if (usedHeapSizeDelta)
            entry.record->setNumber("usedHeapSizeDelta", usedHeapSizeDelta);
        addRecordToTimeline(entry.record, type, entry.frameId);
    }
}
Exemplo n.º 18
0
void InspectorTimelineAgent::didMarkLoadEvent()
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
    addRecordToTimeline(record.release(), MarkLoadEventType);
}
Exemplo n.º 19
0
void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type)
{
    pushGCEventRecords();
    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth);
    m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type));
}