Reworked sizeof api's to be much more useful; updated implementations to match
git-svn-id: svn://10.0.0.236/trunk@45272 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -141,11 +141,10 @@ nsCString::~nsCString() {
|
||||
nsStr::Destroy(*this,mAgent);
|
||||
}
|
||||
|
||||
void nsCString::SizeOf(nsISizeOfHandler* aHandler) const {
|
||||
#ifndef RICKG_TESTBED
|
||||
aHandler->Add(sizeof(*this));
|
||||
aHandler->Add(mCapacity << mCharSize);
|
||||
#endif
|
||||
void nsCString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
|
||||
if (aResult) {
|
||||
*aResult = sizeof(*this) + mCapacity * mCharSize;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1848,11 +1847,10 @@ nsCAutoString::nsCAutoString( nsSubsumeCStr& aSubsumeStr) :nsCString() {
|
||||
nsCAutoString::~nsCAutoString(){
|
||||
}
|
||||
|
||||
void nsCAutoString::SizeOf(nsISizeOfHandler* aHandler) const {
|
||||
#ifndef RICKG_TESTBED
|
||||
aHandler->Add(sizeof(*this));
|
||||
aHandler->Add(mCapacity << mCharSize);
|
||||
#endif
|
||||
void nsCAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
|
||||
if (aResult) {
|
||||
*aResult = sizeof(*this) + mCapacity * mCharSize;
|
||||
}
|
||||
}
|
||||
|
||||
nsSubsumeCStr::nsSubsumeCStr(nsStr& aString) : nsCString() {
|
||||
|
||||
@@ -100,7 +100,7 @@ inline PRInt32 Length() const { return (PRInt32)mLength; }
|
||||
* Retrieve the size of this string
|
||||
* @return string length
|
||||
*/
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
|
||||
|
||||
/**
|
||||
@@ -715,7 +715,7 @@ public:
|
||||
* Retrieve the size of this string
|
||||
* @return string length
|
||||
*/
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
|
||||
char mBuffer[kDefaultStringSize];
|
||||
};
|
||||
|
||||
@@ -120,11 +120,10 @@ nsString::~nsString() {
|
||||
nsStr::Destroy(*this,mAgent);
|
||||
}
|
||||
|
||||
void nsString::SizeOf(nsISizeOfHandler* aHandler) const {
|
||||
#ifndef RICKG_TESTBED
|
||||
aHandler->Add(sizeof(*this));
|
||||
aHandler->Add(mCapacity << mCharSize);
|
||||
#endif
|
||||
void nsString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
|
||||
if (aResult) {
|
||||
*aResult = sizeof(*this) + mCapacity * mCharSize;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2132,11 +2131,10 @@ nsAutoString::nsAutoString( nsSubsumeStr& aSubsumeStr) :nsString(aSubsumeStr.mCh
|
||||
nsAutoString::~nsAutoString(){
|
||||
}
|
||||
|
||||
void nsAutoString::SizeOf(nsISizeOfHandler* aHandler) const {
|
||||
#ifndef RICKG_TESTBED
|
||||
aHandler->Add(sizeof(*this));
|
||||
aHandler->Add(mCapacity << mCharSize);
|
||||
#endif
|
||||
void nsAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
|
||||
if (aResult) {
|
||||
*aResult = sizeof(*this) + mCapacity * mCharSize;
|
||||
}
|
||||
}
|
||||
|
||||
nsSubsumeStr::nsSubsumeStr(nsStr& aString) : nsString(aString.mCharSize) {
|
||||
|
||||
@@ -107,7 +107,7 @@ inline PRInt32 Length() const { return (PRInt32)mLength; }
|
||||
* Retrieve the size of this string
|
||||
* @return string length
|
||||
*/
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
|
||||
|
||||
/**
|
||||
@@ -799,7 +799,7 @@ public:
|
||||
* Retrieve the size of this string
|
||||
* @return string length
|
||||
*/
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
|
||||
char mBuffer[kDefaultStringSize<<eTwoByte];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user