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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user