Line data Source code
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/. */
6 :
7 : #include "nsIClassInfoImpl.h"
8 :
9 : NS_IMETHODIMP_(MozExternalRefCountType)
10 4569 : GenericClassInfo::AddRef()
11 : {
12 4569 : return 2;
13 : }
14 :
15 : NS_IMETHODIMP_(MozExternalRefCountType)
16 3893 : GenericClassInfo::Release()
17 : {
18 3893 : return 1;
19 : }
20 :
21 3889 : NS_IMPL_QUERY_INTERFACE(GenericClassInfo, nsIClassInfo)
22 :
23 : NS_IMETHODIMP
24 22 : GenericClassInfo::GetInterfaces(uint32_t* aCount, nsIID*** aArray)
25 : {
26 22 : return mData->getinterfaces(aCount, aArray);
27 : }
28 :
29 : NS_IMETHODIMP
30 3213 : GenericClassInfo::GetScriptableHelper(nsIXPCScriptable** aHelper)
31 : {
32 3213 : if (mData->getscriptablehelper) {
33 1273 : return mData->getscriptablehelper(aHelper);
34 : }
35 1940 : return NS_ERROR_NOT_IMPLEMENTED;
36 : }
37 :
38 : NS_IMETHODIMP
39 0 : GenericClassInfo::GetContractID(char** aContractID)
40 : {
41 0 : NS_ERROR("GetContractID not implemented");
42 0 : *aContractID = nullptr;
43 0 : return NS_ERROR_NOT_IMPLEMENTED;
44 : }
45 :
46 : NS_IMETHODIMP
47 0 : GenericClassInfo::GetClassDescription(char** aDescription)
48 : {
49 0 : *aDescription = nullptr;
50 0 : return NS_ERROR_NOT_IMPLEMENTED;
51 : }
52 :
53 : NS_IMETHODIMP
54 0 : GenericClassInfo::GetClassID(nsCID** aClassID)
55 : {
56 0 : NS_ERROR("GetClassID not implemented");
57 0 : *aClassID = nullptr;
58 0 : return NS_ERROR_NOT_IMPLEMENTED;
59 : }
60 :
61 : NS_IMETHODIMP
62 4645 : GenericClassInfo::GetFlags(uint32_t* aFlags)
63 : {
64 4645 : *aFlags = mData->flags;
65 4645 : return NS_OK;
66 : }
67 :
68 : NS_IMETHODIMP
69 4 : GenericClassInfo::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc)
70 : {
71 4 : *aClassIDNoAlloc = mData->cid;
72 4 : return NS_OK;
73 9 : }
|