Title: [128285] trunk/Source/WebCore
Revision
128285
Author
vse...@chromium.org
Date
2012-09-12 02:57:42 -0700 (Wed, 12 Sep 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (128284 => 128285)


--- trunk/Source/WebCore/ChangeLog	2012-09-12 09:46:32 UTC (rev 128284)
+++ trunk/Source/WebCore/ChangeLog	2012-09-12 09:57:42 UTC (rev 128285)
@@ -1,3 +1,34 @@
+2012-09-12  Vsevolod Vlasov  <vse...@chromium.org>
+
+        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):
+
 2012-09-12  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r128279.

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (128284 => 128285)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2012-09-12 09:46:32 UTC (rev 128284)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2012-09-12 09:57:42 UTC (rev 128285)
@@ -319,21 +319,21 @@
         timelineAgent->didCallFunction();
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyStateImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
+InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
 {
     int timelineAgentId = 0;
     InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent();
     if (timelineAgent && request->hasEventListeners(eventNames().readystatechangeEvent)) {
-        timelineAgent->willChangeXHRReadyState(request->url().string(), request->readyState(), frameForScriptExecutionContext(context));
+        timelineAgent->willDispatchXHRReadyStateChangeEvent(request->url().string(), request->readyState(), frameForScriptExecutionContext(context));
         timelineAgentId = timelineAgent->id();
     }
     return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
 }
 
-void InspectorInstrumentation::didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie& cookie)
+void InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie& cookie)
 {
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
-        timelineAgent->didChangeXHRReadyState();
+        timelineAgent->didDispatchXHRReadyStateChangeEvent();
 }
 
 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InstrumentingAgents* instrumentingAgents, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors, Document* document)
@@ -463,21 +463,21 @@
         pageAgent->didLayout();
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHRImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
+InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEventImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)
 {
     int timelineAgentId = 0;
     InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent();
     if (timelineAgent && request->hasEventListeners(eventNames().loadEvent)) {
-        timelineAgent->willLoadXHR(request->url(), frameForScriptExecutionContext(context));
+        timelineAgent->willDispatchXHRLoadEvent(request->url(), frameForScriptExecutionContext(context));
         timelineAgentId = timelineAgent->id();
     }
     return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
 }
 
-void InspectorInstrumentation::didLoadXHRImpl(const InspectorInstrumentationCookie& cookie)
+void InspectorInstrumentation::didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie& cookie)
 {
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
-        timelineAgent->didLoadXHR();
+        timelineAgent->didDispatchXHRLoadEvent();
 }
 
 InspectorInstrumentationCookie InspectorInstrumentation::willPaintImpl(InstrumentingAgents* instrumentingAgents, GraphicsContext* context, const LayoutRect& rect, Frame* frame)

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (128284 => 128285)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2012-09-12 09:46:32 UTC (rev 128284)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2012-09-12 09:57:42 UTC (rev 128285)
@@ -128,8 +128,8 @@
 
     static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
     static void didCallFunction(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willChangeXHRReadyState(ScriptExecutionContext*, XMLHttpRequest* request);
-    static void didChangeXHRReadyState(const InspectorInstrumentationCookie&);
+    static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*);
+    static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors);
     static void didDispatchEvent(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willHandleEvent(ScriptExecutionContext*, Event*);
@@ -147,8 +147,8 @@
     static InspectorInstrumentationCookie willLayout(Frame*);
     static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
     static void didScroll(Page*);
-    static InspectorInstrumentationCookie willLoadXHR(ScriptExecutionContext*, XMLHttpRequest*);
-    static void didLoadXHR(const InspectorInstrumentationCookie&);
+    static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest*);
+    static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willPaint(Frame*, GraphicsContext*, const LayoutRect&);
     static void didPaint(const InspectorInstrumentationCookie&);
     static void willComposite(Page*);
@@ -305,8 +305,8 @@
 
     static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, const String& scriptName, int scriptLine, ScriptExecutionContext*);
     static void didCallFunctionImpl(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willChangeXHRReadyStateImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
-    static void didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie&);
+    static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
+    static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, DOMWindow*, Node*, const Vector<EventContext>& ancestors, Document*);
     static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*);
     static void didHandleEventImpl(const InspectorInstrumentationCookie&);
@@ -324,8 +324,8 @@
     static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents*, Frame*);
     static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
     static void didScrollImpl(InstrumentingAgents*);
