InspectorTimelineAgent* InspectorInstrumentation::retrieveTimelineAgent(const InspectorInstrumentationCookie& cookie) { InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie.first); if (timelineAgent && timelineAgent->id() == cookie.second) return timelineAgent; return 0; }
InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie& cookie) { if (!cookie.instrumentingAgents()) return 0; InspectorTimelineAgent* timelineAgent = cookie.instrumentingAgents()->inspectorTimelineAgent(); if (timelineAgent && cookie.hasMatchingTimelineAgentId(timelineAgent->id())) return timelineAgent; return 0; }
InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceDataImpl(InspectorController* inspectorController, unsigned long identifier) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willReceiveResourceData(identifier); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateStyleImpl(InspectorController* inspectorController) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willRecalculateStyle(); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willPaintImpl(InspectorController* inspectorController, const IntRect& rect) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willPaint(rect); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InspectorController* inspectorController, const String& url, int lineNumber) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willEvaluateScript(url, lineNumber); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InspectorController* inspectorController, const String& scriptName, int scriptLine) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willCallFunction(scriptName, scriptLine); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTMLImpl(InspectorController* inspectorController, unsigned int length, unsigned int startLine) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willWriteHTML(length, startLine); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponseImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const ResourceResponse& response) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); if (timelineAgent) { timelineAgent->willReceiveResourceResponse(identifier, response); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willLayoutImpl(InspectorAgent* inspectorAgent) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorAgent); if (timelineAgent) { timelineAgent->willLayout(); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorAgent, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyStateImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); if (timelineAgent && request->hasEventListeners(eventNames().readystatechangeEvent)) { timelineAgent->willChangeXHRReadyState(request->url().string(), request->readyState()); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHRImpl(InstrumentingAgents* instrumentingAgents, XMLHttpRequest* request) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); if (timelineAgent && request->hasEventListeners(eventNames().loadEvent)) { timelineAgent->willLoadXHR(request->url()); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindowImpl(InstrumentingAgents* instrumentingAgents, const Event& event, DOMWindow* window) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); if (timelineAgent && window->hasEventListeners(event.type())) { timelineAgent->willDispatchEvent(event); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InstrumentingAgents* instrumentingAgents, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors) { int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); if (timelineAgent && eventHasListeners(event.type(), window, node, ancestors)) { timelineAgent->willDispatchEvent(event); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindowImpl(InstrumentingAgents* instrumentingAgents, const Event& event, DOMWindow* window) { pauseOnNativeEventIfNeeded(instrumentingAgents, listenerEventCategoryType, event.type(), false); int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent(); if (timelineAgent && window->hasEventListeners(event.type())) { timelineAgent->willDispatchEvent(event); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InspectorController* inspectorController, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors) { pauseOnNativeEventIfNeeded(inspectorController, listenerEventCategoryType, event.type(), false); int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent && eventHasListeners(event.type(), window, node, ancestors)) { timelineAgent->willDispatchEvent(event); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }
InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(InspectorController* inspectorController, int timerId) { pauseOnNativeEventIfNeeded(inspectorController, instrumentationEventCategoryType, timerFiredEventName, false); int timelineAgentId = 0; InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController); if (timelineAgent) { timelineAgent->willFireTimer(timerId); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(inspectorController, timelineAgentId); }