- Converting to nsGenericModule and nsGenericFactory

- Using NS_IMPL_ISUPPORTS[0-9]
- Removing exported NS_New*() functions
- Moving the implementation definitions to their headers
r=morse@Netscape.com
This commit is contained in:
dp%netscape.com 1999-11-21 05:29:16 +00:00
parent a755d7cc0f
commit 9551c4aee8
12 changed files with 37 additions and 513 deletions

View File

@ -32,6 +32,13 @@ IS_COMPONENT = 1
CPPSRCS = nsWalletViewerFactory.cpp CPPSRCS = nsWalletViewerFactory.cpp
LOCAL_INCLUDES = \
-I$(srcdir)/../cookieviewer \
-I$(srcdir)/../editor \
-I$(srcdir)/../signonviewer \
-I$(srcdir)/../walletpreview \
$(NULL)
SHARED_LIBRARY_LIBS = \ SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libcookieviewer_s.a \ $(DIST)/lib/libcookieviewer_s.a \
$(DIST)/lib/libsignonviewer_s.a \ $(DIST)/lib/libsignonviewer_s.a \

View File

@ -27,7 +27,10 @@ MODULE = walletviewers
LIBNAME = .\$(OBJDIR)\wlltvwrs LIBNAME = .\$(OBJDIR)\wlltvwrs
DLL = $(LIBNAME).dll DLL = $(LIBNAME).dll
LINCS = \ LINCS = -I..\cookieviewer \
-I..\editor \
-I..\signonviewer \
-I..\walletpreview \
$(NULL) $(NULL)
CPP_OBJS = \ CPP_OBJS = \

View File

