Changeset 128285 in webkit
- Timestamp:
- Sep 12, 2012 2:57:42 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128284 r128285 1 2012-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 1 32 2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 33 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r128184 r128285 320 320 } 321 321 322 InspectorInstrumentationCookie InspectorInstrumentation::will ChangeXHRReadyStateImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)322 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context) 323 323 { 324 324 int timelineAgentId = 0; 325 325 InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); 326 326 if (timelineAgent && request->hasEventListeners(eventNames().readystatechangeEvent)) { 327 timelineAgent->will ChangeXHRReadyState(request->url().string(), request->readyState(), frameForScriptExecutionContext(context));328 timelineAgentId = timelineAgent->id(); 329 } 330 return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); 331 } 332 333 void InspectorInstrumentation::did ChangeXHRReadyStateImpl(const InspectorInstrumentationCookie& cookie)334 { 335 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 336 timelineAgent->did ChangeXHRReadyState();327 timelineAgent->willDispatchXHRReadyStateChangeEvent(request->url().string(), request->readyState(), frameForScriptExecutionContext(context)); 328 timelineAgentId = timelineAgent->id(); 329 } 330 return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); 331 } 332 333 void InspectorInstrumentation::didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie& cookie) 334 { 335 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 336 timelineAgent->didDispatchXHRReadyStateChangeEvent(); 337 337 } 338 338 … … 464 464 } 465 465 466 InspectorInstrumentationCookie InspectorInstrumentation::will LoadXHRImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context)466 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEventImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request, ScriptExecutionContext* context) 467 467 { 468 468 int timelineAgentId = 0; 469 469 InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); 470 470 if (timelineAgent && request->hasEventListeners(eventNames().loadEvent)) { 471 timelineAgent->will LoadXHR(request->url(), frameForScriptExecutionContext(context));472 timelineAgentId = timelineAgent->id(); 473 } 474 return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); 475 } 476 477 void InspectorInstrumentation::did LoadXHRImpl(const InspectorInstrumentationCookie& cookie)478 { 479 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 480 timelineAgent->did LoadXHR();471 timelineAgent->willDispatchXHRLoadEvent(request->url(), frameForScriptExecutionContext(context)); 472 timelineAgentId = timelineAgent->id(); 473 } 474 return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); 475 } 476 477 void InspectorInstrumentation::didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie& cookie) 478 { 479 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 480 timelineAgent->didDispatchXHRLoadEvent(); 481 481 } 482 482 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r128184 r128285 129 129 static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine); 130 130 static void didCallFunction(const InspectorInstrumentationCookie&); 131 static InspectorInstrumentationCookie will ChangeXHRReadyState(ScriptExecutionContext*, XMLHttpRequest* request);132 static void did ChangeXHRReadyState(const InspectorInstrumentationCookie&);131 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*); 132 static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&); 133 133 static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors); 134 134 static void didDispatchEvent(const InspectorInstrumentationCookie&); … … 148 148 static void didLayout(const InspectorInstrumentationCookie&, RenderObject*); 149 149 static void didScroll(Page*); 150 static InspectorInstrumentationCookie will LoadXHR(ScriptExecutionContext*, XMLHttpRequest*);151 static void did LoadXHR(const InspectorInstrumentationCookie&);150 static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest*); 151 static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&); 152 152 static InspectorInstrumentationCookie willPaint(Frame*, GraphicsContext*, const LayoutRect&); 153 153 static void didPaint(const InspectorInstrumentationCookie&); … … 306 306 static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, const String& scriptName, int scriptLine, ScriptExecutionContext*); 307 307 static void didCallFunctionImpl(const InspectorInstrumentationCookie&); 308 static InspectorInstrumentationCookie will ChangeXHRReadyStateImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);309 static void did ChangeXHRReadyStateImpl(const InspectorInstrumentationCookie&);308 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*); 309 static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&); 310 310 static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, DOMWindow*, Node*, const Vector<EventContext>& ancestors, Document*); 311 311 static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*); … … 325 325 static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*); 326 326 static void didScrollImpl(InstrumentingAgents*); 327 static InspectorInstrumentationCookie will LoadXHRImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);328 static void did LoadXHRImpl(const InspectorInstrumentationCookie&);327 static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*); 328 static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&); 329 329 static InspectorInstrumentationCookie willPaintImpl(InstrumentingAgents*, GraphicsContext*, const LayoutRect&, Frame*); 330 330 static void didPaintImpl(const InspectorInstrumentationCookie&); … … 675 675 } 676 676 677 inline InspectorInstrumentationCookie InspectorInstrumentation::will ChangeXHRReadyState(ScriptExecutionContext* context, XMLHttpRequest* request)677 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest* request) 678 678 { 679 679 #if ENABLE(INSPECTOR) 680 680 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie()); 681 681 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 682 return will ChangeXHRReadyStateImpl(instrumentingAgents, request, context);683 #endif 684 return InspectorInstrumentationCookie(); 685 } 686 687 inline void InspectorInstrumentation::did ChangeXHRReadyState(const InspectorInstrumentationCookie& cookie)688 { 689 #if ENABLE(INSPECTOR) 690 FAST_RETURN_IF_NO_FRONTENDS(void()); 691 if (cookie.first) 692 did ChangeXHRReadyStateImpl(cookie);682 return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, request, context); 683 #endif 684 return InspectorInstrumentationCookie(); 685 } 686 687 inline 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); 693 693 #endif 694 694 } … … 853 853 } 854 854 855 inline InspectorInstrumentationCookie InspectorInstrumentation::will LoadXHR(ScriptExecutionContext* context, XMLHttpRequest* request)855 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest* request) 856 856 { 857 857 #if ENABLE(INSPECTOR) 858 858 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie()); 859 859 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 860 return will LoadXHRImpl(instrumentingAgents, request, context);861 #endif 862 return InspectorInstrumentationCookie(); 863 } 864 865 inline void InspectorInstrumentation::did LoadXHR(const InspectorInstrumentationCookie& cookie)866 { 867 #if ENABLE(INSPECTOR) 868 FAST_RETURN_IF_NO_FRONTENDS(void()); 869 if (cookie.first) 870 did LoadXHRImpl(cookie);860 return willDispatchXHRLoadEventImpl(instrumentingAgents, request, context); 861 #endif 862 return InspectorInstrumentationCookie(); 863 } 864 865 inline 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); 871 871 #endif 872 872 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r128184 r128285 345 345 } 346 346 347 void InspectorTimelineAgent::will ChangeXHRReadyState(const String& url, int readyState, Frame* frame)347 void InspectorTimelineAgent::willDispatchXHRReadyStateChangeEvent(const String& url, int readyState, Frame* frame) 348 348 { 349 349 pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeData(url, readyState), TimelineRecordType::XHRReadyStateChange, false, frame); 350 350 } 351 351 352 void InspectorTimelineAgent::did ChangeXHRReadyState()352 void InspectorTimelineAgent::didDispatchXHRReadyStateChangeEvent() 353 353 { 354 354 didCompleteCurrentRecord(TimelineRecordType::XHRReadyStateChange); 355 355 } 356 356 357 void InspectorTimelineAgent::will LoadXHR(const String& url, Frame* frame)357 void InspectorTimelineAgent::willDispatchXHRLoadEvent(const String& url, Frame* frame) 358 358 { 359 359 pushCurrentRecord(TimelineRecordFactory::createXHRLoadData(url), TimelineRecordType::XHRLoad, true, frame); 360 360 } 361 361 362 void InspectorTimelineAgent::did LoadXHR()362 void InspectorTimelineAgent::didDispatchXHRLoadEvent() 363 363 { 364 364 didCompleteCurrentRecord(TimelineRecordType::XHRLoad); -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r128184 r128285 122 122 void didFireTimer(); 123 123 124 void will ChangeXHRReadyState(const String&, int, Frame*);125 void did ChangeXHRReadyState();126 void will LoadXHR(const String&, Frame*);127 void did LoadXHR();124 void willDispatchXHRReadyStateChangeEvent(const String&, int, Frame*); 125 void didDispatchXHRReadyStateChangeEvent(); 126 void willDispatchXHRLoadEvent(const String&, Frame*); 127 void didDispatchXHRLoadEvent(); 128 128 129 129 void willEvaluateScript(const String&, int, Frame*); -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r127751 r128285 395 395 return; 396 396 397 InspectorInstrumentationCookie cookie = InspectorInstrumentation::will ChangeXHRReadyState(scriptExecutionContext(), this);397 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(scriptExecutionContext(), this); 398 398 399 399 if (m_async || (m_state <= OPENED || m_state == DONE)) 400 400 m_progressEventThrottle.dispatchReadyStateChangeEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent); 401 401 402 InspectorInstrumentation::didChangeXHRReadyState(cookie); 403 402 InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie); 404 403 if (m_state == DONE && !m_error) { 405 InspectorInstrumentationCookie cookie = InspectorInstrumentation::will LoadXHR(scriptExecutionContext(), this);404 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(scriptExecutionContext(), this); 406 405 m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent)); 407 InspectorInstrumentation::did LoadXHR(cookie);406 InspectorInstrumentation::didDispatchXHRLoadEvent(cookie); 408 407 m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadendEvent)); 409 408 }
Note: See TracChangeset
for help on using the changeset viewer.