1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_workers_xmlhttprequesteventtarget_h__
7 #define mozilla_dom_workers_xmlhttprequesteventtarget_h__
9 #include "mozilla/dom/workers/bindings/EventTarget.h"
11 BEGIN_WORKERS_NAMESPACE
13 class XMLHttpRequestEventTarget
: public EventTarget
16 XMLHttpRequestEventTarget(JSContext
* aCx
)
20 virtual ~XMLHttpRequestEventTarget()
25 _trace(JSTracer
* aTrc
) MOZ_OVERRIDE
;
28 _finalize(JSFreeOp
* aFop
) MOZ_OVERRIDE
;
30 #define IMPL_GETTER_AND_SETTER(_type) \
32 GetOn##_type(JSContext* /* unused */, ErrorResult& aRv) \
34 return GetEventListener(NS_LITERAL_STRING(#_type), aRv); \
38 SetOn##_type(JSContext* /* unused */, JS::Handle<JSObject*> aListener, \
41 SetEventListener(NS_LITERAL_STRING(#_type), aListener, aRv); \
44 IMPL_GETTER_AND_SETTER(loadstart
)
45 IMPL_GETTER_AND_SETTER(progress
)
46 IMPL_GETTER_AND_SETTER(abort
)
47 IMPL_GETTER_AND_SETTER(error
)
48 IMPL_GETTER_AND_SETTER(load
)
49 IMPL_GETTER_AND_SETTER(timeout
)
50 IMPL_GETTER_AND_SETTER(loadend
)
52 #undef IMPL_GETTER_AND_SETTER
57 #endif // mozilla_dom_workers_xmlhttprequesteventtarget_h__