Reduce do_GetService code bloat further by adding specialized assignment to nsCOMPtr and providing a version with no error pointer. Also make CallGetService work the same way as CallGetComponent does, as far as using frozen/non-frozen interface to service manager. Bug 264456, r=darin.

This commit is contained in:
bryner@brianryner.com
2004-11-24 22:48:45 +00:00
parent 577ee6bd5b
commit 64dca58997
80 changed files with 478 additions and 374 deletions

View File

@@ -107,6 +107,42 @@ nsCOMPtr_base::assign_from_qi_with_error( const nsQueryInterfaceWithError& qi, c
assign_assuming_AddRef(newRawPtr);
}
void
nsCOMPtr_base::assign_from_gs_cid( const nsGetServiceByCID gs, const nsIID& iid )
{
nsISupports* newRawPtr;
if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) )
newRawPtr = 0;
assign_assuming_AddRef(newRawPtr);
}
void
nsCOMPtr_base::assign_from_gs_cid_with_error( const nsGetServiceByCIDWithError& gs, const nsIID& iid )
{
nsISupports* newRawPtr;
if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) )
newRawPtr = 0;
assign_assuming_AddRef(newRawPtr);
}
void
nsCOMPtr_base::assign_from_gs_contractid( const nsGetServiceByContractID gs, const nsIID& iid )
{
nsISupports* newRawPtr;
if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) )
newRawPtr = 0;
assign_assuming_AddRef(newRawPtr);
}
void
nsCOMPtr_base::assign_from_gs_contractid_with_error( const nsGetServiceByContractIDWithError& gs, const nsIID& iid )
{
nsISupports* newRawPtr;
if ( NS_FAILED( gs(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) )
newRawPtr = 0;
assign_assuming_AddRef(newRawPtr);
}
void
nsCOMPtr_base::assign_from_helper( const nsCOMPtr_helper& helper, const nsIID& iid )
{