| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
| 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
| 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 action = XMLHttpRequestProgressEventThrottle::Clear; | 524 action = XMLHttpRequestProgressEventThrottle::Clear; |
| 525 else | 525 else |
| 526 action = XMLHttpRequestProgressEventThrottle::Flush; | 526 action = XMLHttpRequestProgressEventThrottle::Flush; |
| 527 } | 527 } |
| 528 m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(Even
tTypeNames::readystatechange), action); | 528 m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(Even
tTypeNames::readystatechange), action); |
| 529 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", "data", InspectorUpdateCountersEvent::data()); | 529 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", "data", InspectorUpdateCountersEvent::data()); |
| 530 } | 530 } |
| 531 | 531 |
| 532 InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie); | 532 InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie); |
| 533 if (m_state == DONE && !m_error) { | 533 if (m_state == DONE && !m_error) { |
| 534 fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); |
| 534 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "XHRLoad",
"data", InspectorXhrLoadEvent::data(executionContext(), this)); | 535 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "XHRLoad",
"data", InspectorXhrLoadEvent::data(executionContext(), this)); |
| 535 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"
), "CallStack", "stack", InspectorCallStackEvent::currentCallStack()); | 536 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"
), "CallStack", "stack", InspectorCallStackEvent::currentCallStack()); |
| 536 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDi
spatchXHRLoadEvent(executionContext(), this); | 537 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDi
spatchXHRLoadEvent(executionContext(), this); |
| 537 dispatchProgressEventFromSnapshot(EventTypeNames::load); | 538 dispatchProgressEventFromSnapshot(EventTypeNames::load); |
| 538 InspectorInstrumentation::didDispatchXHRLoadEvent(cookie); | 539 InspectorInstrumentation::didDispatchXHRLoadEvent(cookie); |
| 539 | 540 |
| 540 dispatchProgressEventFromSnapshot(EventTypeNames::loadend); | 541 dispatchProgressEventFromSnapshot(EventTypeNames::loadend); |
| 541 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", "data", InspectorUpdateCountersEvent::data()); | 542 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", "data", InspectorUpdateCountersEvent::data()); |
| 542 } | 543 } |
| 543 } | 544 } |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 unsigned long long total = lengthComputable ? static_cast<unsigned long long
>(expectedLength) : 0; | 1056 unsigned long long total = lengthComputable ? static_cast<unsigned long long
>(expectedLength) : 0; |
| 1056 | 1057 |
| 1057 m_progressEventThrottle.dispatchProgressEvent(type, lengthComputable, loaded
, total); | 1058 m_progressEventThrottle.dispatchProgressEvent(type, lengthComputable, loaded
, total); |
| 1058 | 1059 |
| 1059 if (type == EventTypeNames::loadend) | 1060 if (type == EventTypeNames::loadend) |
| 1060 InspectorInstrumentation::didDispatchXHRLoadendEvent(executionContext(),
this); | 1061 InspectorInstrumentation::didDispatchXHRLoadendEvent(executionContext(),
this); |
| 1061 } | 1062 } |
| 1062 | 1063 |
| 1063 void XMLHttpRequest::dispatchProgressEventFromSnapshot(const AtomicString& type) | 1064 void XMLHttpRequest::dispatchProgressEventFromSnapshot(const AtomicString& type) |
| 1064 { | 1065 { |
| 1066 fprintf(stderr, "%s (type = %s)\n", __PRETTY_FUNCTION__, type.utf8().data())
; |
| 1065 dispatchProgressEvent(type, m_receivedLength, m_response.expectedContentLeng
th()); | 1067 dispatchProgressEvent(type, m_receivedLength, m_response.expectedContentLeng
th()); |
| 1066 } | 1068 } |
| 1067 | 1069 |
| 1068 void XMLHttpRequest::handleNetworkError() | 1070 void XMLHttpRequest::handleNetworkError() |
| 1069 { | 1071 { |
| 1070 WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this); | 1072 WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this); |
| 1071 | 1073 |
| 1072 // Response is cleared next, save needed progress event data. | 1074 // Response is cleared next, save needed progress event data. |
| 1073 long long expectedLength = m_response.expectedContentLength(); | 1075 long long expectedLength = m_response.expectedContentLength(); |
| 1074 long long receivedLength = m_receivedLength; | 1076 long long receivedLength = m_receivedLength; |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1666 visitor->trace(m_responseDocument); | 1668 visitor->trace(m_responseDocument); |
| 1667 visitor->trace(m_responseDocumentParser); | 1669 visitor->trace(m_responseDocumentParser); |
| 1668 visitor->trace(m_progressEventThrottle); | 1670 visitor->trace(m_progressEventThrottle); |
| 1669 visitor->trace(m_upload); | 1671 visitor->trace(m_upload); |
| 1670 visitor->trace(m_blobLoader); | 1672 visitor->trace(m_blobLoader); |
| 1671 XMLHttpRequestEventTarget::trace(visitor); | 1673 XMLHttpRequestEventTarget::trace(visitor); |
| 1672 DocumentParserClient::trace(visitor); | 1674 DocumentParserClient::trace(visitor); |
| 1673 } | 1675 } |
| 1674 | 1676 |
| 1675 } // namespace blink | 1677 } // namespace blink |
| OLD | NEW |