dom/mobileconnection/src/MobileConnectionArray.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_dom_network_MobileConnectionArray_h__
     8 #define mozilla_dom_network_MobileConnectionArray_h__
    10 #include "nsWrapperCache.h"
    11 #include "mozilla/dom/MobileConnection.h"
    13 class nsIDOMMozMobileConnection;
    15 namespace mozilla {
    16 namespace dom {
    18 class MobileConnectionArray MOZ_FINAL : public nsISupports,
    19                                         public nsWrapperCache
    20 {
    21 public:
    22   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    23   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MobileConnectionArray)
    25   MobileConnectionArray(nsPIDOMWindow* aWindow);
    27   nsPIDOMWindow*
    28   GetParentObject() const;
    30   // WrapperCache
    31   virtual JSObject*
    32   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    34   //  WebIDL
    35   nsIDOMMozMobileConnection*
    36   Item(uint32_t aIndex);
    38   uint32_t
    39   Length() const;
    41   nsIDOMMozMobileConnection*
    42   IndexedGetter(uint32_t aIndex, bool& aFound);
    44 private:
    45   ~MobileConnectionArray();
    47   void
    48   Init();
    50   void
    51   DropConnections();
    53   bool mInitialized;
    55   nsCOMPtr<nsPIDOMWindow> mWindow;
    56   nsTArray<nsRefPtr<MobileConnection>> mMobileConnections;
    57 };
    59 } // namespace dom
    60 } // namespace mozilla
    62 #endif // mozilla_dom_network_MobileConnectionArray_h__

mercurial