Diff
Modified: trunk/LayoutTests/ChangeLog (240322 => 240323)
--- trunk/LayoutTests/ChangeLog 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/LayoutTests/ChangeLog 2019-01-23 04:51:45 UTC (rev 240323)
@@ -1,5 +1,16 @@
2019-01-22 Devin Rousso <[email protected]>
+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
+ https://bugs.webkit.org/show_bug.cgi?id=116191
+ <rdar://problem/13905910>
+
+ Reviewed by Joseph Pecoraro.
+
+ * inspector/timeline/line-column.html: Added.
+ * inspector/timeline/line-column-expected.txt: Added.
+
+2019-01-22 Devin Rousso <[email protected]>
+
Web Inspector: expose Audit and Recording versions to the frontend
https://bugs.webkit.org/show_bug.cgi?id=193262
<rdar://problem/47130684>
Added: trunk/LayoutTests/inspector/timeline/line-column-expected.txt (0 => 240323)
--- trunk/LayoutTests/inspector/timeline/line-column-expected.txt (rev 0)
+++ trunk/LayoutTests/inspector/timeline/line-column-expected.txt 2019-01-23 04:51:45 UTC (rev 240323)
@@ -0,0 +1,238 @@
+Test that script Timeline records have column numbers.
+
+
+
+== Running test suite: Timeline.LineColumn
+-- Running test case: Timeline.LineColumn.willCallFunction
+Evaluating in page...
+PASS: Capturing started.
+{
+ "startTime": "<filtered>",
+ "data": {},
+ "children": [
+ {
+ "startTime": "<filtered>",
+ "stackTrace": [
+ {
+ "functionName": "click",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "willCallFunctionTest",
+ "url": "timeline/line-column.html",
+ "scriptId": "<filtered>",
+ "lineNumber": 26,
+ "columnNumber": 44
+ },
+ {
+ "functionName": "global code",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 1,
+ "columnNumber": 21
+ },
+ {
+ "functionName": "evaluateWithScopeExtension",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 134,
+ "columnNumber": 97
+ }
+ ],
+ "data": {},
+ "frameId": "<filtered>",
+ "type": "ScheduleStyleRecalculation"
+ },
+ {
+ "startTime": "<filtered>",
+ "frameId": "<filtered>",
+ "data": {
+ "type": "click"
+ },
+ "children": [],
+ "endTime": "<filtered>",
+ "type": "EventDispatch"
+ },
+ {
+ "startTime": "<filtered>",
+ "frameId": "<filtered>",
+ "data": {
+ "type": "click"
+ },
+ "children": [
+ {
+ "startTime": "<filtered>",
+ "stackTrace": [
+ {
+ "functionName": "click",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "willCallFunctionTest",
+ "url": "timeline/line-column.html",
+ "scriptId": "<filtered>",
+ "lineNumber": 26,
+ "columnNumber": 44
+ },
+ {
+ "functionName": "global code",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 1,
+ "columnNumber": 21
+ },
+ {
+ "functionName": "evaluateWithScopeExtension",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 134,
+ "columnNumber": 97
+ }
+ ],
+ "frameId": "<filtered>",
+ "data": {
+ "scriptName": "timeline/line-column.html",
+ "scriptLine": 17,
+ "scriptColumn": 65
+ },
+ "children": [],
+ "endTime": "<filtered>",
+ "type": "FunctionCall"
+ }
+ ],
+ "endTime": "<filtered>",
+ "type": "EventDispatch"
+ },
+ {
+ "startTime": "<filtered>",
+ "stackTrace": [
+ {
+ "functionName": "profile",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "willCallFunctionTest",
+ "url": "timeline/line-column.html",
+ "scriptId": "<filtered>",
+ "lineNumber": 25,
+ "columnNumber": 20
+ },
+ {
+ "functionName": "global code",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 1,
+ "columnNumber": 21
+ },
+ {
+ "functionName": "evaluateWithScopeExtension",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 134,
+ "columnNumber": 97
+ }
+ ],
+ "frameId": "<filtered>",
+ "data": {
+ "title": ""
+ },
+ "children": [],
+ "endTime": "<filtered>",
+ "type": "ConsoleProfile"
+ }
+ ],
+ "endTime": "<filtered>",
+ "type": "RenderingFrame"
+}
+PASS: Capturing stopped.
+
+-- Running test case: Timeline.LineColumn.willEvaluateScript
+Evaluating in page...
+PASS: Capturing started.
+{
+ "startTime": "<filtered>",
+ "data": {},
+ "children": [
+ {
+ "startTime": "<filtered>",
+ "stackTrace": [
+ {
+ "functionName": "profile",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "willEvaluateScriptTest",
+ "url": "timeline/line-column.html",
+ "scriptId": "<filtered>",
+ "lineNumber": 31,
+ "columnNumber": 20
+ },
+ {
+ "functionName": "global code",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 1,
+ "columnNumber": 23
+ },
+ {
+ "functionName": "evaluateWithScopeExtension",
+ "url": "[native code]",
+ "scriptId": "<filtered>",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ {
+ "functionName": "",
+ "url": "",
+ "scriptId": "<filtered>",
+ "lineNumber": 134,
+ "columnNumber": 97
+ }
+ ],
+ "frameId": "<filtered>",
+ "data": {
+ "title": ""
+ },
+ "children": [],
+ "endTime": "<filtered>",
+ "type": "ConsoleProfile"
+ }
+ ],
+ "endTime": "<filtered>",
+ "type": "RenderingFrame"
+}
+PASS: Capturing stopped.
+
Added: trunk/LayoutTests/inspector/timeline/line-column.html (0 => 240323)
--- trunk/LayoutTests/inspector/timeline/line-column.html (rev 0)
+++ trunk/LayoutTests/inspector/timeline/line-column.html 2019-01-23 04:51:45 UTC (rev 240323)
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+
+function bar(x)
+{
+ return x * 10;
+}
+
+function foo() {
+ bar(42);
+}
+
+function load() {
+ document.querySelector("#button").addEventListener("click", (event) => {
+ foo();
+ });
+
+ runTest();
+}
+
+function willCallFunctionTest() {
+ console.profile();
+ document.querySelector("#button").click();
+ console.profileEnd();
+}
+
+function willEvaluateScriptTest() {
+ console.profile();
+ foo();
+ console.profileEnd();
+}
+
+function test() {
+ ProtocolTest.debug();
+
+ let suite = ProtocolTest.createAsyncSuite("Timeline.LineColumn");
+
+ function replacer(key, value) {
+ if (key === "startTime" || key === "endTime" || key === "scriptId" || key === "frameId")
+ return "<filtered>";
+ if (key === "url" || key === "scriptName")
+ return value.replace(/^.+LayoutTests\/inspector\//, "");
+ return value;
+ }
+
+ const tests = [
+ {
+ name: "Timeline.LineColumn.willCallFunction",
+ description: "Test that column numbers are passed through the willCallFunction instrumentation point.",
+ _expression_: `willCallFunctionTest()`,
+ },
+ {
+ name: "Timeline.LineColumn.willEvaluateScript",
+ description: "Test that column numbers are passed through the willEvaluateScript instrumentation point.",
+ _expression_: `willEvaluateScriptTest()`,
+ },
+ ];
+
+ for (let {name, description, _expression_} of tests) {
+ suite.addTestCase({
+ name,
+ description,
+ test(resolve, reject) {
+ let eventNames = [];
+
+ function handleEvent(eventName, handler) {
+ eventNames.push(eventName);
+ InspectorProtocol.eventHandler[eventName] = handler;
+ }
+
+ handleEvent("Timeline.eventRecorded", (event) => {
+ ProtocolTest.log(JSON.stringify(event.params.record, replacer, 2));
+ });
+
+ handleEvent("Timeline.programmaticCaptureStarted", () => {
+ ProtocolTest.pass("Capturing started.");
+ });
+
+ handleEvent("Timeline.programmaticCaptureStopped", () => {
+ ProtocolTest.pass("Capturing stopped.");
+
+ for (let eventName of eventNames)
+ delete InspectorProtocol.eventHandler[eventName];
+
+ resolve();
+ });
+
+ ProtocolTest.log("Evaluating in page...");
+ ProtocolTest.evaluateInPage(_expression_)
+ .catch(reject);
+ },
+ });
+ }
+
+ suite.runTestCasesAndFinish();
+}
+
+</script>
+</head>
+<body _onload_="load()">
+ <p>Test that script Timeline records have column numbers.</p>
+ <button id="button"></button>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (240322 => 240323)
--- trunk/Source/WebCore/ChangeLog 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/ChangeLog 2019-01-23 04:51:45 UTC (rev 240323)
@@ -1,5 +1,42 @@
2019-01-22 Devin Rousso <[email protected]>
+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
+ https://bugs.webkit.org/show_bug.cgi?id=116191
+ <rdar://problem/13905910>
+
+ Reviewed by Joseph Pecoraro.
+
+ Test inspector/timeline/line-column.html
+
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::evaluateInWorld):
+ (WebCore::ScriptController::evaluateModule):
+
+ * bindings/js/JSExecStateInstrumentation.h:
+ (WebCore::JSExecState::instrumentFunctionInternal):
+
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::willCallFunction):
+ (WebCore::InspectorInstrumentation::willEvaluateScript):
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::willCallFunctionImpl):
+ (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
+
+ * inspector/agents/InspectorTimelineAgent.h:
+ * inspector/agents/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::willCallFunction):
+ (WebCore::InspectorTimelineAgent::willEvaluateScript):
+
+ * inspector/TimelineRecordFactory.h:
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createFunctionCallData):
+ (WebCore::TimelineRecordFactory::createEvaluateScriptData):
+
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::startColumn const): Added.
+
+2019-01-22 Devin Rousso <[email protected]>
+
Web Inspector: expose Audit and Recording versions to the frontend
https://bugs.webkit.org/show_bug.cgi?id=193262
<rdar://problem/47130684>
Modified: trunk/Source/WebCore/bindings/js/JSExecStateInstrumentation.h (240322 => 240323)
--- trunk/Source/WebCore/bindings/js/JSExecStateInstrumentation.h 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/bindings/js/JSExecStateInstrumentation.h 2019-01-23 04:51:45 UTC (rev 240323)
@@ -39,12 +39,14 @@
return InspectorInstrumentationCookie();
String resourceName;
int lineNumber = 1;
+ int columnNumber = 1;
if (callType == jsType) {
resourceName = callData.js.functionExecutable->sourceURL();
lineNumber = callData.js.functionExecutable->firstLine();
+ columnNumber = callData.js.functionExecutable->startColumn();
} else
resourceName = "undefined";
- return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber);
+ return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber, columnNumber);
}
inline InspectorInstrumentationCookie JSExecState::instrumentFunctionCall(ScriptExecutionContext* context, JSC::CallType type, const JSC::CallData& data)
Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (240322 => 240323)
--- trunk/Source/WebCore/bindings/js/ScriptController.cpp 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp 2019-01-23 04:51:45 UTC (rev 240323)
@@ -125,7 +125,7 @@
Ref<Frame> protector(m_frame);
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine());
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine(), sourceCode.startColumn());
NakedPtr<JSC::Exception> evaluationException;
JSValue returnValue = JSExecState::profiledEvaluate(&exec, JSC::ProfilingReason::Other, jsSourceCode, &proxy, evaluationException);
@@ -218,7 +218,7 @@
Ref<Frame> protector(m_frame);
- auto cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt());
+ auto cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt(), jsSourceCode.startColumn().oneBasedInt());
auto returnValue = moduleRecord.evaluate(&state);
InspectorInstrumentation::didEvaluateScript(cookie, m_frame);
Modified: trunk/Source/WebCore/bindings/js/ScriptSourceCode.h (240322 => 240323)
--- trunk/Source/WebCore/bindings/js/ScriptSourceCode.h 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/bindings/js/ScriptSourceCode.h 2019-01-23 04:51:45 UTC (rev 240323)
@@ -70,6 +70,7 @@
StringView source() const { return m_provider->source(); }
int startLine() const { return m_code.firstLine().oneBasedInt(); }
+ int startColumn() const { return m_code.startColumn().oneBasedInt(); }
CachedScript* cachedScript() const { return m_cachedScript.get(); }
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (240322 => 240323)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2019-01-23 04:51:45 UTC (rev 240323)
@@ -368,11 +368,11 @@
pageDebuggerAgent->didDispatchPostMessage(timer);
}
-InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, ScriptExecutionContext* context)
+InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, int scriptColumn, ScriptExecutionContext* context)
{
int timelineAgentId = 0;
if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) {
- timelineAgent->willCallFunction(scriptName, scriptLine, frameForScriptExecutionContext(context));
+ timelineAgent->willCallFunction(scriptName, scriptLine, scriptColumn, frameForScriptExecutionContext(context));
timelineAgentId = timelineAgent->id();
}
return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
@@ -441,11 +441,11 @@
domAgent->eventDidResetAfterDispatch(event);
}
-InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber)
+InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber, int columnNumber)
{
int timelineAgentId = 0;
if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) {
- timelineAgent->willEvaluateScript(url, lineNumber, frame);
+ timelineAgent->willEvaluateScript(url, lineNumber, columnNumber, frame);
timelineAgentId = timelineAgent->id();
}
return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (240322 => 240323)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2019-01-23 04:51:45 UTC (rev 240323)
@@ -146,7 +146,7 @@
static void willDispatchPostMessage(Frame&, TimerBase&);
static void didDispatchPostMessage(Frame&, TimerBase&);
- static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
+ static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine, int scriptColumn);
static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
static void didAddEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
static void willRemoveEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
@@ -158,7 +158,7 @@
static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event&, DOMWindow&);
static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
static void eventDidResetAfterDispatch(const Event&);
- static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber);
+ static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber, int columnNumber);
static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&);
static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext&, int timerId, bool oneShot);
static void didFireTimer(const InspectorInstrumentationCookie&);
@@ -338,7 +338,7 @@
static void willDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&);
static void didDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&);
- static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
+ static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, int scriptColumn, ScriptExecutionContext*);
static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
static void didAddEventListenerImpl(InstrumentingAgents&, EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
static void willRemoveEventListenerImpl(InstrumentingAgents&, EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
@@ -350,7 +350,7 @@
static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents&, const Event&, DOMWindow&);
static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
static void eventDidResetAfterDispatchImpl(InstrumentingAgents&, const Event&);
- static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber);
+ static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber, int columnNumber);
static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&);
static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, bool oneShot, ScriptExecutionContext&);
static void didFireTimerImpl(const InspectorInstrumentationCookie&);
@@ -768,11 +768,11 @@
didDispatchPostMessageImpl(*instrumentingAgents, timer);
}
-inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine, int scriptColumn)
{
FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
- return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, context);
+ return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, scriptColumn, context);
return InspectorInstrumentationCookie();
}
@@ -839,11 +839,11 @@
return eventDidResetAfterDispatchImpl(*instrumentingAgents, event);
}
-inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber, int columnNumber)
{
FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
- return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber);
+ return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber, columnNumber);
return InspectorInstrumentationCookie();
}
Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (240322 => 240323)
--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp 2019-01-23 04:51:45 UTC (rev 240323)
@@ -57,11 +57,12 @@
return record;
}
-Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine)
+Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine, int scriptColumn)
{
Ref<JSON::Object> data = ""
data->setString("scriptName"_s, scriptName);
data->setInteger("scriptLine"_s, scriptLine);
+ data->setInteger("scriptColumn"_s, scriptColumn);
return data;
}
@@ -103,11 +104,12 @@
return data;
}
-Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber)
+Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, int lineNumber, int columnNumber)
{
Ref<JSON::Object> data = ""
data->setString("url"_s, url);
data->setInteger("lineNumber"_s, lineNumber);
+ data->setInteger("columnNumber"_s, columnNumber);
return data;
}
Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.h (240322 => 240323)
--- trunk/Source/WebCore/inspector/TimelineRecordFactory.h 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.h 2019-01-23 04:51:45 UTC (rev 240323)
@@ -49,13 +49,13 @@
public:
static Ref<JSON::Object> createGenericRecord(double startTime, int maxCallStackDepth);
- static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine);
+ static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine, int scriptColumn);
static Ref<JSON::Object> createConsoleProfileData(const String& title);
static Ref<JSON::Object> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId);
static Ref<JSON::Object> createEventDispatchData(const Event&);
static Ref<JSON::Object> createGenericTimerData(int timerId);
static Ref<JSON::Object> createTimerInstallData(int timerId, Seconds timeout, bool singleShot);
- static Ref<JSON::Object> createEvaluateScriptData(const String&, double lineNumber);
+ static Ref<JSON::Object> createEvaluateScriptData(const String&, int lineNumber, int columnNumber);
static Ref<JSON::Object> createTimeStampData(const String&);
static Ref<JSON::Object> createAnimationFrameData(int callbackId);
static Ref<JSON::Object> createObserverCallbackData(const String& callbackType);
Modified: trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp (240322 => 240323)
--- trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp 2019-01-23 04:51:45 UTC (rev 240323)
@@ -293,9 +293,9 @@
}
}
-void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, Frame* frame)
+void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, int scriptColumn, Frame* frame)
{
- pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame);
+ pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine, scriptColumn), TimelineRecordType::FunctionCall, true, frame);
}
void InspectorTimelineAgent::didCallFunction(Frame*)
@@ -402,9 +402,9 @@
didCompleteCurrentRecord(TimelineRecordType::TimerFire);
}
-void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, Frame& frame)
+void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, int columnNumber, Frame& frame)
{
- pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript, true, &frame);
+ pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber, columnNumber), TimelineRecordType::EvaluateScript, true, &frame);
}
void InspectorTimelineAgent::didEvaluateScript(Frame&)
Modified: trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h (240322 => 240323)
--- trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h 2019-01-23 04:51:45 UTC (rev 240323)
@@ -118,11 +118,11 @@
void didRemoveTimer(int timerId, Frame*);
void willFireTimer(int timerId, Frame*);
void didFireTimer();
- void willCallFunction(const String& scriptName, int scriptLine, Frame*);
+ void willCallFunction(const String& scriptName, int scriptLine, int scriptColumn, Frame*);
void didCallFunction(Frame*);
void willDispatchEvent(const Event&, Frame*);
void didDispatchEvent();
- void willEvaluateScript(const String&, int, Frame&);
+ void willEvaluateScript(const String&, int lineNumber, int columnNumber, Frame&);
void didEvaluateScript(Frame&);
void didInvalidateLayout(Frame&);
void willLayout(Frame&);
Modified: trunk/Source/WebInspectorUI/ChangeLog (240322 => 240323)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-01-23 04:51:45 UTC (rev 240323)
@@ -1,5 +1,16 @@
2019-01-22 Devin Rousso <[email protected]>
+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
+ https://bugs.webkit.org/show_bug.cgi?id=116191
+ <rdar://problem/13905910>
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Controllers/TimelineManager.js:
+ (WI.TimelineManager.prototype._processRecord):
+
+2019-01-22 Devin Rousso <[email protected]>
+
Web Inspector: expose Audit and Recording versions to the frontend
https://bugs.webkit.org/show_bug.cgi?id=193262
<rdar://problem/47130684>
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (240322 => 240323)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2019-01-23 04:49:56 UTC (rev 240322)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2019-01-23 04:51:45 UTC (rev 240323)
@@ -532,10 +532,9 @@
var scriptResource = mainFrame.url ="" recordPayload.data.url ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.url, true);
if (scriptResource) {
// The lineNumber is 1-based, but we expect 0-based.
- var lineNumber = recordPayload.data.lineNumber - 1;
-
- // FIXME: No column number is provided.
- sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0);
+ let lineNumber = recordPayload.data.lineNumber - 1;
+ let columnNumber = "columnNumber" in recordPayload.data ? recordPayload.data.columnNumber - 1 : 0;
+ sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, columnNumber);
}
}
@@ -586,10 +585,9 @@
var scriptResource = mainFrame.url ="" recordPayload.data.scriptName ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.scriptName, true);
if (scriptResource) {
// The lineNumber is 1-based, but we expect 0-based.
- var lineNumber = recordPayload.data.scriptLine - 1;
-
- // FIXME: No column number is provided.
- sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0);
+ let lineNumber = recordPayload.data.scriptLine - 1;
+ let columnNumber = "scriptColumn" in recordPayload.data ? recordPayload.data.scriptColumn - 1 : 0;
+ sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, columnNumber);
}
}