1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/glue/nsClassInfoImpl.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,78 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsIClassInfoImpl.h" 1.9 +#include "nsIProgrammingLanguage.h" 1.10 + 1.11 +NS_IMETHODIMP_(MozExternalRefCountType) 1.12 +GenericClassInfo::AddRef() 1.13 +{ 1.14 + return 2; 1.15 +} 1.16 + 1.17 +NS_IMETHODIMP_(MozExternalRefCountType) 1.18 +GenericClassInfo::Release() 1.19 +{ 1.20 + return 1; 1.21 +} 1.22 + 1.23 +NS_IMPL_QUERY_INTERFACE(GenericClassInfo, nsIClassInfo) 1.24 + 1.25 +NS_IMETHODIMP 1.26 +GenericClassInfo::GetInterfaces(uint32_t* countp, nsIID*** array) 1.27 +{ 1.28 + return mData->getinterfaces(countp, array); 1.29 +} 1.30 + 1.31 +NS_IMETHODIMP 1.32 +GenericClassInfo::GetHelperForLanguage(uint32_t language, nsISupports** helper) 1.33 +{ 1.34 + if (mData->getlanguagehelper) 1.35 + return mData->getlanguagehelper(language, helper); 1.36 + return NS_ERROR_NOT_IMPLEMENTED; 1.37 +} 1.38 + 1.39 +NS_IMETHODIMP 1.40 +GenericClassInfo::GetContractID(char** contractid) 1.41 +{ 1.42 + NS_ERROR("GetContractID not implemented"); 1.43 + *contractid = nullptr; 1.44 + return NS_ERROR_NOT_IMPLEMENTED; 1.45 +} 1.46 + 1.47 +NS_IMETHODIMP 1.48 +GenericClassInfo::GetClassDescription(char** description) 1.49 +{ 1.50 + *description = nullptr; 1.51 + return NS_ERROR_NOT_IMPLEMENTED; 1.52 +} 1.53 + 1.54 +NS_IMETHODIMP 1.55 +GenericClassInfo::GetClassID(nsCID** classid) 1.56 +{ 1.57 + NS_ERROR("GetClassID not implemented"); 1.58 + *classid = nullptr; 1.59 + return NS_ERROR_NOT_IMPLEMENTED; 1.60 +} 1.61 + 1.62 +NS_IMETHODIMP 1.63 +GenericClassInfo::GetImplementationLanguage(uint32_t* language) 1.64 +{ 1.65 + *language = nsIProgrammingLanguage::CPLUSPLUS; 1.66 + return NS_OK; 1.67 +} 1.68 + 1.69 +NS_IMETHODIMP 1.70 +GenericClassInfo::GetFlags(uint32_t* flags) 1.71 +{ 1.72 + *flags = mData->flags; 1.73 + return NS_OK; 1.74 +} 1.75 + 1.76 +NS_IMETHODIMP 1.77 +GenericClassInfo::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) 1.78 +{ 1.79 + *aClassIDNoAlloc = mData->cid; 1.80 + return NS_OK; 1.81 +}