backing edburns out to open up the tree.

sorry ed.  a=granrose


git-svn-id: svn://10.0.0.236/trunk@82547 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com
2000-11-10 21:24:24 +00:00
parent ad7db62b14
commit 0e4ac5bba9
4 changed files with 12 additions and 19 deletions

View File

@@ -23,9 +23,11 @@
#include "nsWindowsTimer.h"
#include "nsITimerQueue.h"
#include "nsIWindowsTimerMap.h"
#include "nsCRT.h"
#include "prlog.h"
#include <stdio.h>
#include <windows.h>
#include <limits.h>
#include "nsWidgetsCID.h"
#include "nsIServiceManager.h"
@@ -34,7 +36,7 @@
static NS_DEFINE_CID(kTimerManagerCID, NS_TIMERMANAGER_CID);
static nsCOMPtr<nsIWindowsTimerMap> sTimerMap = nsnull;
static nsCOMPtr<nsIWindowsTimerMap> sTimerMap;
static nsCOMPtr<nsITimerQueue> sTimerQueue;
class nsTimer;
@@ -107,12 +109,7 @@ nsTimer::nsTimer() : nsITimer()
cachedService = 1;
nsresult rv;
mKungFuDeathGripTimerMap = do_GetService(kTimerManagerCID, &rv);
// copy to static var, so it can be accessed by the FireTimeout
// function
sTimerMap = mKungFuDeathGripTimerMap;
sTimerMap = do_GetService(kTimerManagerCID, &rv);
sTimerQueue = do_GetService(kTimerManagerCID, &rv);
}
}
@@ -120,7 +117,6 @@ nsTimer::nsTimer() : nsITimer()
nsTimer::~nsTimer()
{
sTimerMap = nsnull;
KillOSTimer();
NS_IF_RELEASE(mCallback);
@@ -236,13 +232,13 @@ void nsTimer::StartOSTimer(PRUint32 aDelay)
{
PR_ASSERT(mTimerID == 0);
if (!mKungFuDeathGripTimerMap) return;
if (!sTimerMap) return;
// create OS timer
mTimerID = ::SetTimer(NULL, 0, aDelay, (TIMERPROC)FireTimeout);
// store mapping from OS timer to timer object
mKungFuDeathGripTimerMap->AddTimer(mTimerID, this);
sTimerMap->AddTimer(mTimerID, this);
}
@@ -251,8 +247,8 @@ void nsTimer::KillOSTimer()
if (mTimerID != 0) {
// remove mapping from OS timer to timer object
if (mKungFuDeathGripTimerMap) {
mKungFuDeathGripTimerMap->RemoveTimer(mTimerID);
if (sTimerMap) {
sTimerMap->RemoveTimer(mTimerID);
}
// kill OS timer

View File

@@ -24,13 +24,10 @@
#ifndef __nsTimer_h
#define __nsTimer_h
#include <windows.h>
#include "nsITimer.h"
#include "nsITimerCallback.h"
#include "nsIWindowsTimerMap.h"
#include "nsCOMPtr.h"
#include <windows.h>
/*
* Implementation of timers lifted from Windows front-end file timer.cpp
@@ -87,8 +84,6 @@ private:
UINT mTimerID;
bool mTimerRunning;
nsCOMPtr<nsIWindowsTimerMap> mKungFuDeathGripTimerMap;
};
#endif // __nsTimer_h