diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp index ca48d8d..87a6540 100644 --- a/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp @@ -33,6 +33,7 @@ #include "EventNames.h" #include "File.h" #include "HTTPParsers.h" +#include "InspectorTimelineAgent.h" #include "ResourceError.h" #include "ResourceRequest.h" #include "SecurityOrigin.h" @@ -47,7 +48,9 @@ #include <wtf/RefCountedLeakCounter.h> #if USE(JSC) +#include "JSDOMBinding.h" #include "JSDOMWindow.h" +#include <runtime/Protect.h> #endif namespace WebCore { @@ -248,10 +251,32 @@ void XMLHttpRequest::callReadyStateChangeListener() if (!scriptExecutionContext()) return; +#if ENABLE(INSPECTOR) + InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext()); + if (timelineAgent) + timelineAgent->willChangeXHRReadyState(m_url.string(), m_state); +#endif + dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent)); - if (m_state == DONE && !m_error) +#if ENABLE(INSPECTOR) + if (timelineAgent) + timelineAgent->didChangeXHRReadyState(); +#endif + + if (m_state == DONE && !m_error) { +#if ENABLE(INSPECTOR) + if (timelineAgent) + timelineAgent->willLoadXHR(m_url.string()); +#endif + dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent)); + +#if ENABLE(INSPECTOR) + if (timelineAgent) + timelineAgent->didLoadXHR(); +#endif + } } void XMLHttpRequest::setWithCredentials(bool value, ExceptionCode& ec) @@ -604,10 +629,8 @@ void XMLHttpRequest::dropProtection() // out. But it is protected from GC while loading, so this // can't be recouped until the load is done, so only // report the extra cost at that point. - - if (JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext())) - if (DOMObject* wrapper = getCachedDOMObjectWrapper(*globalObject->globalData(), this)) - JSC::Heap::heap(wrapper)->reportExtraMemoryCost(m_responseText.size() * 2); + if (DOMObject* wrapper = getCachedDOMObjectWrapper(*scriptExecutionContext()->globalData(), this)) + JSC::Heap::heap(wrapper)->reportExtraMemoryCost(m_responseText.size() * 2); #endif unsetPendingActivity(this); |