Changeset 191643 in webkit
- Timestamp:
- Oct 27, 2015, 3:08:03 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r191625 r191643 1 2015-10-27 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Remove unused / duplicated XHR timeline instrumentation 4 https://bugs.webkit.org/show_bug.cgi?id=150605 5 6 Reviewed by Timothy Hatcher. 7 8 * inspector/protocol/Timeline.json: 9 1 10 2015-10-27 Michael Saboff <msaboff@apple.com> 2 11 -
trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json
r191532 r191643 26 26 "Time", 27 27 "TimeEnd", 28 "XHRReadyStateChange",29 "XHRLoad",30 28 "FunctionCall", 31 29 "ProbeSample", -
trunk/Source/WebCore/ChangeLog
r191641 r191643 1 2015-10-27 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Remove unused / duplicated XHR timeline instrumentation 4 https://bugs.webkit.org/show_bug.cgi?id=150605 5 6 Reviewed by Timothy Hatcher. 7 8 These records are just duplicates of "EventDispatch" records for XHR 9 load and readystatechange events. Due to the nesting, the XHR records 10 were themselves never getting looked at, and their data (URL / readyState) 11 not shown in the frontend. 12 13 * inspector/InspectorInstrumentation.cpp: 14 (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl): Deleted. 15 (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl): Deleted. 16 (WebCore::InspectorInstrumentation::willDispatchXHRLoadEventImpl): Deleted. 17 (WebCore::InspectorInstrumentation::didDispatchXHRLoadEventImpl): Deleted. 18 * inspector/InspectorInstrumentation.h: 19 (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent): Deleted. 20 (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent): Deleted. 21 (WebCore::InspectorInstrumentation::willDispatchXHRLoadEvent): Deleted. 22 (WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent): Deleted. 23 * inspector/InspectorTimelineAgent.cpp: 24 (WebCore::InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent): Deleted. 25 (WebCore::InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent): Deleted. 26 (WebCore::InspectorTimelineAgent::willDispatchXHRLoadEvent): Deleted. 27 (WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted. 28 (WebCore::toProtocol): Deleted. 29 * inspector/InspectorTimelineAgent.h: 30 * inspector/TimelineRecordFactory.cpp: 31 (WebCore::TimelineRecordFactory::createXHRReadyStateChangeData): Deleted. 32 (WebCore::TimelineRecordFactory::createXHRLoadData): Deleted. 33 * inspector/TimelineRecordFactory.h: 34 * xml/XMLHttpRequest.cpp: 35 (WebCore::XMLHttpRequest::callReadyStateChangeListener): Deleted. 36 1 37 2015-10-27 Joseph Pecoraro <pecoraro@apple.com> 2 38 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r191532 r191643 346 346 } 347 347 348 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents& instrumentingAgents, XMLHttpRequest& request, ScriptExecutionContext* context)349 {350 int timelineAgentId = 0;351 InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent();352 if (timelineAgent && request.hasEventListeners(eventNames().readystatechangeEvent)) {353 timelineAgent->willDispatchXHRReadyStateChangeEvent(request.url().string(), request.readyState(), frameForScriptExecutionContext(context));354 timelineAgentId = timelineAgent->id();355 }356 return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);357 }358 359 void InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie& cookie)360 {361 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))362 timelineAgent->didDispatchXHRReadyStateChangeEvent();363 }364 365 348 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InstrumentingAgents& instrumentingAgents, Document& document, const Event& event, bool hasEventListeners) 366 349 { … … 483 466 if (InspectorPageAgent* pageAgent = cookie.instrumentingAgents()->inspectorPageAgent()) 484 467 pageAgent->didLayout(); 485 }486 487 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEventImpl(InstrumentingAgents& instrumentingAgents, XMLHttpRequest& request, ScriptExecutionContext* context)488 {489 int timelineAgentId = 0;490 InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent();491 if (timelineAgent && request.hasEventListeners(eventNames().loadEvent)) {492 timelineAgent->willDispatchXHRLoadEvent(request.url(), frameForScriptExecutionContext(context));493 timelineAgentId = timelineAgent->id();494 }495 return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);496 }497 498 void InspectorInstrumentation::didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie& cookie)499 {500 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))501 timelineAgent->didDispatchXHRLoadEvent();502 468 } 503 469 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r191532 r191643 147 147 static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine); 148 148 static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*); 149 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest&);150 static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);151 149 static InspectorInstrumentationCookie willDispatchEvent(Document&, const Event&, bool hasEventListeners); 152 150 static void didDispatchEvent(const InspectorInstrumentationCookie&); … … 164 162 static void didLayout(const InspectorInstrumentationCookie&, RenderObject*); 165 163 static void didScroll(Page&); 166 static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest&);167 static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);168 164 static void willComposite(Frame&); 169 165 static void didComposite(Frame&); … … 328 324 static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*); 329 325 static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*); 330 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents&, XMLHttpRequest&, ScriptExecutionContext*);331 static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);332 326 static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents&, Document&, const Event&, bool hasEventListeners); 333 327 static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents&, const Event&); … … 345 339 static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*); 346 340 static void didScrollImpl(InstrumentingAgents&); 347 static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents&, XMLHttpRequest&, ScriptExecutionContext*);348 static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);349 341 static void willCompositeImpl(InstrumentingAgents&, Frame&); 350 342 static void didCompositeImpl(InstrumentingAgents&); … … 706 698 } 707 699 708 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest& request)709 {710 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());711 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))712 return willDispatchXHRReadyStateChangeEventImpl(*instrumentingAgents, request, context);713 return InspectorInstrumentationCookie();714 }715 716 inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)717 {718 FAST_RETURN_IF_NO_FRONTENDS(void());719 if (cookie.isValid())720 didDispatchXHRReadyStateChangeEventImpl(cookie);721 }722 723 700 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document& document, const Event& event, bool hasEventListeners) 724 701 { … … 828 805 FAST_RETURN_IF_NO_FRONTENDS(void()); 829 806 didScrollImpl(instrumentingAgentsForPage(page)); 830 }831 832 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest& request)833 {834 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());835 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))836 return willDispatchXHRLoadEventImpl(*instrumentingAgents, request, context);837 return InspectorInstrumentationCookie();838 }839 840 inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)841 {842 FAST_RETURN_IF_NO_FRONTENDS(void());843 if (cookie.isValid())844 didDispatchXHRLoadEventImpl(cookie);845 807 } 846 808 -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r191641 r191643 450 450 } 451 451 452 void InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent(const String& url, int readyState, Frame* frame)453 {454 pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeData(url, readyState), TimelineRecordType::XHRReadyStateChange, false, frame);455 }456 457 void InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent()458 {459 didCompleteCurrentRecord(TimelineRecordType::XHRReadyStateChange);460 }461 462 void InspectorTimelineAgent::willDispatchXHRLoadEvent(const String& url, Frame* frame)463 {464 pushCurrentRecord(TimelineRecordFactory::createXHRLoadData(url), TimelineRecordType::XHRLoad, true, frame);465 }466 467 void InspectorTimelineAgent::didDispatchXHRLoadEvent()468 {469 didCompleteCurrentRecord(TimelineRecordType::XHRLoad);470 }471 472 452 void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, Frame& frame) 473 453 { … … 629 609 return Inspector::Protocol::Timeline::EventType::TimeEnd; 630 610 631 case TimelineRecordType::XHRReadyStateChange:632 return Inspector::Protocol::Timeline::EventType::XHRReadyStateChange;633 case TimelineRecordType::XHRLoad:634 return Inspector::Protocol::Timeline::EventType::XHRLoad;635 636 611 case TimelineRecordType::FunctionCall: 637 612 return Inspector::Protocol::Timeline::EventType::FunctionCall; -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r191532 r191643 90 90 TimeEnd, 91 91 92 XHRReadyStateChange,93 XHRLoad,94 95 92 FunctionCall, 96 93 ProbeSample, … … 142 139 void willCallFunction(const String& scriptName, int scriptLine, Frame*); 143 140 void didCallFunction(Frame*); 144 void willDispatchXHRReadyStateChangeEvent(const String&, int, Frame*);145 void didDispatchXHRReadyStateChangeEvent();146 141 void willDispatchEvent(const Event&, Frame*); 147 142 void didDispatchEvent(); … … 151 146 void willLayout(Frame&); 152 147 void didLayout(RenderObject*); 153 void willDispatchXHRLoadEvent(const String&, Frame*);154 void didDispatchXHRLoadEvent();155 148 void willComposite(Frame&); 156 149 void didComposite(); -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r191485 r191643 117 117 } 118 118 119 Ref<InspectorObject> TimelineRecordFactory::createXHRReadyStateChangeData(const String& url, int readyState)120 {121 Ref<InspectorObject> data = InspectorObject::create();122 data->setString("url", url);123 data->setInteger("readyState", readyState);124 return WTF::move(data);125 }126 127 Ref<InspectorObject> TimelineRecordFactory::createXHRLoadData(const String& url)128 {129 Ref<InspectorObject> data = InspectorObject::create();130 data->setString("url", url);131 return WTF::move(data);132 }133 134 119 Ref<InspectorObject> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber) 135 120 { -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r191485 r191643 70 70 static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, int timeout, bool singleShot); 71 71 72 static Ref<Inspector::InspectorObject> createXHRReadyStateChangeData(const String& url, int readyState);73 74 static Ref<Inspector::InspectorObject> createXHRLoadData(const String& url);75 76 72 static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber); 77 73 -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r191077 r191643 374 374 return; 375 375 376 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(scriptExecutionContext(), *this);377 378 376 if (m_async || (m_state <= OPENED || m_state == DONE)) 379 377 m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(eventNames().readystatechangeEvent, false, false), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent); 380 378 381 InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie);382 379 if (m_state == DONE && !m_error) { 383 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(scriptExecutionContext(), *this);384 380 m_progressEventThrottle.dispatchProgressEvent(eventNames().loadEvent); 385 InspectorInstrumentation::didDispatchXHRLoadEvent(cookie);386 381 m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent); 387 382 } -
trunk/Source/WebInspectorUI/ChangeLog
r191640 r191643 1 2015-10-27 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Remove unused / duplicated XHR timeline instrumentation 4 https://bugs.webkit.org/show_bug.cgi?id=150605 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Controllers/TimelineManager.js: 9 (WebInspector.TimelineManager.prototype._processRecord): 10 Remove unused events and add an assert that we don't miss 11 any script embedders. 12 1 13 2015-10-27 Matt Baker <mattbaker@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r191639 r191643 344 344 case TimelineAgent.EventType.EventDispatch: 345 345 return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profileData); 346 case TimelineAgent.EventType.XHRLoad:347 return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, "load", profileData);348 case TimelineAgent.EventType.XHRReadyStateChange:349 return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, "readystatechange", profileData);350 346 case TimelineAgent.EventType.FireAnimationFrame: 351 347 return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profileData); 348 default: 349 console.assert(false, "Missed FunctionCall embedded inside of: " + parentRecordPayload.type); 352 350 } 353 351
Note:
See TracChangeset
for help on using the changeset viewer.