Changeset 191643 in webkit


Ignore:
Timestamp:
Oct 27, 2015, 3:08:03 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Remove unused / duplicated XHR timeline instrumentation
https://bugs.webkit.org/show_bug.cgi?id=150605

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-10-27
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

  • inspector/protocol/Timeline.json:

Source/WebCore:

These records are just duplicates of "EventDispatch" records for XHR
load and readystatechange events. Due to the nesting, the XHR records
were themselves never getting looked at, and their data (URL / readyState)
not shown in the frontend.

  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl): Deleted.
(WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl): Deleted.
(WebCore::InspectorInstrumentation::willDispatchXHRLoadEventImpl): Deleted.
(WebCore::InspectorInstrumentation::didDispatchXHRLoadEventImpl): Deleted.

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent): Deleted.
(WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent): Deleted.
(WebCore::InspectorInstrumentation::willDispatchXHRLoadEvent): Deleted.
(WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent): Deleted.

  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent): Deleted.
(WebCore::InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent): Deleted.
(WebCore::InspectorTimelineAgent::willDispatchXHRLoadEvent): Deleted.
(WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
(WebCore::toProtocol): Deleted.

  • inspector/InspectorTimelineAgent.h:
  • inspector/TimelineRecordFactory.cpp:

(WebCore::TimelineRecordFactory::createXHRReadyStateChangeData): Deleted.
(WebCore::TimelineRecordFactory::createXHRLoadData): Deleted.

  • inspector/TimelineRecordFactory.h:
  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::callReadyStateChangeListener): Deleted.

Source/WebInspectorUI:

  • UserInterface/Controllers/TimelineManager.js:

(WebInspector.TimelineManager.prototype._processRecord):
Remove unused events and add an assert that we don't miss
any script embedders.

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r191625 r191643  
     12015-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
    1102015-10-27  Michael Saboff  <msaboff@apple.com>
    211
  • trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json

    r191532 r191643  
    2626                "Time",
    2727                "TimeEnd",
    28                 "XHRReadyStateChange",
    29                 "XHRLoad",
    3028                "FunctionCall",
    3129                "ProbeSample",
  • trunk/Source/WebCore/ChangeLog

    r191641 r191643  
     12015-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
    1372015-10-27  Joseph Pecoraro  <pecoraro@apple.com>
    238
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r191532 r191643  
    346346}
    347347
    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 
    365348InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InstrumentingAgents& instrumentingAgents, Document& document, const Event& event, bool hasEventListeners)
    366349{
     
    483466    if (InspectorPageAgent* pageAgent = cookie.instrumentingAgents()->inspectorPageAgent())
    484467        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();
    502468}
    503469
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r191532 r191643  
    147147    static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
    148148    static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
    149     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest&);
    150     static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
    151149    static InspectorInstrumentationCookie willDispatchEvent(Document&, const Event&, bool hasEventListeners);
    152150    static void didDispatchEvent(const InspectorInstrumentationCookie&);
     
    164162    static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
    165163    static void didScroll(Page&);
    166     static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest&);
    167     static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
    168164    static void willComposite(Frame&);
    169165    static void didComposite(Frame&);
     
    328324    static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
    329325    static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
    330     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents&, XMLHttpRequest&, ScriptExecutionContext*);
    331     static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
    332326    static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents&, Document&, const Event&, bool hasEventListeners);
    333327    static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents&, const Event&);
     
    345339    static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
    346340    static void didScrollImpl(InstrumentingAgents&);
    347     static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents&, XMLHttpRequest&, ScriptExecutionContext*);
    348     static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
    349341    static void willCompositeImpl(InstrumentingAgents&, Frame&);
    350342    static void didCompositeImpl(InstrumentingAgents&);
     
    706698}
    707699
    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 
    723700inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document& document, const Event& event, bool hasEventListeners)
    724701{
     
    828805    FAST_RETURN_IF_NO_FRONTENDS(void());
    829806    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);
    845807}
    846808
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r191641 r191643  
    450450}
    451451
    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 
    472452void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, Frame& frame)
    473453{
     
    629609        return Inspector::Protocol::Timeline::EventType::TimeEnd;
    630610
    631     case TimelineRecordType::XHRReadyStateChange:
    632         return Inspector::Protocol::Timeline::EventType::XHRReadyStateChange;
    633     case TimelineRecordType::XHRLoad:
    634         return Inspector::Protocol::Timeline::EventType::XHRLoad;
    635 
    636611    case TimelineRecordType::FunctionCall:
    637612        return Inspector::Protocol::Timeline::EventType::FunctionCall;
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r191532 r191643  
    9090    TimeEnd,
    9191
    92     XHRReadyStateChange,
    93     XHRLoad,
    94 
    9592    FunctionCall,
    9693    ProbeSample,
     
    142139    void willCallFunction(const String& scriptName, int scriptLine, Frame*);
    143140    void didCallFunction(Frame*);
    144     void willDispatchXHRReadyStateChangeEvent(const String&, int, Frame*);
    145     void didDispatchXHRReadyStateChangeEvent();
    146141    void willDispatchEvent(const Event&, Frame*);
    147142    void didDispatchEvent();
     
    151146    void willLayout(Frame&);
    152147    void didLayout(RenderObject*);
    153     void willDispatchXHRLoadEvent(const String&, Frame*);
    154     void didDispatchXHRLoadEvent();
    155148    void willComposite(Frame&);
    156149    void didComposite();
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp

    r191485 r191643  
    117117}
    118118
    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 
    134119Ref<InspectorObject> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber)
    135120{
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.h

    r191485 r191643  
    7070        static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, int timeout, bool singleShot);
    7171
    72         static Ref<Inspector::InspectorObject> createXHRReadyStateChangeData(const String& url, int readyState);
    73 
    74         static Ref<Inspector::InspectorObject> createXHRLoadData(const String& url);
    75 
    7672        static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
    7773
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r191077 r191643  
    374374        return;
    375375
    376     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(scriptExecutionContext(), *this);
    377 
    378376    if (m_async || (m_state <= OPENED || m_state == DONE))
    379377        m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(eventNames().readystatechangeEvent, false, false), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
    380378
    381     InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie);
    382379    if (m_state == DONE && !m_error) {
    383         InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(scriptExecutionContext(), *this);
    384380        m_progressEventThrottle.dispatchProgressEvent(eventNames().loadEvent);
    385         InspectorInstrumentation::didDispatchXHRLoadEvent(cookie);
    386381        m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent);
    387382    }
  • trunk/Source/WebInspectorUI/ChangeLog

    r191640 r191643  
     12015-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
    1132015-10-27  Matt Baker  <mattbaker@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r191639 r191643  
    344344            case TimelineAgent.EventType.EventDispatch:
    345345                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);
    350346            case TimelineAgent.EventType.FireAnimationFrame:
    351347                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);
    352350            }
    353351
Note: See TracChangeset for help on using the changeset viewer.