backing edburns out to open up the tree.

sorry ed.  a=granrose
This commit is contained in:
sspitzer%netscape.com 2000-11-10 21:24:24 +00:00
parent d5e0dc51bc
commit c18ae77650
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

View File

@ -1582,6 +1582,8 @@ BookmarkParser::setFolderHint(nsIRDFResource *newSource, nsIRDFResource *objType
////////////////////////////////////////////////////////////////////////
// BookmarkDataSourceImpl
nsCOMPtr<nsITimer> nsBookmarksService::mTimer;
nsBookmarksService::nsBookmarksService()
: mInner(nsnull), mBookmarksAvailable(PR_FALSE), mDirty(PR_FALSE), mUpdateBatchNest(0)

View File

@ -58,7 +58,7 @@ protected:
nsCOMPtr<nsIStringBundle> mBundle;
nsString mPersonalToolbarName;
PRInt32 mUpdateBatchNest;
nsCOMPtr<nsITimer> mTimer;
static nsCOMPtr<nsITimer> mTimer;
#ifdef XP_MAC
PRBool mIEFavoritesAvailable;