Removed most of the static ctors
git-svn-id: svn://10.0.0.236/trunk@49058 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -611,10 +611,10 @@ void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char*
|
||||
|
||||
#define POLYNOMIAL 0x04c11db7L
|
||||
|
||||
static PRBool crc_table_initialized;
|
||||
static PRUint32 crc_table[256];
|
||||
|
||||
static
|
||||
void gen_crc_table() {
|
||||
static void gen_crc_table() {
|
||||
/* generate the table of CRC remainders for all possible bytes */
|
||||
int i, j;
|
||||
PRUint32 crc_accum;
|
||||
@@ -630,16 +630,12 @@ void gen_crc_table() {
|
||||
return;
|
||||
}
|
||||
|
||||
class CRCInitializer {
|
||||
public:
|
||||
CRCInitializer() {
|
||||
gen_crc_table();
|
||||
}
|
||||
};
|
||||
CRCInitializer gCRCInitializer;
|
||||
|
||||
|
||||
PRUint32 AccumulateCRC(PRUint32 crc_accum, char *data_blk_ptr, int data_blk_size) {
|
||||
if (!crc_table_initialized) {
|
||||
gen_crc_table();
|
||||
crc_table_initialized = PR_TRUE;
|
||||
}
|
||||
|
||||
/* update the CRC on the data block one byte at a time */
|
||||
int i, j;
|
||||
for ( j = 0; j < data_blk_size; j++ ) {
|
||||
|
||||
@@ -1208,29 +1208,6 @@ nsHTMLElement gHTMLElements[] = {
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown},
|
||||
};
|
||||
|
||||
/**
|
||||
* This class is here to finalize the initialization of the
|
||||
* nsHTMLElement table.
|
||||
*/
|
||||
class CTableInitializer {
|
||||
public:
|
||||
CTableInitializer(){
|
||||
|
||||
/*now initalize tags that can contain themselves...
|
||||
int max=sizeof(gStyleTags)/sizeof(eHTMLTag_unknown);
|
||||
for(index=0;index<max;index++){
|
||||
gHTMLElements[gStyleTags[index]].mSelfContained=PR_TRUE;
|
||||
}
|
||||
gHTMLElements[eHTMLTag_a].mSelfContained=PR_FALSE;
|
||||
gHTMLElements[eHTMLTag_div].mSelfContained=PR_TRUE;
|
||||
gHTMLElements[eHTMLTag_frameset].mSelfContained=PR_TRUE;
|
||||
gHTMLElements[eHTMLTag_ol].mSelfContained=PR_TRUE;
|
||||
gHTMLElements[eHTMLTag_ul].mSelfContained=PR_TRUE;
|
||||
*/
|
||||
}
|
||||
};
|
||||
CTableInitializer gTableInitializer;
|
||||
|
||||
int nsHTMLElement::GetSynonymousGroups(int aGroup) {
|
||||
int result=0;
|
||||
|
||||
|
||||
@@ -146,16 +146,11 @@ void nsHTMLTokenizer::AddToken(CToken*& aToken,nsresult aResult,nsDeque& aDeque,
|
||||
* @return ptr to recycler (or null)
|
||||
*/
|
||||
nsITokenRecycler* nsHTMLTokenizer::GetTokenRecycler(void) {
|
||||
#if 0
|
||||
//let's move to this once we eliminate the leaking of tokens...
|
||||
static CTokenRecycler* gTokenRecycler=0;
|
||||
if(!gTokenRecycler)
|
||||
gTokenRecycler=new CTokenRecycler();
|
||||
return gTokenRecycler;
|
||||
#endif
|
||||
|
||||
static CTokenRecycler gTokenRecycler;
|
||||
return (nsITokenRecycler*)&gTokenRecycler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
nsDeque mDTDDeque;
|
||||
};
|
||||
|
||||
//static CSharedParserObjects* gSharedParserObjects=0;
|
||||
static CSharedParserObjects* gSharedParserObjects=0;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -169,8 +169,10 @@ public:
|
||||
};
|
||||
|
||||
CSharedParserObjects& GetSharedObjects() {
|
||||
static CSharedParserObjects gSharedParserObjects;
|
||||
return gSharedParserObjects;
|
||||
if (!gSharedParserObjects) {
|
||||
gSharedParserObjects = new CSharedParserObjects();
|
||||
}
|
||||
return *gSharedParserObjects;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -611,10 +611,10 @@ void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char*
|
||||
|
||||
#define POLYNOMIAL 0x04c11db7L
|
||||
|
||||
static PRBool crc_table_initialized;
|
||||
static PRUint32 crc_table[256];
|
||||
|
||||
static
|
||||
void gen_crc_table() {
|
||||
static void gen_crc_table() {
|
||||
/* generate the table of CRC remainders for all possible bytes */
|
||||
int i, j;
|
||||
PRUint32 crc_accum;
|
||||
@@ -630,16 +630,12 @@ void gen_crc_table() {
|
||||
return;
|
||||
}
|
||||
|
||||
class CRCInitializer {
|
||||
public:
|
||||
CRCInitializer() {
|
||||
gen_crc_table();
|
||||
}
|
||||
};
|
||||
CRCInitializer gCRCInitializer;
|
||||
|
||||
|
||||
PRUint32 AccumulateCRC(PRUint32 crc_accum, char *data_blk_ptr, int data_blk_size) {
|
||||
if (!crc_table_initialized) {
|
||||
gen_crc_table();
|
||||
crc_table_initialized = PR_TRUE;
|
||||
}
|
||||
|
||||
/* update the CRC on the data block one byte at a time */
|
||||
int i, j;
|
||||
for ( j = 0; j < data_blk_size; j++ ) {
|
||||
|
||||
@@ -1208,29 +1208,6 @@ nsHTMLElement gHTMLElements[] = {
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown},
|
||||
};
|
||||
|
||||
/**
|
||||
* This class is here to finalize the initialization of the
|
||||
* nsHTMLElement table.
|
||||
*/
|
||||
class CTableInitializer {
|
||||
public:
|
||||
CTableInitializer(){
|
||||
|
||||
/*now initalize tags that can contain themselves...
|
||||
int max=sizeof(gStyleTags)/sizeof(eHTMLTag_unknown);
|
||||
for(index=0;index<max;index++){
|
||||
gHTMLElements[gStyleTags[index]].mSelfContained=PR_TRUE;
|
||||
}
|
||||
gHTMLElements[eHTMLTag_a].mSelfContained=PR_FALSE;
|
||||
gHTMLElements[eHTMLTag_div].mSelfContained=PR_TRUE;
|
||||
gHTMLElements[eHTMLTag_frameset].mSelfContained=PR_TRUE;
|
||||
gHTMLElements[eHTMLTag_ol].mSelfContained=PR_TRUE;
|
||||
gHTMLElements[eHTMLTag_ul].mSelfContained=PR_TRUE;
|
||||
*/
|
||||
}
|
||||
};
|
||||
CTableInitializer gTableInitializer;
|
||||
|
||||
int nsHTMLElement::GetSynonymousGroups(int aGroup) {
|
||||
int result=0;
|
||||
|
||||
|
||||
@@ -146,16 +146,11 @@ void nsHTMLTokenizer::AddToken(CToken*& aToken,nsresult aResult,nsDeque& aDeque,
|
||||
* @return ptr to recycler (or null)
|
||||
*/
|
||||
nsITokenRecycler* nsHTMLTokenizer::GetTokenRecycler(void) {
|
||||
#if 0
|
||||
//let's move to this once we eliminate the leaking of tokens...
|
||||
static CTokenRecycler* gTokenRecycler=0;
|
||||
if(!gTokenRecycler)
|
||||
gTokenRecycler=new CTokenRecycler();
|
||||
return gTokenRecycler;
|
||||
#endif
|
||||
|
||||
static CTokenRecycler gTokenRecycler;
|
||||
return (nsITokenRecycler*)&gTokenRecycler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
nsDeque mDTDDeque;
|
||||
};
|
||||
|
||||
//static CSharedParserObjects* gSharedParserObjects=0;
|
||||
static CSharedParserObjects* gSharedParserObjects=0;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -169,8 +169,10 @@ public:
|
||||
};
|
||||
|
||||
CSharedParserObjects& GetSharedObjects() {
|
||||
static CSharedParserObjects gSharedParserObjects;
|
||||
return gSharedParserObjects;
|
||||
if (!gSharedParserObjects) {
|
||||
gSharedParserObjects = new CSharedParserObjects();
|
||||
}
|
||||
return *gSharedParserObjects;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user