https://bugs.webkit.org/show_bug.cgi?id=131127
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
* inspector/ScriptDebugListener.h: Add a proper forward declaration for ScriptBreakpointAction.
Source/WebCore:
Hook up probe callbacks from ScriptDebugListener so that timeline records are
created for probe samples. The record includes the probe identifier and hit count.
The actual probe evaluation result is sent separately by DebuggerAgent, and
can be looked up in frontend models using the identifier and hit count.
* inspector/InspectorTimelineAgent.cpp: Only listen to the debug server when recording.
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::breakpointActionProbe):
(WebCore::toProtocol):
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createProbeSampleData):
* inspector/TimelineRecordFactory.h:
* inspector/protocol/Timeline.json: Add new enum value.
Source/WebInspectorUI:
* UserInterface/Controllers/TimelineManager.js: Stub out a case for the ProbeSample record type.
(WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
(WebInspector.TimelineManager.prototype.eventRecorded):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166827
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-04-03 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: hook up probe samples to TimelineAgent's records
+ https://bugs.webkit.org/show_bug.cgi?id=131127
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/ScriptDebugListener.h: Add a proper forward declaration for ScriptBreakpointAction.
+
2014-04-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r166820.
namespace Inspector {
+struct ScriptBreakpointAction;
+
class ScriptDebugListener {
public:
class Script {
+2014-04-03 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: hook up probe samples to TimelineAgent's records
+ https://bugs.webkit.org/show_bug.cgi?id=131127
+
+ Reviewed by Timothy Hatcher.
+
+ Hook up probe callbacks from ScriptDebugListener so that timeline records are
+ created for probe samples. The record includes the probe identifier and hit count.
+ The actual probe evaluation result is sent separately by DebuggerAgent, and
+ can be looked up in frontend models using the identifier and hit count.
+
+ * inspector/InspectorTimelineAgent.cpp: Only listen to the debug server when recording.
+ (WebCore::InspectorTimelineAgent::start):
+ (WebCore::InspectorTimelineAgent::stop):
+ (WebCore::InspectorTimelineAgent::breakpointActionProbe):
+ (WebCore::toProtocol):
+ * inspector/InspectorTimelineAgent.h:
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createProbeSampleData):
+ * inspector/TimelineRecordFactory.h:
+ * inspector/protocol/Timeline.json: Add new enum value.
+
2014-04-04 Andreas Kling <akling@apple.com>
Streamline cached wrapper lookup for Nodes in the normal world.
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
+* Copyright (C) 2014 University of Washington.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
#include "InstrumentingAgents.h"
#include "IntRect.h"
#include "JSDOMWindow.h"
+#include "PageScriptDebugServer.h"
#include "RenderElement.h"
#include "RenderView.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
#include "ScriptProfiler.h"
+#include "ScriptState.h"
#include "TimelineRecordFactory.h"
#include <inspector/IdentifiersFactory.h>
+#include <inspector/ScriptBreakpoint.h>
#include <wtf/CurrentTime.h>
using namespace Inspector;
m_timeConverter.reset();
m_instrumentingAgents->setInspectorTimelineAgent(this);
+ PageScriptDebugServer::shared().addListener(this, page());
m_enabled = true;
}
m_weakFactory.revokeAll();
m_instrumentingAgents->setInspectorTimelineAgent(nullptr);
+ PageScriptDebugServer::shared().removeListener(this, page(), true);
clearRecordStack();
}
#endif // ENABLE(WEB_SOCKETS)
+// ScriptDebugListener
+
+void InspectorTimelineAgent::breakpointActionProbe(JSC::ExecState* exec, const Inspector::ScriptBreakpointAction& action, int hitCount, const Deprecated::ScriptValue&)
+{
+ ASSERT(exec);
+
+ ScriptExecutionContext* context = scriptExecutionContextFromExecState(exec);
+ Document* document = (context && context->isDocument()) ? toDocument(context) : nullptr;
+ Frame* frame = document ? document->frame() : nullptr;
+ appendRecord(TimelineRecordFactory::createProbeSampleData(action, hitCount), TimelineRecordType::ProbeSample, false, frame);
+}
+
void InspectorTimelineAgent::addRecordToTimeline(PassRefPtr<InspectorObject> record, TimelineRecordType type)
{
commitFrameRecord();
case TimelineRecordType::FunctionCall:
return Inspector::TypeBuilder::Timeline::EventType::FunctionCall;
+ case TimelineRecordType::ProbeSample:
+ return Inspector::TypeBuilder::Timeline::EventType::ProbeSample;
case TimelineRecordType::RequestAnimationFrame:
return Inspector::TypeBuilder::Timeline::EventType::RequestAnimationFrame;
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
+* Copyright (C) 2014 University of Washington.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
#include "InspectorWebFrontendDispatchers.h"
#include "LayoutRect.h"
#include <inspector/InspectorValues.h>
+#include <inspector/ScriptDebugListener.h>
#include <wtf/Vector.h>
#include <wtf/WeakPtr.h>
XHRLoad,
FunctionCall,
+ ProbeSample,
RequestAnimationFrame,
CancelAnimationFrame,
class InspectorTimelineAgent
: public InspectorAgentBase
- , public Inspector::InspectorTimelineBackendDispatcherHandler {
+ , public Inspector::InspectorTimelineBackendDispatcherHandler
+ , public Inspector::ScriptDebugListener {
WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
public:
enum InspectorType { PageInspector, WorkerInspector };
void didDestroyWebSocket(unsigned long identifier, Frame*);
#endif
+protected:
+ // ScriptDebugListener. This is only used to create records for probe samples.
+ virtual void didParseSource(JSC::SourceID, const Script&) override { }
+ virtual void failedToParseSource(const String&, const String&, int, int, const String&) override { }
+ virtual void didPause(JSC::ExecState*, const Deprecated::ScriptValue&, const Deprecated::ScriptValue&) override { }
+ virtual void didContinue() override { }
+
+ virtual void breakpointActionLog(JSC::ExecState*, const String&) override { }
+ virtual void breakpointActionSound(int) override { }
+ virtual void breakpointActionProbe(JSC::ExecState*, const Inspector::ScriptBreakpointAction&, int hitCount, const Deprecated::ScriptValue& result) override;
+
private:
friend class TimelineRecordStack;
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
#include "ResourceResponse.h"
#include "ScriptProfile.h"
#include <inspector/InspectorValues.h>
+#include <inspector/ScriptBreakpoint.h>
#include <inspector/ScriptCallStack.h>
#include <inspector/ScriptCallStackFactory.h>
#include <wtf/CurrentTime.h>
return data.release();
}
+PassRefPtr<InspectorObject> TimelineRecordFactory::createProbeSampleData(const ScriptBreakpointAction& action, int hitCount)
+{
+ RefPtr<InspectorObject> data = InspectorObject::create();
+ data->setNumber(ASCIILiteral("probeId"), action.identifier);
+ data->setNumber(ASCIILiteral("hitCount"), hitCount);
+ return data.release();
+}
+
PassRefPtr<InspectorObject> TimelineRecordFactory::createEventDispatchData(const Event& event)
{
RefPtr<InspectorObject> data = InspectorObject::create();
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
#include <wtf/Forward.h>
#include <wtf/text/WTFString.h>
+namespace Inspector {
+struct ScriptBreakpointAction;
+}
+
namespace WebCore {
class Event;
static PassRefPtr<Inspector::InspectorObject> createFunctionCallData(const String& scriptName, int scriptLine);
+ static PassRefPtr<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, int hitCount);
+
static PassRefPtr<Inspector::InspectorObject> createEventDispatchData(const Event&);
static PassRefPtr<Inspector::InspectorObject> createGenericTimerData(int timerId);
{
"id": "EventType",
"type": "string",
- "enum": ["EventDispatch", "BeginFrame", "ScheduleStyleRecalculation", "RecalculateStyles", "InvalidateLayout", "Layout", "Paint", "ScrollLayer", "ResizeImage", "CompositeLayers", "ParseHTML", "TimerInstall", "TimerRemove", "TimerFire", "EvaluateScript", "MarkLoad", "MarkDOMContent", "TimeStamp", "Time", "TimeEnd", "ScheduleResourceRequest", "ResourceSendRequest", "ResourceReceiveResponse", "ResourceReceivedData", "ResourceFinish", "XHRReadyStateChange", "XHRLoad", "FunctionCall", "GCEvent", "RequestAnimationFrame", "CancelAnimationFrame", "FireAnimationFrame", "WebSocketCreate", "WebSocketSendHandshakeRequest", "WebSocketReceiveHandshakeResponse", "WebSocketDestroy"],
+ "enum": ["EventDispatch", "BeginFrame", "ScheduleStyleRecalculation", "RecalculateStyles", "InvalidateLayout", "Layout", "Paint", "ScrollLayer", "ResizeImage", "CompositeLayers", "ParseHTML", "TimerInstall", "TimerRemove", "TimerFire", "EvaluateScript", "MarkLoad", "MarkDOMContent", "TimeStamp", "Time", "TimeEnd", "ScheduleResourceRequest", "ResourceSendRequest", "ResourceReceiveResponse", "ResourceReceivedData", "ResourceFinish", "XHRReadyStateChange", "XHRLoad", "FunctionCall", "ProbeSample", "GCEvent", "RequestAnimationFrame", "CancelAnimationFrame", "FireAnimationFrame", "WebSocketCreate", "WebSocketSendHandshakeRequest", "WebSocketReceiveHandshakeResponse", "WebSocketDestroy"],
"description": "Timeline record type."
},
{
+2014-04-03 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: hook up probe samples to TimelineAgent's records
+ https://bugs.webkit.org/show_bug.cgi?id=131127
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Controllers/TimelineManager.js: Stub out a case for the ProbeSample record type.
+ (WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
+ (WebInspector.TimelineManager.prototype.eventRecorded):
+
2014-04-04 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: JSContext inspection Resource search throws exception
break;
+ case TimelineAgent.EventType.ProbeSample:
+ // FIXME: Create timeline records for probe samples <https://webkit.org/b/131173>
+ break;
+
case TimelineAgent.EventType.TimerInstall:
console.assert(isNaN(endTime));