#ifndef XMLHttpRequestUpload_h
#define XMLHttpRequestUpload_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/events/EventListener.h"
#include "core/xml/XMLHttpRequest.h"
#include "core/xml/XMLHttpRequestEventTarget.h"
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/AtomicStringHash.h"
namespace WebCore {
class ExecutionContext;
class XMLHttpRequest;
class XMLHttpRequestUpload FINAL : public ScriptWrappable, public XMLHttpRequestEventTarget {
public:
static PassOwnPtr<XMLHttpRequestUpload> create(XMLHttpRequest* xmlHttpRequest)
{
return adoptPtr(new XMLHttpRequestUpload(xmlHttpRequest));
}
void ref() { m_xmlHttpRequest->ref(); }
void deref() { m_xmlHttpRequest->deref(); }
XMLHttpRequest* xmlHttpRequest() const { return m_xmlHttpRequest; }
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual ExecutionContext* executionContext() const OVERRIDE;
void dispatchEventAndLoadEnd(const AtomicString&, bool, unsigned long long, unsigned long long);
void dispatchProgressEvent(unsigned long long, unsigned long long);
void handleRequestError(const AtomicString&);
private:
explicit XMLHttpRequestUpload(XMLHttpRequest*);
virtual void refEventTarget() OVERRIDE { ref(); }
virtual void derefEventTarget() OVERRIDE { deref(); }
XMLHttpRequest* m_xmlHttpRequest;
EventTargetData m_eventTargetData;
unsigned long long m_lastBytesSent;
unsigned long long m_lastTotalBytesToBeSent;
};
}
#endif