mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
all changes are NS_DEBUG only. added a private static member variable to count outstanding webshells; code in constructor and destructor to do the counting; a static member function to retrieve the value; and a global function that calls that
This commit is contained in:
parent
2f9548bba6
commit
5a86efb7dd
@ -532,8 +532,26 @@ protected:
|
||||
|
||||
// if there is no mWindow, this will keep track of the bounds --dwc0001
|
||||
nsRect mBounds;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
private:
|
||||
// We're counting the number of |nsWebShells| to help find leaks
|
||||
static unsigned long gNumberOfWebShells;
|
||||
|
||||
static unsigned long TotalWebShellsInExistence() { return gNumberOfWebShells; }
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
unsigned long nsWebShell::gNumberOfWebShells = 0;
|
||||
|
||||
unsigned long
|
||||
NS_TotalWebShellsInExistence()
|
||||
{
|
||||
return nsWebShell::TotalWebShellsInExistence();
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// Class IID's
|
||||
@ -640,6 +658,11 @@ nsresult nsWebShell::DestroyPluginHost(void)
|
||||
// Note: operator new zeros our memory
|
||||
nsWebShell::nsWebShell()
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
// We're counting the number of |nsWebShells| to help find leaks
|
||||
++gNumberOfWebShells;
|
||||
#endif
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
mHistoryIndex = -1;
|
||||
mScrollPref = nsScrollPreference_kAuto;
|
||||
@ -729,6 +752,11 @@ nsWebShell::~nsWebShell()
|
||||
|
||||
|
||||
DestroyPluginHost();
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// We're counting the number of |nsWebShells| to help find leaks
|
||||
--gNumberOfWebShells;
|
||||
#endif
|
||||
}
|
||||
|
||||
void nsWebShell::InitFrameData(PRBool aCompleteInitScrolling)
|
||||
|
@ -532,8 +532,26 @@ protected:
|
||||
|
||||
// if there is no mWindow, this will keep track of the bounds --dwc0001
|
||||
nsRect mBounds;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
private:
|
||||
// We're counting the number of |nsWebShells| to help find leaks
|
||||
static unsigned long gNumberOfWebShells;
|
||||
|
||||
static unsigned long TotalWebShellsInExistence() { return gNumberOfWebShells; }
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
unsigned long nsWebShell::gNumberOfWebShells = 0;
|
||||
|
||||
unsigned long
|
||||
NS_TotalWebShellsInExistence()
|
||||
{
|
||||
return nsWebShell::TotalWebShellsInExistence();
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// Class IID's
|
||||
@ -640,6 +658,11 @@ nsresult nsWebShell::DestroyPluginHost(void)
|
||||
// Note: operator new zeros our memory
|
||||
nsWebShell::nsWebShell()
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
// We're counting the number of |nsWebShells| to help find leaks
|
||||
++gNumberOfWebShells;
|
||||
#endif
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
mHistoryIndex = -1;
|
||||
mScrollPref = nsScrollPreference_kAuto;
|
||||
@ -729,6 +752,11 @@ nsWebShell::~nsWebShell()
|
||||
|
||||
|
||||
DestroyPluginHost();
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// We're counting the number of |nsWebShells| to help find leaks
|
||||
--gNumberOfWebShells;
|
||||
#endif
|
||||
}
|
||||
|
||||
void nsWebShell::InitFrameData(PRBool aCompleteInitScrolling)
|
||||
|
Loading…
x
Reference in New Issue
Block a user