-    static InspectorInstrumentationCookie willLoadXHRImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
-    static void didLoadXHRImpl(const InspectorInstrumentationCookie&);
+    static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
+    static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willPaintImpl(InstrumentingAgents*, GraphicsContext*, const LayoutRect&, Frame*);
     static void didPaintImpl(const InspectorInstrumentationCookie&);
     static void willCompositeImpl(InstrumentingAgents*);
@@ -674,22 +674,22 @@
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyState(ScriptExecutionContext* context, XMLHttpRequest* request)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        return willChangeXHRReadyStateImpl(instrumentingAgents, request, context);
+        return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, request, context);
 #endif
     return InspectorInstrumentationCookie();
 }
 
-inline void InspectorInstrumentation::didChangeXHRReadyState(const InspectorInstrumentationCookie& cookie)
+inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (cookie.first)
-        didChangeXHRReadyStateImpl(cookie);
+        didDispatchXHRReadyStateChangeEventImpl(cookie);
 #endif
 }
 
@@ -852,22 +852,22 @@
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHR(ScriptExecutionContext* context, XMLHttpRequest* request)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        return willLoadXHRImpl(instrumentingAgents, request, context);
+        return willDispatchXHRLoadEventImpl(instrumentingAgents, request, context);
 #endif
     return InspectorInstrumentationCookie();
 }
 
-inline void InspectorInstrumentation::didLoadXHR(const InspectorInstrumentationCookie& cookie)
+inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (cookie.first)
-        didLoadXHRImpl(cookie);
+        didDispatchXHRLoadEventImpl(cookie);
 #endif
 }
 

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (128284 => 128285)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2012-09-12 09:46:32 UTC (rev 128284)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2012-09-12 09:57:42 UTC (rev 128285)
@@ -344,22 +344,22 @@
     didCompleteCurrentRecord(TimelineRecordType::TimerFire);
 }
 
-void InspectorTimelineAgent::willChangeXHRReadyState(const String& url, int readyState, Frame* frame)
+void InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent(const String& url, int readyState, Frame* frame)
 {
     pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeData(url, readyState), TimelineRecordType::XHRReadyStateChange, false, frame);
 }
 
-void InspectorTimelineAgent::didChangeXHRReadyState()
+void InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent()
 {
     didCompleteCurrentRecord(TimelineRecordType::XHRReadyStateChange);
 }
 
-void InspectorTimelineAgent::willLoadXHR(const String& url, Frame* frame)
+void InspectorTimelineAgent::willDispatchXHRLoadEvent(const String& url, Frame* frame)
 {
     pushCurrentRecord(TimelineRecordFactory::createXHRLoadData(url), TimelineRecordType::XHRLoad, true, frame);
 }
 
-void InspectorTimelineAgent::didLoadXHR()
+void InspectorTimelineAgent::didDispatchXHRLoadEvent()
 {
     didCompleteCurrentRecord(TimelineRecordType::XHRLoad);
 }

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (128284 => 128285)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2012-09-12 09:46:32 UTC (rev 128284)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2012-09-12 09:57:42 UTC (rev 128285)
@@ -121,10 +121,10 @@
     void willFireTimer(int timerId, Frame*);
     void didFireTimer();
 
-    void willChangeXHRReadyState(const String&, int, Frame*);
-    void didChangeXHRReadyState();
-    void willLoadXHR(const String&, Frame*);
-    void didLoadXHR();
+    void willDispatchXHRReadyStateChangeEvent(const String&, int, Frame*);
+    void didDispatchXHRReadyStateChangeEvent();
+    void willDispatchXHRLoadEvent(const String&, Frame*);
+    void didDispatchXHRLoadEvent();
 
     void willEvaluateScript(const String&, int, Frame*);
     void didEvaluateScript();

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (128284 => 128285)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2012-09-12 09:46:32 UTC (rev 128284)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2012-09-12 09:57:42 UTC (rev 128285)
@@ -394,17 +394,16 @@
     if (!scriptExecutionContext())
         return;
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willChangeXHRReadyState(scriptExecutionContext(), this);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(scriptExecutionContext(), this);
 
     if (m_async || (m_state <= OPENED || m_state == DONE))
         m_progressEventThrottle.dispatchReadyStateChangeEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
 
-    InspectorInstrumentation::didChangeXHRReadyState(cookie);
-
+    InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie);
     if (m_state == DONE && !m_error) {
-        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this);
+        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(scriptExecutionContext(), this);
         m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
-        InspectorInstrumentation::didLoadXHR(cookie);
+        InspectorInstrumentation::didDispatchXHRLoadEvent(cookie);
         m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadendEvent));
     }
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to