#define XMLHttpRequestProgressEventThrottle_h
#include "platform/Timer.h"
+#include "platform/heap/Handle.h"
#include "wtf/PassRefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/AtomicString.h"
// This implements the XHR2 progress event dispatching: "dispatch a progress event called progress
// about every 50ms or for every byte received, whichever is least frequent".
class XMLHttpRequestProgressEventThrottle FINAL : public TimerBase {
+ DISALLOW_ALLOCATION();
public:
explicit XMLHttpRequestProgressEventThrottle(EventTarget*);
virtual ~XMLHttpRequestProgressEventThrottle();
void dispatchProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total);
- void dispatchReadyStateChangeEvent(PassRefPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent);
- void dispatchEvent(PassRefPtr<Event>);
+ void dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent);
+ void dispatchEvent(PassRefPtrWillBeRawPtr<Event>);
void dispatchEventAndLoadEnd(const AtomicString&, bool, unsigned long long, unsigned long long);
void suspend();
void resume();
+ void trace(Visitor*);
+
private:
static const double minimumProgressEventDispatchingIntervalInSeconds;
unsigned long long m_total;
bool m_deferEvents;
- RefPtr<Event> m_deferredProgressEvent;
- Vector<RefPtr<Event> > m_deferredEvents;
+ RefPtrWillBeMember<Event> m_deferredProgressEvent;
+ WillBeHeapVector<RefPtrWillBeMember<Event> > m_deferredEvents;
Timer<XMLHttpRequestProgressEventThrottle> m_dispatchDeferredEventsTimer;
};