@ -24,377 +24,27 @@
#include "nsIModule.h" #include "nsIModule.h"
#include "nsIGenericFactory.h" #include "nsIGenericFactory.h"
#include "nsIWalletPreview.h" #include "nsWalletPreview.h"
#include "nsISignonViewer.h" #include "nsSignonViewer.h"
#include "nsICookieViewer.h" #include "nsCookieViewer.h"
#include "nsIWalletEditor.h" #include "nsWalletEditor.h"
static NS_DEFINE_CID(kWalletPreviewCID, NS_WALLETPREVIEW_CID); NS_GENERIC_FACTORY_CONSTRUCTOR(WalletPreviewImpl)
static NS_DEFINE_CID(kSignonViewerCID, NS_SIGNONVIEWER_CID); NS_GENERIC_FACTORY_CONSTRUCTOR(SignonViewerImpl)
static NS_DEFINE_CID(kCookieViewerCID, NS_COOKIEVIEWER_CID); NS_GENERIC_FACTORY_CONSTRUCTOR(CookieViewerImpl)
static NS_DEFINE_CID(kWalletEditorCID, NS_WALLETEDITOR_CID); NS_GENERIC_FACTORY_CONSTRUCTOR(WalletEditorImpl)
// Module implementation
class nsWalletViewerModule : public nsIModule
{
public:
nsWalletViewerModule();
virtual ~nsWalletViewerModule();
NS_DECL_ISUPPORTS
NS_DECL_NSIMODULE
protected:
nsresult Initialize();
void Shutdown();
PRBool mInitialized;
nsCOMPtr<nsIGenericFactory> mWalletPreviewFactory;
nsCOMPtr<nsIGenericFactory> mSignonViewerFactory;
nsCOMPtr<nsIGenericFactory> mCookieViewerFactory;
nsCOMPtr<nsIGenericFactory> mWalletEditorFactory;
};
//----------------------------------------------------------------------
// Functions used to create new instances of a given object by the
// generic factory.
static NS_IMETHODIMP
CreateNewWalletPreview(nsISupports* aOuter, REFNSIID aIID, void **aResult)
{
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nsnull;
return NS_ERROR_NO_AGGREGATION;
}
nsIWalletPreview* inst = nsnull;
nsresult rv = NS_NewWalletPreview(&inst);
if (NS_FAILED(rv)) {
*aResult = nsnull;
return rv;
}
rv = inst->QueryInterface(aIID, aResult);
if (NS_FAILED(rv)) {
*aResult = nsnull;
}
NS_RELEASE(inst); /* get rid of extra refcnt */
return rv;
}
static NS_IMETHODIMP
CreateNewSignonViewer(nsISupports* aOuter, REFNSIID aIID, void **aResult)
{
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nsnull;
return NS_ERROR_NO_AGGREGATION;
}
nsISignonViewer* inst = nsnull;
nsresult rv = NS_NewSignonViewer(&inst);
if (NS_FAILED(rv)) {
*aResult = nsnull;
return rv;
}
rv = inst->QueryInterface(aIID, aResult);
if (NS_FAILED(rv)) {
*aResult = nsnull;
}
NS_RELEASE(inst); /* get rid of extra refcnt */
return rv;
}
static NS_IMETHODIMP
CreateNewCookieViewer(nsISupports* aOuter, REFNSIID aIID, void **aResult)
{
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nsnull;
return NS_ERROR_NO_AGGREGATION;
}
nsICookieViewer* inst = nsnull;
nsresult rv = NS_NewCookieViewer(&inst);
if (NS_FAILED(rv)) {
*aResult = nsnull;
return rv;
}
rv = inst->QueryInterface(aIID, aResult);
if (NS_FAILED(rv)) {
*aResult = nsnull;
}
NS_RELEASE(inst); /* get rid of extra refcnt */
return rv;
}
static NS_IMETHODIMP
CreateNewWalletEditor(nsISupports* aOuter, REFNSIID aIID, void **aResult)
{
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
if (aOuter) {
*aResult = nsnull;
return NS_ERROR_NO_AGGREGATION;
}
nsIWalletEditor* inst = nsnull;
nsresult rv = NS_NewWalletEditor(&inst);
if (NS_FAILED(rv)) {
*aResult = nsnull;
return rv;
}
rv = inst->QueryInterface(aIID, aResult);
if (NS_FAILED(rv)) {
*aResult = nsnull;
}
NS_RELEASE(inst); /* get rid of extra refcnt */
return rv;
}
//----------------------------------------------------------------------
nsWalletViewerModule::nsWalletViewerModule()
: mInitialized(PR_FALSE)
{
NS_INIT_ISUPPORTS();
}
nsWalletViewerModule::~nsWalletViewerModule()
{
Shutdown();
}
NS_IMPL_ISUPPORTS(nsWalletViewerModule, NS_GET_IID(nsIModule))
// Perform our one-time intialization for this module
nsresult
nsWalletViewerModule::Initialize()
{
if (mInitialized) {
return NS_OK;
}
mInitialized = PR_TRUE;
return NS_OK;
}
// Shutdown this module, releasing all of the module resources
void
nsWalletViewerModule::Shutdown()
{
// Release the factory objects
mWalletPreviewFactory = nsnull;
mSignonViewerFactory = nsnull;
mCookieViewerFactory = nsnull;
mWalletEditorFactory = nsnull;
}
// Create a factory object for creating instances of aClass.
NS_IMETHODIMP
nsWalletViewerModule::GetClassObject(nsIComponentManager *aCompMgr,
const nsCID& aClass,
const nsIID& aIID,
void** r_classObj)
{
nsresult rv;
// Defensive programming: Initialize *r_classObj in case of error below
if (!r_classObj) {
return NS_ERROR_INVALID_POINTER;
}
*r_classObj = NULL;
// Do one-time-only initialization if necessary
if (!mInitialized) {
rv = Initialize();
if (NS_FAILED(rv)) {
// Initialization failed! yikes!
return rv;
}
}
// Choose the appropriate factory, based on the desired instance
// class type (aClass).
nsCOMPtr<nsIGenericFactory> fact;
if (aClass.Equals(kWalletPreviewCID)) {
if (!mWalletPreviewFactory) {
// Create and save away the factory object for creating
// new instances of WalletPreview. This way if we are called
// again for the factory, we won't need to create a new
// one.
rv = NS_NewGenericFactory(getter_AddRefs(mWalletPreviewFactory),
CreateNewWalletPreview);
}
fact = mWalletPreviewFactory;
}
else if (aClass.Equals(kSignonViewerCID)) {
if (!mSignonViewerFactory) {
// Create and save away the factory object for creating
// new instances of SignonViewer. This way if we are called
// again for the factory, we won't need to create a new
// one.
rv = NS_NewGenericFactory(getter_AddRefs(mSignonViewerFactory),
CreateNewSignonViewer);
}
fact = mSignonViewerFactory;
}
else if (aClass.Equals(kCookieViewerCID)) {
if (!mCookieViewerFactory) {
// Create and save away the factory object for creating
// new instances of CookieViewer. This way if we are called
// again for the factory, we won't need to create a new
// one.
rv = NS_NewGenericFactory(getter_AddRefs(mCookieViewerFactory),
CreateNewCookieViewer);
}
fact = mCookieViewerFactory;
}
else if (aClass.Equals(kWalletEditorCID)) {
if (!mWalletEditorFactory) {
// Create and save away the factory object for creating
// new instances of WalletEditor. This way if we are called
// again for the factory, we won't need to create a new
// one.
rv = NS_NewGenericFactory(getter_AddRefs(mWalletEditorFactory),
CreateNewWalletEditor);
}
fact = mWalletEditorFactory;
}
else {
rv = NS_ERROR_FACTORY_NOT_REGISTERED;
#ifdef DEBUG
char* cs = aClass.ToString();
printf("+++ nsWalletViewerModule: unable to create factory for %s\n", cs);
nsCRT::free(cs);
#endif
}
if (fact) {
rv = fact->QueryInterface(aIID, r_classObj);
}
return rv;
}
//----------------------------------------
struct Components {
const char* mDescription;
const nsID* mCID;
const char* mProgID;
};
// The list of components we register // The list of components we register
static Components gComponents[] = { static nsModuleComponentInfo components[] = {
{ "WalletPreview World Component", &kWalletPreviewCID, { "WalletPreview World Component", NS_WALLETPREVIEW_CID,
"component://netscape/walletpreview/walletpreview-world", }, "component://netscape/walletpreview/walletpreview-world", WalletPreviewImplConstructor },
{ "SignonViewer World Component", &kSignonViewerCID, { "SignonViewer World Component", NS_SIGNONVIEWER_CID,
"component://netscape/signonviewer/signonviewer-world", }, "component://netscape/signonviewer/signonviewer-world", SignonViewerImplConstructor },
{ "CookieViewer World Component", &kCookieViewerCID, { "CookieViewer World Component", NS_COOKIEVIEWER_CID,
"component://netscape/cookieviewer/cookieviewer-world", }, "component://netscape/cookieviewer/cookieviewer-world", CookieViewerImplConstructor },
{ "WalletEditor World Component", &kWalletEditorCID, { "WalletEditor World Component", NS_WALLETEDITOR_CID,
"component://netscape/walleteditor/walleteditor-world", }, "component://netscape/walleteditor/walleteditor-world", WalletEditorImplConstructor },
}; };
#define NUM_COMPONENTS (sizeof(gComponents) / sizeof(gComponents[0]))
NS_IMETHODIMP NS_IMPL_NSGETMODULE("nsWalletViewerModule", components)
nsWalletViewerModule::RegisterSelf(nsIComponentManager *aCompMgr,
nsIFileSpec* aPath,
const char* registryLocation,
const char* componentType)
{
nsresult rv = NS_OK;
#ifdef DEBUG
printf("*** Registering walletviewer components\n");
#endif
Components* cp = gComponents;
Components* end = cp + NUM_COMPONENTS;
while (cp < end) {
rv = aCompMgr->RegisterComponentSpec(*cp->mCID, cp->mDescription,
cp->mProgID, aPath, PR_TRUE,
PR_TRUE);
if (NS_FAILED(rv)) {
#ifdef DEBUG
printf("nsWalletViewerModule: unable to register %s component => %x\n",
cp->mDescription, rv);
#endif
break;
}
cp++;
}
return rv;
}
NS_IMETHODIMP
nsWalletViewerModule::UnregisterSelf(nsIComponentManager* aCompMgr,
nsIFileSpec* aPath,
const char* registryLocation)
{
#ifdef DEBUG
printf("*** Unregistering walletviewer components\n");
#endif
Components* cp = gComponents;
Components* end = cp + NUM_COMPONENTS;
while (cp < end) {
nsresult rv = aCompMgr->UnregisterComponentSpec(*cp->mCID, aPath);
if (NS_FAILED(rv)) {
#ifdef DEBUG
printf("nsWalletViewerModule: unable to unregister %s component => %x\n",
cp->mDescription, rv);
#endif
}
cp++;
}
return NS_OK;
}
NS_IMETHODIMP
nsWalletViewerModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
{
if (!okToUnload) {
return NS_ERROR_INVALID_POINTER;
}
*okToUnload = PR_FALSE;
return NS_ERROR_FAILURE;
}
//----------------------------------------------------------------------
static nsWalletViewerModule *gModule = NULL;
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
nsIFileSpec* location,
nsIModule** return_cobj)
{
nsresult rv = NS_OK;
NS_ENSURE_ARG_POINTER(return_cobj);
NS_ENSURE_FALSE(gModule, NS_ERROR_FAILURE);
// Create and initialize the module instance
nsWalletViewerModule *m = new nsWalletViewerModule();
if (!m) {
return NS_ERROR_OUT_OF_MEMORY;
}
// Increase refcnt and store away nsIModule interface to m in return_cobj
rv = m->QueryInterface(NS_GET_IID(nsIModule), (void**)return_cobj);
if (NS_FAILED(rv)) {
delete m;
m = nsnull;
}
gModule = m; // WARNING: Weak Reference
return rv;
}

