3 #include "nsIDOMNode.h"
7 NS_DEF_PTR(nsIDOMNode
);
11 nsCOMPtr_optimized* 45
19 nsCOMPtr_optimized 112 (1.0000)
20 raw_optimized 124 bytes (1.1071) i.e., 10.71% bigger than nsCOMPtr_optimized
25 Test03_raw( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
28 // -- the following code is assumed, but is commented out so we compare only
29 // the relevent generated code
31 // if ( !aDOMNode || !aResult )
32 // return NS_ERROR_NULL_POINTER;
34 nsIDOMNode
* parent
= 0;
35 nsresult status
= aDOMNode
->GetParentNode(&parent
);
37 if ( NS_SUCCEEDED(status
) )
39 parent
->GetNodeName(*aResult
);
42 NS_IF_RELEASE(parent
);
49 Test03_raw_optimized( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
52 // if ( !aDOMNode || !aResult )
53 // return NS_ERROR_NULL_POINTER;
56 nsresult status
= aDOMNode
->GetParentNode(&parent
);
58 if ( NS_SUCCEEDED(status
) )
60 parent
->GetNodeName(*aResult
);
69 Test03_nsCOMPtr( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
72 // if ( !aDOMNode || !aResult )
73 // return NS_ERROR_NULL_POINTER;
75 nsCOMPtr
<nsIDOMNode
> parent
;
76 nsresult status
= aDOMNode
->GetParentNode( getter_AddRefs(parent
) );
78 parent
->GetNodeName(*aResult
);
84 Test03_nsCOMPtr_optimized( nsIDOMNode
* aDOMNode
, nsString
* aResult
)
87 // if ( !aDOMNode || !aResult )
88 // return NS_ERROR_NULL_POINTER;
91 nsresult status
= aDOMNode
->GetParentNode(&temp
);
92 nsCOMPtr
<nsIDOMNode
> parent( dont_AddRef(temp
) );
94 parent
->GetNodeName(*aResult
);