|
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/. */ |
|
5 |
|
6 #ifndef mozilla_dom_workers_xmlhttprequestupload_h__ |
|
7 #define mozilla_dom_workers_xmlhttprequestupload_h__ |
|
8 |
|
9 #include "nsXMLHttpRequest.h" |
|
10 |
|
11 BEGIN_WORKERS_NAMESPACE |
|
12 |
|
13 class XMLHttpRequest; |
|
14 |
|
15 class XMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget |
|
16 { |
|
17 nsRefPtr<XMLHttpRequest> mXHR; |
|
18 |
|
19 XMLHttpRequestUpload(XMLHttpRequest* aXHR); |
|
20 |
|
21 ~XMLHttpRequestUpload(); |
|
22 |
|
23 public: |
|
24 virtual JSObject* |
|
25 WrapObject(JSContext* aCx) MOZ_OVERRIDE; |
|
26 |
|
27 static already_AddRefed<XMLHttpRequestUpload> |
|
28 Create(XMLHttpRequest* aXHR); |
|
29 |
|
30 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XMLHttpRequestUpload, nsXHREventTarget) |
|
31 |
|
32 NS_DECL_ISUPPORTS_INHERITED |
|
33 |
|
34 nsISupports* |
|
35 GetParentObject() const |
|
36 { |
|
37 // There's only one global on a worker, so we don't need to specify. |
|
38 return nullptr; |
|
39 } |
|
40 |
|
41 bool |
|
42 HasListeners() |
|
43 { |
|
44 return mListenerManager && mListenerManager->HasListeners(); |
|
45 } |
|
46 }; |
|
47 |
|
48 END_WORKERS_NAMESPACE |
|
49 |
|
50 #endif // mozilla_dom_workers_xmlhttprequestupload_h__ |