View File

@ -31,41 +31,10 @@
#include "nsIWebShell.h" #include "nsIWebShell.h"
#include "nsIWebShellWindow.h" #include "nsIWebShellWindow.h"
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsICookieViewer.h" #include "nsCookieViewer.h"
static NS_DEFINE_IID(kICookieServiceIID, NS_ICOOKIESERVICE_IID);
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID); static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
class CookieViewerImpl : public nsICookieViewer
{
public:
CookieViewerImpl();
virtual ~CookieViewerImpl();
// nsISupports interface
NS_DECL_ISUPPORTS
// nsICookieViewer interface
NS_DECL_NSICOOKIEVIEWER
};
////////////////////////////////////////////////////////////////////////
nsresult
NS_NewCookieViewer(nsICookieViewer** aCookieViewer)
{
NS_PRECONDITION(aCookieViewer != nsnull, "null ptr");
if (!aCookieViewer) {
return NS_ERROR_NULL_POINTER;
}
*aCookieViewer = new CookieViewerImpl();
if (! *aCookieViewer) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(*aCookieViewer);
return NS_OK;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
CookieViewerImpl::CookieViewerImpl() CookieViewerImpl::CookieViewerImpl()
@ -77,7 +46,7 @@ CookieViewerImpl::~CookieViewerImpl()
{ {
} }
NS_IMPL_ISUPPORTS(CookieViewerImpl, nsICookieViewer::GetIID()); NS_IMPL_ISUPPORTS1(CookieViewerImpl, nsICookieViewer)
NS_IMETHODIMP NS_IMETHODIMP
CookieViewerImpl::GetCookieValue(char** aValue) CookieViewerImpl::GetCookieValue(char** aValue)

View File

@ -44,7 +44,4 @@ interface nsICookieViewer : nsISupports
// {BBB67DF0-214B-11d3-ABAA-0080C787AD96} // {BBB67DF0-214B-11d3-ABAA-0080C787AD96}
#define NS_COOKIEVIEWER_CID \ #define NS_COOKIEVIEWER_CID \
{ 0xbbb67df0, 0x214b, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } } { 0xbbb67df0, 0x214b, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } }
extern nsresult
NS_NewCookieViewer(nsICookieViewer** aCookieViewer);
%} %}

