Changeset 240323 in webkit
- Timestamp:
- Jan 22, 2019 8:51:45 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r240318 r240323 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number 4 https://bugs.webkit.org/show_bug.cgi?id=116191 5 <rdar://problem/13905910> 6 7 Reviewed by Joseph Pecoraro. 8 9 * inspector/timeline/line-column.html: Added. 10 * inspector/timeline/line-column-expected.txt: Added. 11 1 12 2019-01-22 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r240318 r240323 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number 4 https://bugs.webkit.org/show_bug.cgi?id=116191 5 <rdar://problem/13905910> 6 7 Reviewed by Joseph Pecoraro. 8 9 Test inspector/timeline/line-column.html 10 11 * bindings/js/ScriptController.cpp: 12 (WebCore::ScriptController::evaluateInWorld): 13 (WebCore::ScriptController::evaluateModule): 14 15 * bindings/js/JSExecStateInstrumentation.h: 16 (WebCore::JSExecState::instrumentFunctionInternal): 17 18 * inspector/InspectorInstrumentation.h: 19 (WebCore::InspectorInstrumentation::willCallFunction): 20 (WebCore::InspectorInstrumentation::willEvaluateScript): 21 * inspector/InspectorInstrumentation.cpp: 22 (WebCore::InspectorInstrumentation::willCallFunctionImpl): 23 (WebCore::InspectorInstrumentation::willEvaluateScriptImpl): 24 25 * inspector/agents/InspectorTimelineAgent.h: 26 * inspector/agents/InspectorTimelineAgent.cpp: 27 (WebCore::InspectorTimelineAgent::willCallFunction): 28 (WebCore::InspectorTimelineAgent::willEvaluateScript): 29 30 * inspector/TimelineRecordFactory.h: 31 * inspector/TimelineRecordFactory.cpp: 32 (WebCore::TimelineRecordFactory::createFunctionCallData): 33 (WebCore::TimelineRecordFactory::createEvaluateScriptData): 34 35 * bindings/js/ScriptSourceCode.h: 36 (WebCore::ScriptSourceCode::startColumn const): Added. 37 1 38 2019-01-22 Devin Rousso <drousso@apple.com> 2 39 -
trunk/Source/WebCore/bindings/js/JSExecStateInstrumentation.h
r234586 r240323 40 40 String resourceName; 41 41 int lineNumber = 1; 42 int columnNumber = 1; 42 43 if (callType == jsType) { 43 44 resourceName = callData.js.functionExecutable->sourceURL(); 44 45 lineNumber = callData.js.functionExecutable->firstLine(); 46 columnNumber = callData.js.functionExecutable->startColumn(); 45 47 } else 46 48 resourceName = "undefined"; 47 return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber );49 return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber, columnNumber); 48 50 } 49 51 -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r239569 r240323 126 126 Ref<Frame> protector(m_frame); 127 127 128 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine() );128 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine(), sourceCode.startColumn()); 129 129 130 130 NakedPtr<JSC::Exception> evaluationException; … … 219 219 Ref<Frame> protector(m_frame); 220 220 221 auto cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt() );221 auto cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt(), jsSourceCode.startColumn().oneBasedInt()); 222 222 223 223 auto returnValue = moduleRecord.evaluate(&state); -
trunk/Source/WebCore/bindings/js/ScriptSourceCode.h
r239569 r240323 71 71 72 72 int startLine() const { return m_code.firstLine().oneBasedInt(); } 73 int startColumn() const { return m_code.startColumn().oneBasedInt(); } 73 74 74 75 CachedScript* cachedScript() const { return m_cachedScript.get(); } -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r239703 r240323 369 369 } 370 370 371 InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, ScriptExecutionContext* context)371 InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, int scriptColumn, ScriptExecutionContext* context) 372 372 { 373 373 int timelineAgentId = 0; 374 374 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) { 375 timelineAgent->willCallFunction(scriptName, scriptLine, frameForScriptExecutionContext(context));375 timelineAgent->willCallFunction(scriptName, scriptLine, scriptColumn, frameForScriptExecutionContext(context)); 376 376 timelineAgentId = timelineAgent->id(); 377 377 } … … 442 442 } 443 443 444 InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber )444 InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber, int columnNumber) 445 445 { 446 446 int timelineAgentId = 0; 447 447 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) { 448 timelineAgent->willEvaluateScript(url, lineNumber, frame);448 timelineAgent->willEvaluateScript(url, lineNumber, columnNumber, frame); 449 449 timelineAgentId = timelineAgent->id(); 450 450 } -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r239703 r240323 147 147 static void didDispatchPostMessage(Frame&, TimerBase&); 148 148 149 static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine );149 static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine, int scriptColumn); 150 150 static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*); 151 151 static void didAddEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture); … … 159 159 static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&); 160 160 static void eventDidResetAfterDispatch(const Event&); 161 static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber );161 static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber, int columnNumber); 162 162 static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&); 163 163 static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext&, int timerId, bool oneShot); … … 339 339 static void didDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&); 340 340 341 static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);341 static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, int scriptColumn, ScriptExecutionContext*); 342 342 static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*); 343 343 static void didAddEventListenerImpl(InstrumentingAgents&, EventTarget&, const AtomicString& eventType, EventListener&, bool capture); … … 351 351 static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&); 352 352 static void eventDidResetAfterDispatchImpl(InstrumentingAgents&, const Event&); 353 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber );353 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber, int columnNumber); 354 354 static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&); 355 355 static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, bool oneShot, ScriptExecutionContext&); … … 769 769 } 770 770 771 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine )771 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine, int scriptColumn) 772 772 { 773 773 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie()); 774 774 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 775 return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, context);775 return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, scriptColumn, context); 776 776 return InspectorInstrumentationCookie(); 777 777 } … … 840 840 } 841 841 842 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber )842 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber, int columnNumber) 843 843 { 844 844 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie()); 845 845 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame)) 846 return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber );846 return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber, columnNumber); 847 847 return InspectorInstrumentationCookie(); 848 848 } -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r239397 r240323 58 58 } 59 59 60 Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine )60 Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine, int scriptColumn) 61 61 { 62 62 Ref<JSON::Object> data = JSON::Object::create(); 63 63 data->setString("scriptName"_s, scriptName); 64 64 data->setInteger("scriptLine"_s, scriptLine); 65 data->setInteger("scriptColumn"_s, scriptColumn); 65 66 return data; 66 67 } … … 104 105 } 105 106 106 Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber)107 Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, int lineNumber, int columnNumber) 107 108 { 108 109 Ref<JSON::Object> data = JSON::Object::create(); 109 110 data->setString("url"_s, url); 110 111 data->setInteger("lineNumber"_s, lineNumber); 112 data->setInteger("columnNumber"_s, columnNumber); 111 113 return data; 112 114 } -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r239397 r240323 50 50 static Ref<JSON::Object> createGenericRecord(double startTime, int maxCallStackDepth); 51 51 52 static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine );52 static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine, int scriptColumn); 53 53 static Ref<JSON::Object> createConsoleProfileData(const String& title); 54 54 static Ref<JSON::Object> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId); … … 56 56 static Ref<JSON::Object> createGenericTimerData(int timerId); 57 57 static Ref<JSON::Object> createTimerInstallData(int timerId, Seconds timeout, bool singleShot); 58 static Ref<JSON::Object> createEvaluateScriptData(const String&, double lineNumber);58 static Ref<JSON::Object> createEvaluateScriptData(const String&, int lineNumber, int columnNumber); 59 59 static Ref<JSON::Object> createTimeStampData(const String&); 60 60 static Ref<JSON::Object> createAnimationFrameData(int callbackId); -
trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp
r239427 r240323 294 294 } 295 295 296 void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, Frame* frame)297 { 298 pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine ), TimelineRecordType::FunctionCall, true, frame);296 void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, int scriptColumn, Frame* frame) 297 { 298 pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine, scriptColumn), TimelineRecordType::FunctionCall, true, frame); 299 299 } 300 300 … … 403 403 } 404 404 405 void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, Frame& frame)406 { 407 pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber ), TimelineRecordType::EvaluateScript, true, &frame);405 void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, int columnNumber, Frame& frame) 406 { 407 pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber, columnNumber), TimelineRecordType::EvaluateScript, true, &frame); 408 408 } 409 409 -
trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h
r239397 r240323 119 119 void willFireTimer(int timerId, Frame*); 120 120 void didFireTimer(); 121 void willCallFunction(const String& scriptName, int scriptLine, Frame*);121 void willCallFunction(const String& scriptName, int scriptLine, int scriptColumn, Frame*); 122 122 void didCallFunction(Frame*); 123 123 void willDispatchEvent(const Event&, Frame*); 124 124 void didDispatchEvent(); 125 void willEvaluateScript(const String&, int , Frame&);125 void willEvaluateScript(const String&, int lineNumber, int columnNumber, Frame&); 126 126 void didEvaluateScript(Frame&); 127 127 void didInvalidateLayout(Frame&); -
trunk/Source/WebInspectorUI/ChangeLog
r240318 r240323 1 2019-01-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number 4 https://bugs.webkit.org/show_bug.cgi?id=116191 5 <rdar://problem/13905910> 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Controllers/TimelineManager.js: 10 (WI.TimelineManager.prototype._processRecord): 11 1 12 2019-01-22 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r239397 r240323 533 533 if (scriptResource) { 534 534 // The lineNumber is 1-based, but we expect 0-based. 535 var lineNumber = recordPayload.data.lineNumber - 1; 536 537 // FIXME: No column number is provided. 538 sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0); 535 let lineNumber = recordPayload.data.lineNumber - 1; 536 let columnNumber = "columnNumber" in recordPayload.data ? recordPayload.data.columnNumber - 1 : 0; 537 sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, columnNumber); 539 538 } 540 539 } … … 587 586 if (scriptResource) { 588 587 // The lineNumber is 1-based, but we expect 0-based. 589 var lineNumber = recordPayload.data.scriptLine - 1; 590 591 // FIXME: No column number is provided. 592 sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0); 588 let lineNumber = recordPayload.data.scriptLine - 1; 589 let columnNumber = "scriptColumn" in recordPayload.data ? recordPayload.data.scriptColumn - 1 : 0; 590 sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, columnNumber); 593 591 } 594 592 }
Note: See TracChangeset
for help on using the changeset viewer.