Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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_xmlhttprequestupload_h__
7 #define mozilla_dom_workers_xmlhttprequestupload_h__
9 #include "nsXMLHttpRequest.h"
11 BEGIN_WORKERS_NAMESPACE
13 class XMLHttpRequest;
15 class XMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget
16 {
17 nsRefPtr<XMLHttpRequest> mXHR;
19 XMLHttpRequestUpload(XMLHttpRequest* aXHR);
21 ~XMLHttpRequestUpload();
23 public:
24 virtual JSObject*
25 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
27 static already_AddRefed<XMLHttpRequestUpload>
28 Create(XMLHttpRequest* aXHR);
30 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XMLHttpRequestUpload, nsXHREventTarget)
32 NS_DECL_ISUPPORTS_INHERITED
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 }
41 bool
42 HasListeners()
43 {
44 return mListenerManager && mListenerManager->HasListeners();
45 }
46 };
48 END_WORKERS_NAMESPACE
50 #endif // mozilla_dom_workers_xmlhttprequestupload_h__