View File

@ -44,7 +44,4 @@ interface nsIWalletEditor : nsISupports
// {F86A2E60-1C6A-11d3-ABA9-0080C787AD96} // {F86A2E60-1C6A-11d3-ABA9-0080C787AD96}
#define NS_WALLETEDITOR_CID \ #define NS_WALLETEDITOR_CID \
{ 0xf86a2e60, 0x1c6a, 0x11d3, { 0xab, 0xa9, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } } { 0xf86a2e60, 0x1c6a, 0x11d3, { 0xab, 0xa9, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } }
extern nsresult
NS_NewWalletEditor(nsIWalletEditor** aWalletEditor);
%} %}

View File

@ -31,41 +31,10 @@
#include "nsIWebShell.h" #include "nsIWebShell.h"
#include "nsIWebShellWindow.h" #include "nsIWebShellWindow.h"
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsIWalletEditor.h" #include "nsWalletEditor.h"
static NS_DEFINE_IID(kIWalletServiceIID, NS_IWALLETSERVICE_IID);
static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID); static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
class WalletEditorImpl : public nsIWalletEditor
{
public:
WalletEditorImpl();
virtual ~WalletEditorImpl();
// nsISupports interface
NS_DECL_ISUPPORTS
// nsIWalletEditor interface
NS_DECL_NSIWALLETEDITOR
};
////////////////////////////////////////////////////////////////////////
nsresult
NS_NewWalletEditor(nsIWalletEditor** aWalletEditor)
{
NS_PRECONDITION(aWalletEditor != nsnull, "null ptr");
if (!aWalletEditor) {
return NS_ERROR_NULL_POINTER;
}
*aWalletEditor = new WalletEditorImpl();
if (! *aWalletEditor) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(*aWalletEditor);
return NS_OK;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
WalletEditorImpl::WalletEditorImpl() WalletEditorImpl::WalletEditorImpl()
@ -77,7 +46,7 @@ WalletEditorImpl::~WalletEditorImpl()
{ {
} }
NS_IMPL_ISUPPORTS(WalletEditorImpl, nsIWalletEditor::GetIID()); NS_IMPL_ISUPPORTS1(WalletEditorImpl, nsIWalletEditor);
NS_IMETHODIMP NS_IMETHODIMP
WalletEditorImpl::GetValue(char** aValue) WalletEditorImpl::GetValue(char** aValue)

View File

@ -48,7 +48,7 @@
*/ */
struct nsIWalletService : public nsISupports struct nsIWalletService : public nsISupports
{ {
static const nsIID& GetIID() { static nsIID iid = NS_IWALLETSERVICE_IID; return iid; } NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWALLETSERVICE_IID)
NS_IMETHOD WALLET_PreEdit(nsAutoString& walletList) = 0; NS_IMETHOD WALLET_PreEdit(nsAutoString& walletList) = 0;
NS_IMETHOD WALLET_PostEdit(nsAutoString walletList) = 0; NS_IMETHOD WALLET_PostEdit(nsAutoString walletList) = 0;

View File

@ -46,7 +46,4 @@ interface nsISignonViewer : nsISupports
// {C425FAE1-20F0-11d3-ABAA-0080C787AD96} // {C425FAE1-20F0-11d3-ABAA-0080C787AD96}
#define NS_SIGNONVIEWER_CID \ #define NS_SIGNONVIEWER_CID \
{ 0xc425fae1, 0x20f0, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } } { 0xc425fae1, 0x20f0, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } }
extern nsresult
NS_NewSignonViewer(nsISignonViewer** aSignonViewer);
%} %}

