WebKit Bugzilla
Attachment 358715 Details for
Bug 116191
: Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
116191.diff (text/plain), 20.76 KB, created by
Devin Rousso
on 2019-01-09 10:25:12 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-09 10:25:12 PST
Size:
20.76 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 663f5f75f40..9b40b36580a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2019-01-09 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number >+ https://bugs.webkit.org/show_bug.cgi?id=116191 >+ <rdar://problem/13905910> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * 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-09 Devin Rousso <drousso@apple.com> > > Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open >diff --git a/Source/WebCore/bindings/js/JSExecStateInstrumentation.h b/Source/WebCore/bindings/js/JSExecStateInstrumentation.h >index 7a653e5478f..553dc3dac95 100644 >--- a/Source/WebCore/bindings/js/JSExecStateInstrumentation.h >+++ b/Source/WebCore/bindings/js/JSExecStateInstrumentation.h >@@ -39,12 +39,14 @@ inline InspectorInstrumentationCookie JSExecState::instrumentFunctionInternal(Sc > 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) >diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp >index 785c66ec47a..784ae540635 100644 >--- a/Source/WebCore/bindings/js/ScriptController.cpp >+++ b/Source/WebCore/bindings/js/ScriptController.cpp >@@ -125,7 +125,7 @@ JSValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DO > > 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 @@ JSC::JSValue ScriptController::evaluateModule(const URL& sourceURL, JSModuleReco > > 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); >diff --git a/Source/WebCore/bindings/js/ScriptSourceCode.h b/Source/WebCore/bindings/js/ScriptSourceCode.h >index 286a344f22e..fca574cfdaa 100644 >--- a/Source/WebCore/bindings/js/ScriptSourceCode.h >+++ b/Source/WebCore/bindings/js/ScriptSourceCode.h >@@ -70,6 +70,7 @@ public: > 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(); } > >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp >index cc8f1f033b0..b50303c76e6 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp >+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp >@@ -368,11 +368,11 @@ void InspectorInstrumentation::didDispatchPostMessageImpl(InstrumentingAgents& i > 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 @@ void InspectorInstrumentation::eventDidResetAfterDispatchImpl(InstrumentingAgent > 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); >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h >index fdaea62164a..d559c861a55 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.h >+++ b/Source/WebCore/inspector/InspectorInstrumentation.h >@@ -146,7 +146,7 @@ public: > 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 @@ public: > 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 @@ private: > 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 @@ private: > 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 @@ inline void InspectorInstrumentation::didDispatchPostMessage(Frame& frame, Timer > 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 @@ inline void InspectorInstrumentation::eventDidResetAfterDispatch(const Event& ev > 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(); > } > >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.cpp b/Source/WebCore/inspector/TimelineRecordFactory.cpp >index 0cab454fc10..cb34cbe1277 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.cpp >+++ b/Source/WebCore/inspector/TimelineRecordFactory.cpp >@@ -57,11 +57,12 @@ Ref<JSON::Object> TimelineRecordFactory::createGenericRecord(double startTime, i > 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 = JSON::Object::create(); > data->setString("scriptName"_s, scriptName); > data->setInteger("scriptLine"_s, scriptLine); >+ data->setInteger("scriptColumn"_s, scriptColumn); > return data; > } > >@@ -103,11 +104,12 @@ Ref<JSON::Object> TimelineRecordFactory::createTimerInstallData(int timerId, Sec > return data; > } > >-Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber) >+Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber, double columnNumber) > { > Ref<JSON::Object> data = JSON::Object::create(); > data->setString("url"_s, url); > data->setInteger("lineNumber"_s, lineNumber); >+ data->setInteger("columnNumber"_s, columnNumber); > return data; > } > >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.h b/Source/WebCore/inspector/TimelineRecordFactory.h >index d5c13ff764d..a5216e1d6c9 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.h >+++ b/Source/WebCore/inspector/TimelineRecordFactory.h >@@ -49,13 +49,13 @@ class TimelineRecordFactory { > 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&, double lineNumber, double columnNumber); > static Ref<JSON::Object> createTimeStampData(const String&); > static Ref<JSON::Object> createAnimationFrameData(int callbackId); > static Ref<JSON::Object> createObserverCallbackData(const String& callbackType); >diff --git a/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >index be026616361..2e270d46a82 100644 >--- a/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >@@ -293,9 +293,9 @@ void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String& titl > } > } > >-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 @@ void InspectorTimelineAgent::didFireTimer() > 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&) >diff --git a/Source/WebCore/inspector/agents/InspectorTimelineAgent.h b/Source/WebCore/inspector/agents/InspectorTimelineAgent.h >index cf2635ee258..4033cdfe171 100644 >--- a/Source/WebCore/inspector/agents/InspectorTimelineAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorTimelineAgent.h >@@ -118,11 +118,11 @@ public: > 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&); >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 6ca6684ff15..11da23012b2 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-09 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number >+ https://bugs.webkit.org/show_bug.cgi?id=116191 >+ <rdar://problem/13905910> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Controllers/TimelineManager.js: >+ (WI.TimelineManager.prototype._processRecord): >+ > 2019-01-09 Devin Rousso <drousso@apple.com> > > Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >index a254f0059f2..df8d04f8c0a 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >@@ -532,10 +532,9 @@ WI.TimelineManager = class TimelineManager extends WI.Object > 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 @@ WI.TimelineManager = class TimelineManager extends WI.Object > 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); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 116191
:
358715
|
359835