dom/workers/XMLHttpRequestUpload.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/workers/XMLHttpRequestUpload.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef mozilla_dom_workers_xmlhttprequestupload_h__
    1.10 +#define mozilla_dom_workers_xmlhttprequestupload_h__
    1.11 +
    1.12 +#include "nsXMLHttpRequest.h"
    1.13 +
    1.14 +BEGIN_WORKERS_NAMESPACE
    1.15 +
    1.16 +class XMLHttpRequest;
    1.17 +
    1.18 +class XMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget
    1.19 +{
    1.20 +  nsRefPtr<XMLHttpRequest> mXHR;
    1.21 +
    1.22 +  XMLHttpRequestUpload(XMLHttpRequest* aXHR);
    1.23 +
    1.24 +  ~XMLHttpRequestUpload();
    1.25 +
    1.26 +public:
    1.27 +  virtual JSObject*
    1.28 +  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    1.29 +
    1.30 +  static already_AddRefed<XMLHttpRequestUpload>
    1.31 +  Create(XMLHttpRequest* aXHR);
    1.32 +
    1.33 +  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XMLHttpRequestUpload, nsXHREventTarget)
    1.34 +
    1.35 +  NS_DECL_ISUPPORTS_INHERITED
    1.36 +
    1.37 +  nsISupports*
    1.38 +  GetParentObject() const
    1.39 +  {
    1.40 +    // There's only one global on a worker, so we don't need to specify.
    1.41 +    return nullptr;
    1.42 +  }
    1.43 +
    1.44 +  bool
    1.45 +  HasListeners()
    1.46 +  {
    1.47 +    return mListenerManager && mListenerManager->HasListeners();
    1.48 +  }
    1.49 +};
    1.50 +
    1.51 +END_WORKERS_NAMESPACE
    1.52 +
    1.53 +#endif // mozilla_dom_workers_xmlhttprequestupload_h__

mercurial