View File

@ -31,41 +31,10 @@
#include "nsIWebShell.h" #include "nsIWebShell.h"
#include "nsIWebShellWindow.h" #include "nsIWebShellWindow.h"
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsISignonViewer.h" #include "nsSignonViewer.h"
static NS_DEFINE_IID(kIWalletServiceIID, NS_IWALLETSERVICE_IID);
static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID); static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
class SignonViewerImpl : public nsISignonViewer
{
public:
SignonViewerImpl();
virtual ~SignonViewerImpl();
// nsISupports interface
NS_DECL_ISUPPORTS
// nsISignonViewer interface
NS_DECL_NSISIGNONVIEWER
};
////////////////////////////////////////////////////////////////////////
nsresult
NS_NewSignonViewer(nsISignonViewer** aSignonViewer)
{
NS_PRECONDITION(aSignonViewer != nsnull, "null ptr");
if (!aSignonViewer) {
return NS_ERROR_NULL_POINTER;
}
*aSignonViewer = new SignonViewerImpl();
if (! *aSignonViewer) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(*aSignonViewer);
return NS_OK;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
SignonViewerImpl::SignonViewerImpl() SignonViewerImpl::SignonViewerImpl()

View File

@ -43,7 +43,4 @@ interface nsIWalletPreview : nsISupports
// {8F4CFE40-2152-11d3-ABAA-0080C787AD96} // {8F4CFE40-2152-11d3-ABAA-0080C787AD96}
#define NS_WALLETPREVIEW_CID \ #define NS_WALLETPREVIEW_CID \
{ 0x8f4cfe40, 0x2152, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } } { 0x8f4cfe40, 0x2152, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } }
extern nsresult
NS_NewWalletPreview(nsIWalletPreview** aWalletPreview);
%} %}

