OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right reserv
ed. | 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right reserv
ed. |
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtrWillBeRawPtr<E
vent> event) | 95 void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtrWillBeRawPtr<E
vent> event) |
96 { | 96 { |
97 ASSERT(event); | 97 ASSERT(event); |
98 if (m_deferEvents) { | 98 if (m_deferEvents) { |
99 if (m_deferredEvents.size() > 1 && event->type() == EventTypeNames::read
ystatechange && event->type() == m_deferredEvents.last()->type()) { | 99 if (m_deferredEvents.size() > 1 && event->type() == EventTypeNames::read
ystatechange && event->type() == m_deferredEvents.last()->type()) { |
100 // Readystatechange events are state-less so avoid repeating two ide
ntical events in a row on resume. | 100 // Readystatechange events are state-less so avoid repeating two ide
ntical events in a row on resume. |
101 return; | 101 return; |
102 } | 102 } |
103 m_deferredEvents.append(event); | 103 m_deferredEvents.append(event); |
104 } else | 104 } else { |
105 m_target->dispatchEvent(event); | 105 m_target->dispatchEvent(event); |
| 106 } |
106 } | 107 } |
107 | 108 |
108 bool XMLHttpRequestProgressEventThrottle::flushDeferredProgressEvent() | 109 bool XMLHttpRequestProgressEventThrottle::flushDeferredProgressEvent() |
109 { | 110 { |
110 if (m_deferEvents && m_deferredProgressEvent) { | 111 if (m_deferEvents && m_deferredProgressEvent) { |
111 // Move the progress event to the queue, to get it in the right order on
resume. | 112 // Move the progress event to the queue, to get it in the right order on
resume. |
112 m_deferredEvents.append(m_deferredProgressEvent); | 113 m_deferredEvents.append(m_deferredProgressEvent); |
113 m_deferredProgressEvent = nullptr; | 114 m_deferredProgressEvent = nullptr; |
114 return true; | 115 return true; |
115 } | 116 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 217 } |
217 | 218 |
218 void XMLHttpRequestProgressEventThrottle::trace(Visitor* visitor) | 219 void XMLHttpRequestProgressEventThrottle::trace(Visitor* visitor) |
219 { | 220 { |
220 visitor->trace(m_target); | 221 visitor->trace(m_target); |
221 visitor->trace(m_deferredProgressEvent); | 222 visitor->trace(m_deferredProgressEvent); |
222 visitor->trace(m_deferredEvents); | 223 visitor->trace(m_deferredEvents); |
223 } | 224 } |
224 | 225 |
225 } // namespace WebCore | 226 } // namespace WebCore |
OLD | NEW |