dom/activities/src/Activity.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 http://mozilla.org/MPL/2.0/. */
     5 #ifndef mozilla_dom_activities_Activity_h
     6 #define mozilla_dom_activities_Activity_h
     8 #include "DOMRequest.h"
     9 #include "mozilla/dom/BindingDeclarations.h"
    10 #include "mozilla/dom/MozActivityBinding.h"
    11 #include "nsIActivityProxy.h"
    12 #include "mozilla/Preferences.h"
    13 #include "nsPIDOMWindow.h"
    15 namespace mozilla {
    16 namespace dom {
    18 class Activity : public DOMRequest
    19 {
    20 public:
    21   NS_DECL_ISUPPORTS_INHERITED
    22   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(Activity, DOMRequest)
    24   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    26   static already_AddRefed<Activity>
    27   Constructor(const GlobalObject& aOwner,
    28               JSContext* aCx,
    29               const ActivityOptions& aOptions,
    30               ErrorResult& aRv)
    31   {
    32     nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aOwner.GetAsSupports());
    33     if (!window) {
    34       aRv.Throw(NS_ERROR_UNEXPECTED);
    35       return nullptr;
    36     }
    38     nsRefPtr<Activity> activity = new Activity(window);
    39     aRv = activity->Initialize(window, aCx, aOptions);
    40     return activity.forget();
    41   }
    43   Activity(nsPIDOMWindow* aWindow);
    45 protected:
    46   nsresult Initialize(nsPIDOMWindow* aWindow,
    47                       JSContext* aCx,
    48                       const ActivityOptions& aOptions);
    50   nsCOMPtr<nsIActivityProxy> mProxy;
    52   ~Activity();
    53 };
    55 } // namespace dom
    56 } // namespace mozilla
    58 #endif // mozilla_dom_activities_Activity_h

mercurial