View File

@ -31,41 +31,10 @@
#include "nsIWebShell.h" #include "nsIWebShell.h"
#include "nsIWebShellWindow.h" #include "nsIWebShellWindow.h"
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsIWalletPreview.h" #include "nsWalletPreview.h"
static NS_DEFINE_IID(kIWalletServiceIID, NS_IWALLETSERVICE_IID);
static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID); static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
class WalletPreviewImpl : public nsIWalletPreview
{
public:
WalletPreviewImpl();
virtual ~WalletPreviewImpl();
// nsISupports interface
NS_DECL_ISUPPORTS
// nsIWalletPreview interface
NS_DECL_NSIWALLETPREVIEW
};
////////////////////////////////////////////////////////////////////////
nsresult
NS_NewWalletPreview(nsIWalletPreview** aWalletPreview)
{
NS_PRECONDITION(aWalletPreview != nsnull, "null ptr");
if (!aWalletPreview) {
return NS_ERROR_NULL_POINTER;
}
*aWalletPreview = new WalletPreviewImpl();
if (! *aWalletPreview) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(*aWalletPreview);
return NS_OK;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
WalletPreviewImpl::WalletPreviewImpl() WalletPreviewImpl::WalletPreviewImpl()
@ -77,7 +46,7 @@ WalletPreviewImpl::~WalletPreviewImpl()
{ {
} }
NS_IMPL_ISUPPORTS(WalletPreviewImpl, nsIWalletPreview::GetIID()); NS_IMPL_ISUPPORTS1(WalletPreviewImpl, nsIWalletPreview)
NS_IMETHODIMP NS_IMETHODIMP
WalletPreviewImpl::GetPrefillValue(char** aValue) WalletPreviewImpl::GetPrefillValue(char** aValue)