Skip to main content

script/dom/xmlhttprequest/
xmlhttprequestupload.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use dom_struct::dom_struct;
6use js::context::JSContext;
7use script_bindings::reflector::reflect_dom_object_with_cx;
8
9use crate::dom::bindings::root::DomRoot;
10use crate::dom::globalscope::GlobalScope;
11use crate::dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
12
13#[dom_struct]
14pub(crate) struct XMLHttpRequestUpload {
15    eventtarget: XMLHttpRequestEventTarget,
16}
17
18impl XMLHttpRequestUpload {
19    fn new_inherited() -> XMLHttpRequestUpload {
20        XMLHttpRequestUpload {
21            eventtarget: XMLHttpRequestEventTarget::new_inherited(),
22        }
23    }
24    pub(crate) fn new(cx: &mut JSContext, global: &GlobalScope) -> DomRoot<XMLHttpRequestUpload> {
25        reflect_dom_object_with_cx(Box::new(XMLHttpRequestUpload::new_inherited()), global, cx)
26    }
27}