3 #include "nsIDOMNode.h"
11 NS_DEF_PTR(nsIDOMNode
);
15 nsCOMPtr_optimized* 45
23 nsCOMPtr_optimized 112 (1.0000)
24 raw_optimized 124 bytes (1.1071) i.e., 10.71% bigger than nsCOMPtr_optimized
29 Test03_raw( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
32 // -- the following code is assumed, but is commented out so we compare only
33 // the relevent generated code
35 // if ( !aDOMNode || !aResult )
36 // return NS_ERROR_NULL_POINTER;
38 nsIDOMNode
* parent
= 0;
39 nsresult status
= aDOMNode
->GetParentNode(&parent
);
41 if ( NS_SUCCEEDED(status
) )
43 parent
->GetNodeName(*aResult
);
46 NS_IF_RELEASE(parent
);
53 Test03_raw_optimized( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
56 // if ( !aDOMNode || !aResult )
57 // return NS_ERROR_NULL_POINTER;
60 nsresult status
= aDOMNode
->GetParentNode(&parent
);
62 if ( NS_SUCCEEDED(status
) )
64 parent
->GetNodeName(*aResult
);
73 Test03_nsCOMPtr( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
76 // if ( !aDOMNode || !aResult )
77 // return NS_ERROR_NULL_POINTER;
79 nsCOMPtr
<nsIDOMNode
> parent
;
80 nsresult status
= aDOMNode
->GetParentNode( getter_AddRefs(parent
) );
82 parent
->GetNodeName(*aResult
);
88 Test03_nsCOMPtr_optimized( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
91 // if ( !aDOMNode || !aResult )
92 // return NS_ERROR_NULL_POINTER;
95 nsresult status
= aDOMNode
->GetParentNode(&temp
);
96 nsCOMPtr
<nsIDOMNode
> parent( dont_AddRef(temp
) );
98 parent
->GetNodeName(*aResult
);