#include "core/events/Event.h"
#include "core/frame/DOMWindow.h"
+#include "core/frame/FrameConsole.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
-#include "core/frame/PageConsole.h"
#include "core/inspector/IdentifiersFactory.h"
#include "core/inspector/InspectorClient.h"
#include "core/inspector/InspectorCounters.h"
-#include "core/inspector/InspectorDOMAgent.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorLayerTreeAgent.h"
+#include "core/inspector/InspectorNodeIds.h"
#include "core/inspector/InspectorOverlay.h"
#include "core/inspector/InspectorPageAgent.h"
#include "core/inspector/InspectorState.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/network/ResourceRequest.h"
#include "wtf/CurrentTime.h"
+#include "wtf/DateMath.h"
namespace WebCore {
static const char InvalidateLayout[] = "InvalidateLayout";
static const char Layout[] = "Layout";
static const char UpdateLayerTree[] = "UpdateLayerTree";
-static const char AutosizeText[] = "AutosizeText";
static const char Paint[] = "Paint";
static const char ScrollLayer[] = "ScrollLayer";
static const char ResizeImage[] = "ResizeImage";
static const char TimeStamp[] = "TimeStamp";
static const char ConsoleTime[] = "ConsoleTime";
-static const char ScheduleResourceRequest[] = "ScheduleResourceRequest";
static const char ResourceSendRequest[] = "ResourceSendRequest";
static const char ResourceReceiveResponse[] = "ResourceReceiveResponse";
static const char ResourceReceivedData[] = "ResourceReceivedData";
static const char FunctionCall[] = "FunctionCall";
static const char GCEvent[] = "GCEvent";
+static const char UpdateCounters[] = "UpdateCounters";
+
static const char RequestAnimationFrame[] = "RequestAnimationFrame";
static const char CancelAnimationFrame[] = "CancelAnimationFrame";
static const char FireAnimationFrame[] = "FireAnimationFrame";
static const char EmbedderCallback[] = "EmbedderCallback";
}
-namespace {
-const char BackendNodeIdGroup[] = "timeline";
-}
-
using TypeBuilder::Timeline::TimelineEvent;
struct TimelineRecordEntry {
- TimelineRecordEntry(PassRefPtr<TimelineEvent> record, PassRefPtr<JSONObject> data, PassRefPtr<TypeBuilder::Array<TimelineEvent> > children, const String& type, size_t usedHeapSizeAtStart)
+ TimelineRecordEntry(PassRefPtr<TimelineEvent> record, PassRefPtr<JSONObject> data, PassRefPtr<TypeBuilder::Array<TimelineEvent> > children, const String& type)
: record(record)
, data(data)
, children(children)
, type(type)
- , usedHeapSizeAtStart(usedHeapSizeAtStart)
, skipWhenUnbalanced(false)
{
}
RefPtr<JSONObject> data;
RefPtr<TypeBuilder::Array<TimelineEvent> > children;
String type;
- size_t usedHeapSizeAtStart;
bool skipWhenUnbalanced;
};
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;
return false;
}
-void TimelineTimeConverter::reset()
-{
- m_startOffset = monotonicallyIncreasingTime() - currentTime();
-}
-
-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 = m_timeConverter.fromMonotonicallyIncreasingTime(i->startTime);
- RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ts, m_maxCallStackDepth, TimelineRecordType::GCEvent, TimelineRecordFactory::createGCEventData(i->collectedBytes));
- record->setEndTime(m_timeConverter.fromMonotonicallyIncreasingTime(i->endTime));
- 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);
+ double time = timestamp();
+ addRecordToTimeline(record.release(), time);
+ if (m_state->getBoolean(TimelineAgentState::includeCounters)) {
+ addRecordToTimeline(createCountersUpdate(), time);
+ }
}
InspectorTimelineAgent::~InspectorTimelineAgent()
RefPtr<TypeBuilder::Array<TimelineEvent> > events;
stop(&error, events);
disable(&error);
- releaseNodeIds();
m_frontend = 0;
}
return;
}
- releaseNodeIds();
if (maxCallStackDepth && *maxCallStackDepth >= 0)
m_maxCallStackDepth = *maxCallStackDepth;
else
if (m_overlay)
m_overlay->startedRecordingProfile();
m_state->setBoolean(TimelineAgentState::started, true);
- m_timeConverter.reset();
m_instrumentingAgents->setInspectorTimelineAgent(this);
ScriptGCEvent::addEventListener(this);
if (m_client) {
clearRecordStack();
m_threadStates.clear();
- m_gcEvents.clear();
m_gpuTask.clear();
m_layerToNodeMap.clear();
m_pixelRefToImageInfo.clear();
for (size_t i = 0; i < m_consoleTimelines.size(); ++i) {
String message = String::format("Timeline '%s' terminated.", m_consoleTimelines[i].utf8().data());
- frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message);
+ mainFrame()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message);
}
m_consoleTimelines.clear();
m_pendingFrameRecord.clear();
}
-bool InspectorTimelineAgent::willCallFunction(ExecutionContext* context, const String& scriptName, int scriptLine)
+bool InspectorTimelineAgent::willCallFunction(ExecutionContext* context, int scriptId, const String& scriptName, int scriptLine)
{
- pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frameForExecutionContext(context));
+ pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptId, scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frameForExecutionContext(context));
return true;
}
void InspectorTimelineAgent::layerTreeDidChange()
{
- RefPtr<JSONValue> layerTree = m_layerTreeAgent->buildLayerTree(BackendNodeIdGroup);
- appendRecord(TimelineRecordFactory::createLayerTreeData(layerTree), TimelineRecordType::UpdateLayerTree, false, 0);
+ ASSERT(!m_pendingLayerTreeData);
+ m_pendingLayerTreeData = m_layerTreeAgent->buildLayerTree();
}
-void InspectorTimelineAgent::willAutosizeText(RenderObject* renderer)
+void InspectorTimelineAgent::willUpdateLayerTree()
{
- pushCurrentRecord(TimelineRecordFactory::createNodeData(nodeId(renderer)), TimelineRecordType::AutosizeText, false, renderer->frame());
+ pushCurrentRecord(JSONObject::create(), TimelineRecordType::UpdateLayerTree, false, 0);
}
-void InspectorTimelineAgent::didAutosizeText(RenderObject* renderer)
+void InspectorTimelineAgent::didUpdateLayerTree()
{
- if (renderer->needsLayout()) {
- TimelineRecordEntry& entry = m_recordStack.last();
- ASSERT(entry.type == TimelineRecordType::AutosizeText);
- entry.data->setBoolean("needsRelayout", true);
- }
- didCompleteCurrentRecord(TimelineRecordType::AutosizeText);
+ if (m_recordStack.isEmpty())
+ return;
+ TimelineRecordEntry& entry = m_recordStack.last();
+ ASSERT(entry.type == TimelineRecordType::UpdateLayerTree);
+ if (m_pendingLayerTreeData)
+ TimelineRecordFactory::setLayerTreeData(entry.data.get(), m_pendingLayerTreeData.release());
+ didCompleteCurrentRecord(TimelineRecordType::UpdateLayerTree);
}
void InspectorTimelineAgent::didScheduleStyleRecalculation(Document* document)
bool InspectorTimelineAgent::willRecalculateStyle(Document* document)
{
pushCurrentRecord(JSONObject::create(), TimelineRecordType::RecalculateStyles, true, document->frame());
- ASSERT(!m_styleRecalcElementCounter);
return true;
}
-void InspectorTimelineAgent::didRecalculateStyle()
+void InspectorTimelineAgent::didRecalculateStyle(int elementCount)
{
if (m_recordStack.isEmpty())
return;
TimelineRecordEntry& entry = m_recordStack.last();
ASSERT(entry.type == TimelineRecordType::RecalculateStyles);
- TimelineRecordFactory::setStyleRecalcDetails(entry.data.get(), m_styleRecalcElementCounter);
- m_styleRecalcElementCounter = 0;
+ TimelineRecordFactory::setStyleRecalcDetails(entry.data.get(), elementCount);
didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles);
}
-void InspectorTimelineAgent::didRecalculateStyleForElement()
-{
- ++m_styleRecalcElementCounter;
-}
-
void InspectorTimelineAgent::willPaint(RenderObject* renderer, const GraphicsLayer* graphicsLayer)
{
LocalFrame* frame = renderer->frame();
didCompleteCurrentRecord(TimelineRecordType::EvaluateScript);
}
-void InspectorTimelineAgent::didScheduleResourceRequest(Document* document, const String& url)
-{
- appendRecord(TimelineRecordFactory::createScheduleResourceRequestData(url), TimelineRecordType::ScheduleResourceRequest, true, document->frame());
-}
-
void InspectorTimelineAgent::willSendRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse&, const FetchInitiatorInfo&)
{
String requestId = IdentifiersFactory::requestId(identifier);
void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail, double finishTime)
{
- appendRecord(TimelineRecordFactory::createResourceFinishData(IdentifiersFactory::requestId(identifier), didFail, finishTime * 1000), TimelineRecordType::ResourceFinish, false, 0);
+ appendRecord(TimelineRecordFactory::createResourceFinishData(IdentifiersFactory::requestId(identifier), didFail, finishTime), TimelineRecordType::ResourceFinish, false, 0);
}
void InspectorTimelineAgent::didFinishLoading(unsigned long identifier, DocumentLoader* loader, double monotonicFinishTime, int64_t)
{
- double finishTime = 0.0;
- // FIXME: Expose all of the timing details to inspector and have it calculate finishTime.
- if (monotonicFinishTime)
- finishTime = loader->timing()->monotonicTimeToPseudoWallTime(monotonicFinishTime);
-
- didFinishLoadingResource(identifier, false, finishTime);
+ didFinishLoadingResource(identifier, false, monotonicFinishTime * msPerSecond);
}
void InspectorTimelineAgent::didFailLoading(unsigned long identifier, const ResourceError& error)
didCompleteCurrentRecord(TimelineRecordType::ConsoleTime);
}
-void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const String& title, ScriptState* state)
+void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const String& title, ScriptState* scriptState)
{
if (!m_state->getBoolean(TimelineAgentState::enabled))
return;
String message = String::format("Timeline '%s' started.", title.utf8().data());
- frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, state);
+ mainFrame()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, scriptState);
m_consoleTimelines.append(title);
if (!isStarted()) {
innerStart();
appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp, true, frameForExecutionContext(context));
}
-void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const String& title, ScriptState* state)
+void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const String& title, ScriptState* scriptState)
{
if (!m_state->getBoolean(TimelineAgentState::enabled))
return;
size_t index = m_consoleTimelines.find(title);
if (index == kNotFound) {
String message = String::format("Timeline '%s' was not started.", title.utf8().data());
- frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, state);
+ mainFrame()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, scriptState);
return;
}
unwindRecordStack();
innerStop(true);
}
- frameHost()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, state);
+ mainFrame()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, scriptState);
}
void InspectorTimelineAgent::domContentLoadedEventFired(LocalFrame* frame)
void InspectorTimelineAgent::onPaintSetupBegin(const TraceEventDispatcher::TraceEvent& event)
{
ASSERT(!m_paintSetupStart);
- m_paintSetupStart = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ m_paintSetupStart = event.timestamp() * msPerSecond;
}
void InspectorTimelineAgent::onPaintSetupEnd(const TraceEventDispatcher::TraceEvent& event)
{
ASSERT(m_paintSetupStart);
- m_paintSetupEnd = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ m_paintSetupEnd = event.timestamp() * msPerSecond;
}
void InspectorTimelineAgent::onRasterTaskBegin(const TraceEventDispatcher::TraceEvent& event)
return;
ASSERT(!state.inKnownLayerTask);
state.inKnownLayerTask = true;
- double timestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ double timestamp = event.timestamp() * msPerSecond;
RefPtr<JSONObject> data = TimelineRecordFactory::createLayerData(m_layerToNodeMap.get(layerId));
RefPtr<TimelineEvent> record = TimelineRecordFactory::createBackgroundRecord(timestamp, String::number(event.threadIdentifier()), TimelineRecordType::Rasterize, data);
state.recordStack.addScopedRecord(record, TimelineRecordType::Rasterize);
if (!state.inKnownLayerTask)
return;
ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::Rasterize));
- state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
+ state.recordStack.closeScopedRecord(event.timestamp() * msPerSecond);
state.inKnownLayerTask = false;
}
}
RefPtr<JSONObject> data = JSONObject::create();
TimelineRecordFactory::setImageDetails(data.get(), imageInfo.backendNodeId, imageInfo.url);
- double timeestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ double timeestamp = event.timestamp() * msPerSecond;
state.recordStack.addScopedRecord(TimelineRecordFactory::createBackgroundRecord(timeestamp, String::number(event.threadIdentifier()), TimelineRecordType::DecodeImage, data), TimelineRecordType::DecodeImage);
}
if (!state.decodedPixelRefId)
return;
ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::DecodeImage));
- state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
+ state.recordStack.closeScopedRecord(event.timestamp() * msPerSecond);
}
void InspectorTimelineAgent::onRequestMainThreadFrame(const TraceEventDispatcher::TraceEvent& event)
void InspectorTimelineAgent::processGPUEvent(const GPUEvent& event)
{
- double timelineTimestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp);
+ double timelineTimestamp = event.timestamp * msPerSecond;
if (event.phase == GPUEvent::PhaseBegin) {
m_pendingGPURecord = TimelineRecordFactory::createBackgroundRecord(timelineTimestamp, "gpu", TimelineRecordType::GPUTask, TimelineRecordFactory::createGPUTaskData(event.foreign));
} else if (m_pendingGPURecord) {
m_pendingGPURecord->setEndTime(timelineTimestamp);
+ sendEvent(m_pendingGPURecord.release());
if (!event.foreign && m_state->getBoolean(TimelineAgentState::includeCounters)) {
RefPtr<TypeBuilder::Timeline::Counters> counters = TypeBuilder::Timeline::Counters::create();
counters->setGpuMemoryUsedKB(static_cast<double>(event.usedGPUMemoryBytes / 1024));
- m_pendingGPURecord->setCounters(counters.release());
+ counters->setGpuMemoryLimitKB(static_cast<double>(event.limitGPUMemoryBytes / 1024));
+ sendEvent(TimelineRecordFactory::createBackgroundRecord(timelineTimestamp, "gpu", TimelineRecordType::UpdateCounters, counters.release()->asObject()));
}
- sendEvent(m_pendingGPURecord.release());
}
}
void InspectorTimelineAgent::onEmbedderCallbackBegin(const TraceEventDispatcher::TraceEvent& event)
{
TimelineThreadState& state = threadState(event.threadIdentifier());
- double timestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ double timestamp = event.timestamp() * msPerSecond;
RefPtr<JSONObject> data = TimelineRecordFactory::createEmbedderCallbackData(event.asString(InstrumentationEventArguments::CallbackName));
RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(timestamp, 0, TimelineRecordType::EmbedderCallback, data);
state.recordStack.addScopedRecord(record, TimelineRecordType::EmbedderCallback);
void InspectorTimelineAgent::onEmbedderCallbackEnd(const TraceEventDispatcher::TraceEvent& event)
{
TimelineThreadState& state = threadState(event.threadIdentifier());
- state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
+ state.recordStack.closeScopedRecord(event.timestamp() * msPerSecond);
}
void InspectorTimelineAgent::addRecordToTimeline(PassRefPtr<TimelineEvent> record, double ts)
TraceEventDispatcher::instance()->processBackgroundEvents();
sendEvent(record);
} else {
- setCounters(record.get());
TimelineRecordEntry& parent = m_recordStack.last();
parent.children->addItem(record);
+ if (m_state->getBoolean(TimelineAgentState::includeCounters))
+ parent.children->addItem(createCountersUpdate());
}
}
return info.usedJSHeapSize;
}
-void InspectorTimelineAgent::setCounters(TimelineEvent* record)
+PassRefPtr<TypeBuilder::Timeline::TimelineEvent> InspectorTimelineAgent::createCountersUpdate()
{
- if (!m_state->getBoolean(TimelineAgentState::includeCounters))
- return;
RefPtr<TypeBuilder::Timeline::Counters> counters = TypeBuilder::Timeline::Counters::create();
if (m_inspectorType == PageInspector) {
counters->setDocuments(InspectorCounters::counterValue(InspectorCounters::DocumentCounter));
counters->setJsEventListeners(InspectorCounters::counterValue(InspectorCounters::JSEventListenerCounter));
}
counters->setJsHeapSizeUsed(static_cast<double>(getUsedHeapSize()));
- record->setCounters(counters.release());
+ return TimelineRecordFactory::createGenericRecord(timestamp(), 0, TimelineRecordType::UpdateCounters, counters.release()->asObject());
}
void InspectorTimelineAgent::setFrameIdentifier(TimelineEvent* record, LocalFrame* frame)
PlatformInstrumentation::setClient(0);
}
- pushGCEventRecords();
TimelineRecordEntry entry = m_recordStack.last();
m_recordStack.removeLast();
while (entry.type != type && entry.skipWhenUnbalanced && !m_recordStack.isEmpty()) {
entry.record->setChildren(entry.children);
double ts = timestamp();
entry.record->setEndTime(ts);
- ptrdiff_t usedHeapSizeDelta = getUsedHeapSize() - entry.usedHeapSizeAtStart;
- if (usedHeapSizeDelta)
- entry.record->setUsedHeapSizeDelta(usedHeapSizeDelta);
addRecordToTimeline(entry.record, ts);
}
}
}
}
-InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, InspectorDOMAgent* domAgent, InspectorLayerTreeAgent* layerTreeAgent,
+InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, InspectorLayerTreeAgent* layerTreeAgent,
InspectorOverlay* overlay, InspectorType type, InspectorClient* client)
: InspectorBaseAgent<InspectorTimelineAgent>("Timeline")
, m_pageAgent(pageAgent)
- , m_domAgent(domAgent)
, m_layerTreeAgent(layerTreeAgent)
, m_frontend(0)
, m_client(client)
, m_platformInstrumentationClientInstalledAtStackDepth(0)
, m_imageBeingPainted(0)
, m_paintSetupStart(0)
- , m_styleRecalcElementCounter(0)
, m_mayEmitFirstPaint(false)
, m_lastProgressTimestamp(0)
{
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);
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);
- m_recordStack.append(TimelineRecordEntry(record.release(), data, TypeBuilder::Array<TimelineEvent>::create(), type, getUsedHeapSize()));
+ m_recordStack.append(TimelineRecordEntry(record.release(), data, TypeBuilder::Array<TimelineEvent>::create(), type));
if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDepth && !PlatformInstrumentation::hasClient()) {
m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
PlatformInstrumentation::setClient(this);
long long InspectorTimelineAgent::nodeId(Node* node)
{
- return m_domAgent && node ? m_domAgent->backendNodeIdForNode(node, BackendNodeIdGroup) : 0;
+ return node ? InspectorNodeIds::idForNode(node) : 0;
}
long long InspectorTimelineAgent::nodeId(RenderObject* renderer)
{
- return nodeId(renderer->generatingNode());
-}
-
-void InspectorTimelineAgent::releaseNodeIds()
-{
- ErrorString unused;
- if (m_domAgent)
- m_domAgent->releaseBackendNodeIds(&unused, BackendNodeIdGroup);
+ return InspectorNodeIds::idForNode(renderer->generatingNode());
}
double InspectorTimelineAgent::timestamp()
{
- return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyIncreasingTime());
+ return WTF::monotonicallyIncreasingTime() * msPerSecond;
}
-FrameHost* InspectorTimelineAgent::frameHost() const
+LocalFrame* InspectorTimelineAgent::mainFrame() const
{
- if (!m_pageAgent || !m_pageAgent->page())
+ if (!m_pageAgent)
return 0;
- return &m_pageAgent->page()->frameHost();
+ return m_pageAgent->mainFrame();
}
PassRefPtr<TimelineEvent> InspectorTimelineAgent::createRecordForEvent(const TraceEventDispatcher::TraceEvent& event, const String& type, PassRefPtr<JSONObject> data)
{
- double timeestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ double timeestamp = event.timestamp() * msPerSecond;
return TimelineRecordFactory::createBackgroundRecord(timeestamp, String::number(event.threadIdentifier()), type, data);
}