bug 812562 - click-to-play: reshow notification for blocklisted plugins r=jaws
[gecko.git] / xpcom / ds / nsArray.h
blob8e308bdda6e25e16bc0fbc354ddc0f1cd537bf94
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsArray_h__
7 #define nsArray_h__
9 #include "nsIMutableArray.h"
10 #include "nsCOMArray.h"
11 #include "nsCOMPtr.h"
12 #include "nsCycleCollectionParticipant.h"
13 #include "mozilla/Attributes.h"
15 #define NS_ARRAY_CLASSNAME \
16 "nsIArray implementation"
18 // {35C66FD1-95E9-4e0a-80C5-C3BD2B375481}
19 #define NS_ARRAY_CID \
20 { 0x35c66fd1, 0x95e9, 0x4e0a, \
21 { 0x80, 0xc5, 0xc3, 0xbd, 0x2b, 0x37, 0x54, 0x81 } }
23 class nsArray : public nsIMutableArray
25 public:
26 NS_DECL_ISUPPORTS
27 NS_DECL_NSIARRAY
28 NS_DECL_NSIMUTABLEARRAY
30 /* Both of these factory functions create a cycle-collectable array
31 on the main thread and a non-cycle-collectable array on other
32 threads. */
33 static already_AddRefed<nsIMutableArray> Create();
34 /* Only for the benefit of the XPCOM module system, use Create()
35 instead. */
36 static nsresult XPCOMConstructor(nsISupports* aOuter, const nsIID& aIID,
37 void** aResult);
38 protected:
39 nsArray() { }
40 nsArray(const nsArray& other);
41 nsArray(const nsCOMArray_base& aBaseArray) : mArray(aBaseArray)
42 { }
44 virtual ~nsArray(); // nsArrayCC inherits from this
46 nsCOMArray_base mArray;
49 class nsArrayCC MOZ_FINAL : public nsArray
51 friend class nsArray;
53 public:
54 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
55 NS_DECL_CYCLE_COLLECTION_CLASS(nsArrayCC)
57 private:
58 nsArrayCC() : nsArray() { }
59 nsArrayCC(const nsArrayCC& other);
60 nsArrayCC(const nsCOMArray_base& aBaseArray) : nsArray(aBaseArray)
61 { }
64 #endif