Changeset 128285 in webkit


Ignore:
Timestamp:
Sep 12, 2012 2:57:42 AM (12 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: XMLHttpRequest instrumentation methods used by timeline should have better names.
https://bugs.webkit.org/show_bug.cgi?id=96486

Reviewed by Alexander Pavlov.

Renamed instrumentation methods.

  • inspector/InspectorInstrumentation.cpp:

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

  • inspector/InspectorInstrumentation.h:

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

  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent):
(WebCore::InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent):
(WebCore::InspectorTimelineAgent::willDispatchXHRLoadEvent):
(WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent):

  • inspector/InspectorTimelineAgent.h:

(InspectorTimelineAgent):

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::callReadyStateChangeListener):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128284 r128285  
     12012-09-12  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: XMLHttpRequest instrumentation methods used by timeline should have better names.
     4        https://bugs.webkit.org/show_bug.cgi?id=96486
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        Renamed instrumentation methods.
     9
     10        * inspector/InspectorInstrumentation.cpp:
     11        (WebCore):
     12        (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl):
     13        (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl):
     14        (WebCore::InspectorInstrumentation::willDispatchXHRLoadEventImpl):
     15        (WebCore::InspectorInstrumentation::didDispatchXHRLoadEventImpl):
     16        * inspector/InspectorInstrumentation.h:
     17        (InspectorInstrumentation):
     18        (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent):
     19        (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent):
     20        (WebCore::InspectorInstrumentation::willDispatchXHRLoadEvent):
     21        (WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent):
     22        * inspector/InspectorTimelineAgent.cpp:
     23        (WebCore::InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent):
     24        (WebCore::InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent):
     25        (WebCore::InspectorTimelineAgent::willDispatchXHRLoadEvent):
     26        (WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent):
     27        * inspector/InspectorTimelineAgent.h:
     28        (InspectorTimelineAgent):
     29        * xml/XMLHttpRequest.cpp:
     30        (WebCore::XMLHttpRequest::callReadyStateChangeListener):
     31
    1322012-09-12  Sheriff Bot  <webkit.review.bot@gmail.com>
    233
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r128184 r128285  
    320320}
    321321
    322 InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyStateImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
     322InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
    323323{
    324324    int timelineAgentId = 0;
    325325    InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent();
    326326    if (timelineAgent && request->hasEventListeners(eventNames().readystatechangeEvent)) {
    327         timelineAgent->willChangeXHRReadyState(request->url().string(), request->readyState(), frameForScriptExecutionContext(context));
    328         timelineAgentId = timelineAgent->id();
    329     }
    330     return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
    331 }
    332 
    333 void InspectorInstrumentation::didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie& cookie)
    334 {
    335     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    336         timelineAgent->didChangeXHRReadyState();
     327        timelineAgent->willDispatchXHRReadyStateChangeEvent(request->url().string(), request->readyState(), frameForScriptExecutionContext(context));
     328        timelineAgentId = timelineAgent->id();
     329    }
     330    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
     331}
     332
     333void InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie& cookie)
     334{
     335    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
     336        timelineAgent->didDispatchXHRReadyStateChangeEvent();
    337337}
    338338
     
    464464}
    465465
    466 InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHRImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
     466InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEventImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
    467467{
    468468    int timelineAgentId = 0;
    469469    InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent();
    470470    if (timelineAgent && request->hasEventListeners(eventNames().loadEvent)) {
    471         timelineAgent->willLoadXHR(request->url(), frameForScriptExecutionContext(context));
    472         timelineAgentId = timelineAgent->id();
    473     }
    474     return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
    475 }
    476 
    477 void InspectorInstrumentation::didLoadXHRImpl(const InspectorInstrumentationCookie& cookie)
    478 {
    479     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    480         timelineAgent->didLoadXHR();
     471        timelineAgent->willDispatchXHRLoadEvent(request->url(), frameForScriptExecutionContext(context));
     472        timelineAgentId = timelineAgent->id();
     473    }
     474    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
     475}
     476
     477void InspectorInstrumentation::didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie& cookie)
     478{
     479    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
     480        timelineAgent->didDispatchXHRLoadEvent();
    481481}
    482482
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r128184 r128285  
    129129    static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
    130130    static void didCallFunction(const InspectorInstrumentationCookie&);
    131     static InspectorInstrumentationCookie willChangeXHRReadyState(ScriptExecutionContext*, XMLHttpRequest* request);
    132     static void didChangeXHRReadyState(const InspectorInstrumentationCookie&);
     131    static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*);
     132    static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
    133133    static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors);
    134134    static void didDispatchEvent(const InspectorInstrumentationCookie&);
     
    148148    static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
    149149    static void didScroll(Page*);
    150     static InspectorInstrumentationCookie willLoadXHR(ScriptExecutionContext*, XMLHttpRequest*);
    151     static void didLoadXHR(const InspectorInstrumentationCookie&);
     150    static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest*);
     151    static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
    152152    static InspectorInstrumentationCookie willPaint(Frame*, GraphicsContext*, const LayoutRect&);
    153153    static void didPaint(const InspectorInstrumentationCookie&);
     
    306306    static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, const String& scriptName, int scriptLine, ScriptExecutionContext*);
    307307    static void didCallFunctionImpl(const InspectorInstrumentationCookie&);
    308     static InspectorInstrumentationCookie willChangeXHRReadyStateImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
    309     static void didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie&);
     308    static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
     309    static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
    310310    static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, DOMWindow*, Node*, const Vector<EventContext>& ancestors, Document*);
    311311    static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*);
     
    325325    static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
    326326    static void didScrollImpl(InstrumentingAgents*);
    327     static InspectorInstrumentationCookie willLoadXHRImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
    328     static void didLoadXHRImpl(const InspectorInstrumentationCookie&);
     327    static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
     328    static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
    329329    static InspectorInstrumentationCookie willPaintImpl(InstrumentingAgents*, GraphicsContext*, const LayoutRect&, Frame*);
    330330    static void didPaintImpl(const InspectorInstrumentationCookie&);
     
    675675}
    676676
    677 inline InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyState(ScriptExecutionContext* context, XMLHttpRequest* request)
     677inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
    678678{
    679679#if ENABLE(INSPECTOR)
    680680    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
    681681    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    682         return willChangeXHRReadyStateImpl(instrumentingAgents, request, context);
    683 #endif
    684     return InspectorInstrumentationCookie();
    685 }
    686 
    687 inline void InspectorInstrumentation::didChangeXHRReadyState(const InspectorInstrumentationCookie& cookie)
    688 {
    689 #if ENABLE(INSPECTOR)
    690     FAST_RETURN_IF_NO_FRONTENDS(void());
    691     if (cookie.first)
    692         didChangeXHRReadyStateImpl(cookie);
     682        return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, request, context);
     683#endif
     684    return InspectorInstrumentationCookie();
     685}
     686
     687inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)
     688{
     689#if ENABLE(INSPECTOR)
     690    FAST_RETURN_IF_NO_FRONTENDS(void());
     691    if (cookie.first)
     692        didDispatchXHRReadyStateChangeEventImpl(cookie);
    693693#endif
    694694}
     
    853853}
    854854
    855 inline InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHR(ScriptExecutionContext* context, XMLHttpRequest* request)
     855inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
    856856{
    857857#if ENABLE(INSPECTOR)
    858858    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
    859859    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    860         return willLoadXHRImpl(instrumentingAgents, request, context);
    861 #endif
    862     return InspectorInstrumentationCookie();
    863 }
    864 
    865 inline void InspectorInstrumentation::didLoadXHR(const InspectorInstrumentationCookie& cookie)
    866 {
    867 #if ENABLE(INSPECTOR)
    868     FAST_RETURN_IF_NO_FRONTENDS(void());
    869     if (cookie.first)
    870         didLoadXHRImpl(cookie);
     860        return willDispatchXHRLoadEventImpl(instrumentingAgents, request, context);
     861#endif
     862    return InspectorInstrumentationCookie();
     863}
     864
     865inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)
     866{
     867#if ENABLE(INSPECTOR)
     868    FAST_RETURN_IF_NO_FRONTENDS(void());
     869    if (cookie.first)
     870        didDispatchXHRLoadEventImpl(cookie);
    871871#endif
    872872}
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r128184 r128285  
    345345}
    346346
    347 void InspectorTimelineAgent::willChangeXHRReadyState(const String& url, int readyState, Frame* frame)
     347void InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent(const String& url, int readyState, Frame* frame)
    348348{
    349349    pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeData(url, readyState), TimelineRecordType::XHRReadyStateChange, false, frame);
    350350}
    351351
    352 void InspectorTimelineAgent::didChangeXHRReadyState()
     352void InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent()
    353353{
    354354    didCompleteCurrentRecord(TimelineRecordType::XHRReadyStateChange);
    355355}
    356356
    357 void InspectorTimelineAgent::willLoadXHR(const String& url, Frame* frame)
     357void InspectorTimelineAgent::willDispatchXHRLoadEvent(const String& url, Frame* frame)
    358358{
    359359    pushCurrentRecord(TimelineRecordFactory::createXHRLoadData(url), TimelineRecordType::XHRLoad, true, frame);
    360360}
    361361
    362 void InspectorTimelineAgent::didLoadXHR()
     362void InspectorTimelineAgent::didDispatchXHRLoadEvent()
    363363{
    364364    didCompleteCurrentRecord(TimelineRecordType::XHRLoad);
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r128184 r128285  
    122122    void didFireTimer();
    123123
    124     void willChangeXHRReadyState(const String&, int, Frame*);
    125     void didChangeXHRReadyState();
    126     void willLoadXHR(const String&, Frame*);
    127     void didLoadXHR();
     124    void willDispatchXHRReadyStateChangeEvent(const String&, int, Frame*);
     125    void didDispatchXHRReadyStateChangeEvent();
     126    void willDispatchXHRLoadEvent(const String&, Frame*);
     127    void didDispatchXHRLoadEvent();
    128128
    129129    void willEvaluateScript(const String&, int, Frame*);
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r127751 r128285  
    395395        return;
    396396
    397     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willChangeXHRReadyState(scriptExecutionContext(), this);
     397    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(scriptExecutionContext(), this);
    398398
    399399    if (m_async || (m_state <= OPENED || m_state == DONE))
    400400        m_progressEventThrottle.dispatchReadyStateChangeEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
    401401
    402     InspectorInstrumentation::didChangeXHRReadyState(cookie);
    403 
     402    InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie);
    404403    if (m_state == DONE && !m_error) {
    405         InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this);
     404        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(scriptExecutionContext(), this);
    406405        m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
    407         InspectorInstrumentation::didLoadXHR(cookie);
     406        InspectorInstrumentation::didDispatchXHRLoadEvent(cookie);
    408407        m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadendEvent));
    409408    }
Note: See TracChangeset for help on using the changeset viewer.