зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1455676 part 12. Remove use of nsIDOMNode from xpcom/. r=qdot
This commit is contained in:
Родитель
5fa76e716f
Коммит
1d8f39e16f
|
@ -1,10 +1,10 @@
|
|||
// Test01.cpp
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
NS_DEF_PTR(nsIDOMNode);
|
||||
NS_DEF_PTR(nsINode);
|
||||
|
||||
/*
|
||||
This test file compares the generated code size of similar functions between raw
|
||||
|
@ -40,7 +40,7 @@ NS_DEF_PTR(nsIDOMNode);
|
|||
*/
|
||||
|
||||
void
|
||||
Test01_raw( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test01_raw( nsINode* aDOMNode, nsString* aResult )
|
||||
// m140, w34
|
||||
{
|
||||
/*
|
||||
|
@ -49,7 +49,7 @@ Test01_raw( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
one of them is |nullptr|. Similarly: |Test01_nsCOMPtr00|, and |Test01_nsIPtr00|.
|
||||
*/
|
||||
|
||||
nsIDOMNode* node = aDOMNode;
|
||||
nsINode* node = aDOMNode;
|
||||
NS_IF_ADDREF(node);
|
||||
|
||||
if ( node )
|
||||
|
@ -59,7 +59,7 @@ Test01_raw( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
}
|
||||
|
||||
void
|
||||
Test01_raw_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test01_raw_optimized( nsINode* aDOMNode, nsString* aResult )
|
||||
// m112, w31
|
||||
{
|
||||
/*
|
||||
|
@ -79,29 +79,29 @@ Test01_raw_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
// if ( !aDOMNode )
|
||||
// return;
|
||||
|
||||
nsIDOMNode* node = aDOMNode;
|
||||
nsINode* node = aDOMNode;
|
||||
NS_ADDREF(node);
|
||||
node->GetNodeName(*aResult);
|
||||
NS_RELEASE(node);
|
||||
}
|
||||
|
||||
void
|
||||
Test01_nsCOMPtr( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test01_nsCOMPtr( nsINode* aDOMNode, nsString* aResult )
|
||||
// m120, w46/34
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> node = aDOMNode;
|
||||
nsCOMPtr<nsINode> node = aDOMNode;
|
||||
|
||||
if ( node )
|
||||
node->GetNodeName(*aResult);
|
||||
}
|
||||
|
||||
void
|
||||
Test01_nsCOMPtr_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test01_nsCOMPtr_optimized( nsINode* aDOMNode, nsString* aResult )
|
||||
// m112, w42/38
|
||||
{
|
||||
// if ( !aDOMNode )
|
||||
// return;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> node = aDOMNode;
|
||||
nsCOMPtr<nsINode> node = aDOMNode;
|
||||
node->GetNodeName(*aResult);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Test02.cpp
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
NS_DEF_PTR(nsIDOMNode);
|
||||
NS_DEF_PTR(nsINode);
|
||||
|
||||
/*
|
||||
This test file compares the generated code size of similar functions between raw
|
||||
|
@ -44,8 +44,8 @@ Test02_Raw00( nsISupports* aDOMNode, nsString* aResult )
|
|||
// if ( !aDOMNode )
|
||||
// return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIDOMNode* node = 0;
|
||||
nsresult status = aDOMNode->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
nsINode* node = 0;
|
||||
nsresult status = aDOMNode->QueryInterface(NS_GET_IID(nsINode), (void**)&node);
|
||||
if ( NS_SUCCEEDED(status) )
|
||||
{
|
||||
node->GetNodeName(*aResult);
|
||||
|
@ -63,8 +63,8 @@ Test02_Raw01( nsISupports* aDOMNode, nsString* aResult )
|
|||
// if ( !aDOMNode )
|
||||
// return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIDOMNode* node;
|
||||
nsresult status = aDOMNode->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)&node);
|
||||
nsINode* node;
|
||||
nsresult status = aDOMNode->QueryInterface(NS_GET_IID(nsINode), (void**)&node);
|
||||
if ( NS_SUCCEEDED(status) )
|
||||
{
|
||||
node->GetNodeName(*aResult);
|
||||
|
@ -79,7 +79,7 @@ Test02_nsCOMPtr( nsISupports* aDOMNode, nsString* aResult )
|
|||
// m120, w63/68
|
||||
{
|
||||
nsresult status;
|
||||
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aDOMNode, &status);
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aDOMNode, &status);
|
||||
|
||||
if ( node )
|
||||
node->GetNodeName(*aResult);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Test03.cpp
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
NS_DEF_PTR(nsIDOMNode);
|
||||
NS_DEF_PTR(nsINode);
|
||||
|
||||
/*
|
||||
Windows:
|
||||
|
@ -22,7 +22,7 @@ NS_DEF_PTR(nsIDOMNode);
|
|||
*/
|
||||
|
||||
void // nsresult
|
||||
Test03_raw( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test03_raw( nsINode* aDOMNode, nsString* aResult )
|
||||
// m140, w62
|
||||
{
|
||||
// -- the following code is assumed, but is commented out so we compare only
|
||||
|
@ -31,7 +31,7 @@ Test03_raw( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
// if ( !aDOMNode || !aResult )
|
||||
// return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIDOMNode* parent = 0;
|
||||
nsINode* parent = 0;
|
||||
nsresult status = aDOMNode->GetParentNode(&parent);
|
||||
|
||||
if ( NS_SUCCEEDED(status) )
|
||||
|
@ -46,13 +46,13 @@ Test03_raw( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
|
||||
|
||||
void // nsresult
|
||||
Test03_raw_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test03_raw_optimized( nsINode* aDOMNode, nsString* aResult )
|
||||
// m124, w48
|
||||
{
|
||||
// if ( !aDOMNode || !aResult )
|
||||
// return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIDOMNode* parent;
|
||||
nsINode* parent;
|
||||
nsresult status = aDOMNode->GetParentNode(&parent);
|
||||
|
||||
if ( NS_SUCCEEDED(status) )
|
||||
|
@ -66,13 +66,13 @@ Test03_raw_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
|
||||
|
||||
void // nsresult
|
||||
Test03_nsCOMPtr( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test03_nsCOMPtr( nsINode* aDOMNode, nsString* aResult )
|
||||
// m144, w54/59
|
||||
{
|
||||
// if ( !aDOMNode || !aResult )
|
||||
// return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> parent;
|
||||
nsCOMPtr<nsINode> parent;
|
||||
nsresult status = aDOMNode->GetParentNode( getter_AddRefs(parent) );
|
||||
if ( parent )
|
||||
parent->GetNodeName(*aResult);
|
||||
|
@ -81,15 +81,15 @@ Test03_nsCOMPtr( nsIDOMNode* aDOMNode, nsString* aResult )
|
|||
}
|
||||
|
||||
void // nsresult
|
||||
Test03_nsCOMPtr_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
|
||||
Test03_nsCOMPtr_optimized( nsINode* aDOMNode, nsString* aResult )
|
||||
// m112, w50/45
|
||||
{
|
||||
// if ( !aDOMNode || !aResult )
|
||||
// return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIDOMNode* temp;
|
||||
nsINode* temp;
|
||||
nsresult status = aDOMNode->GetParentNode(&temp);
|
||||
nsCOMPtr<nsIDOMNode> parent( dont_AddRef(temp) );
|
||||
nsCOMPtr<nsINode> parent( dont_AddRef(temp) );
|
||||
if ( parent )
|
||||
parent->GetNodeName(*aResult);
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Test04.cpp
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
NS_DEF_PTR(nsIDOMNode);
|
||||
NS_DEF_PTR(nsINode);
|
||||
|
||||
/*
|
||||
Windows:
|
||||
|
@ -21,10 +21,10 @@ class Test04_Raw
|
|||
Test04_Raw();
|
||||
~Test04_Raw();
|
||||
|
||||
void /*nsresult*/ SetNode( nsIDOMNode* newNode );
|
||||
void /*nsresult*/ SetNode( nsINode* newNode );
|
||||
|
||||
private:
|
||||
nsIDOMNode* mNode;
|
||||
nsINode* mNode;
|
||||
};
|
||||
|
||||
Test04_Raw::Test04_Raw()
|
||||
|
@ -39,7 +39,7 @@ Test04_Raw::~Test04_Raw()
|
|||
}
|
||||
|
||||
void // nsresult
|
||||
Test04_Raw::SetNode( nsIDOMNode* newNode )
|
||||
Test04_Raw::SetNode( nsINode* newNode )
|
||||
// m120, w36
|
||||
{
|
||||
NS_IF_ADDREF(newNode);
|
||||
|
@ -54,14 +54,14 @@ Test04_Raw::SetNode( nsIDOMNode* newNode )
|
|||
class Test04_nsCOMPtr
|
||||
{
|
||||
public:
|
||||
void /*nsresult*/ SetNode( nsIDOMNode* newNode );
|
||||
void /*nsresult*/ SetNode( nsINode* newNode );
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDOMNode> mNode;
|
||||
nsCOMPtr<nsINode> mNode;
|
||||
};
|
||||
|
||||
void // nsresult
|
||||
Test04_nsCOMPtr::SetNode( nsIDOMNode* newNode )
|
||||
Test04_nsCOMPtr::SetNode( nsINode* newNode )
|
||||
// m36, w13/13
|
||||
{
|
||||
mNode = newNode;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Test05.cpp
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
NS_DEF_PTR(nsIDOMNode);
|
||||
NS_DEF_PTR(nsINode);
|
||||
|
||||
/*
|
||||
Windows:
|
||||
|
@ -19,10 +19,10 @@ class Test05_Raw
|
|||
Test05_Raw();
|
||||
~Test05_Raw();
|
||||
|
||||
void /*nsresult*/ GetNode( nsIDOMNode** aNode );
|
||||
void /*nsresult*/ GetNode( nsINode** aNode );
|
||||
|
||||
private:
|
||||
nsIDOMNode* mNode;
|
||||
nsINode* mNode;
|
||||
};
|
||||
|
||||
Test05_Raw::Test05_Raw()
|
||||
|
@ -37,7 +37,7 @@ Test05_Raw::~Test05_Raw()
|
|||
}
|
||||
|
||||
void // nsresult
|
||||
Test05_Raw::GetNode( nsIDOMNode** aNode )
|
||||
Test05_Raw::GetNode( nsINode** aNode )
|
||||
// m64, w21
|
||||
{
|
||||
// if ( !aNode )
|
||||
|
@ -54,14 +54,14 @@ Test05_Raw::GetNode( nsIDOMNode** aNode )
|
|||
class Test05_nsCOMPtr
|
||||
{
|
||||
public:
|
||||
void /*nsresult*/ GetNode( nsIDOMNode** aNode );
|
||||
void /*nsresult*/ GetNode( nsINode** aNode );
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDOMNode> mNode;
|
||||
nsCOMPtr<nsINode> mNode;
|
||||
};
|
||||
|
||||
void // nsresult
|
||||
Test05_nsCOMPtr::GetNode( nsIDOMNode** aNode )
|
||||
Test05_nsCOMPtr::GetNode( nsINode** aNode )
|
||||
// m64, w21
|
||||
{
|
||||
// if ( !aNode )
|
||||
|
|
Загрузка…
Ссылка в новой задаче