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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 return xmlHttpRequest; | 201 return xmlHttpRequest; |
202 } | 202 } |
203 | 203 |
204 XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri
gin> isolatedWorldSecurityOrigin) | 204 XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri
gin> isolatedWorldSecurityOrigin) |
205 : ActiveDOMObject(context) | 205 : ActiveDOMObject(context) |
206 , m_timeoutMilliseconds(0) | 206 , m_timeoutMilliseconds(0) |
207 , m_state(UNSENT) | 207 , m_state(UNSENT) |
208 , m_lengthDownloadedToFile(0) | 208 , m_lengthDownloadedToFile(0) |
209 , m_receivedLength(0) | 209 , m_receivedLength(0) |
210 , m_exceptionCode(0) | 210 , m_exceptionCode(0) |
211 , m_progressEventThrottle(XMLHttpRequestProgressEventThrottle::create(this)) | 211 , m_progressEventThrottle(ProgressEventThrottle::create(this)) |
212 , m_responseTypeCode(ResponseTypeDefault) | 212 , m_responseTypeCode(ResponseTypeDefault) |
213 , m_isolatedWorldSecurityOrigin(isolatedWorldSecurityOrigin) | 213 , m_isolatedWorldSecurityOrigin(isolatedWorldSecurityOrigin) |
214 , m_eventDispatchRecursionLevel(0) | 214 , m_eventDispatchRecursionLevel(0) |
215 , m_async(true) | 215 , m_async(true) |
216 , m_includeCredentials(false) | 216 , m_includeCredentials(false) |
217 , m_parsedResponse(false) | 217 , m_parsedResponse(false) |
218 , m_error(false) | 218 , m_error(false) |
219 , m_uploadEventsAllowed(true) | 219 , m_uploadEventsAllowed(true) |
220 , m_uploadComplete(false) | 220 , m_uploadComplete(false) |
221 , m_sameOriginRequest(true) | 221 , m_sameOriginRequest(true) |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } | 499 } |
500 | 500 |
501 void XMLHttpRequest::dispatchReadyStateChangeEvent() | 501 void XMLHttpRequest::dispatchReadyStateChangeEvent() |
502 { | 502 { |
503 if (!executionContext()) | 503 if (!executionContext()) |
504 return; | 504 return; |
505 | 505 |
506 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); | 506 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); |
507 if (m_async || (m_state <= OPENED || m_state == DONE)) { | 507 if (m_async || (m_state <= OPENED || m_state == DONE)) { |
508 TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", Inspect
orXhrReadyStateChangeEvent::data(executionContext(), this)); | 508 TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", Inspect
orXhrReadyStateChangeEvent::data(executionContext(), this)); |
509 XMLHttpRequestProgressEventThrottle::DeferredEventAction action = XMLHtt
pRequestProgressEventThrottle::Ignore; | 509 ProgressEventThrottle::DeferredEventAction action = ProgressEventThrottl
e::Ignore; |
510 if (m_state == DONE) { | 510 if (m_state == DONE) { |
511 if (m_error) | 511 if (m_error) |
512 action = XMLHttpRequestProgressEventThrottle::Clear; | 512 action = ProgressEventThrottle::Clear; |
513 else | 513 else |
514 action = XMLHttpRequestProgressEventThrottle::Flush; | 514 action = ProgressEventThrottle::Flush; |
515 } | 515 } |
516 m_progressEventThrottle->dispatchReadyStateChangeEvent(Event::create(Eve
ntTypeNames::readystatechange), action); | 516 m_progressEventThrottle->dispatchReadyStateChangeEvent(Event::create(Eve
ntTypeNames::readystatechange), action); |
517 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::d
ata()); | 517 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::d
ata()); |
518 } | 518 } |
519 | 519 |
520 if (m_state == DONE && !m_error) { | 520 if (m_state == DONE && !m_error) { |
521 TRACE_EVENT1("devtools.timeline", "XHRLoad", "data", InspectorXhrLoadEve
nt::data(executionContext(), this)); | 521 TRACE_EVENT1("devtools.timeline", "XHRLoad", "data", InspectorXhrLoadEve
nt::data(executionContext(), this)); |
522 dispatchProgressEventFromSnapshot(EventTypeNames::load); | 522 dispatchProgressEventFromSnapshot(EventTypeNames::load); |
523 dispatchProgressEventFromSnapshot(EventTypeNames::loadend); | 523 dispatchProgressEventFromSnapshot(EventTypeNames::loadend); |
524 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::d
ata()); | 524 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up
dateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::d
ata()); |
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 visitor->trace(m_responseDocumentParser); | 1704 visitor->trace(m_responseDocumentParser); |
1705 visitor->trace(m_progressEventThrottle); | 1705 visitor->trace(m_progressEventThrottle); |
1706 visitor->trace(m_upload); | 1706 visitor->trace(m_upload); |
1707 visitor->trace(m_blobLoader); | 1707 visitor->trace(m_blobLoader); |
1708 XMLHttpRequestEventTarget::trace(visitor); | 1708 XMLHttpRequestEventTarget::trace(visitor); |
1709 DocumentParserClient::trace(visitor); | 1709 DocumentParserClient::trace(visitor); |
1710 ActiveDOMObject::trace(visitor); | 1710 ActiveDOMObject::trace(visitor); |
1711 } | 1711 } |
1712 | 1712 |
1713 } // namespace blink | 1713 } // namespace blink |
OLD | NEW |