diff --git a/accessible/build/makefile.win b/accessible/build/makefile.win index 7c7f87b01a2d..9adba160847d 100644 --- a/accessible/build/makefile.win +++ b/accessible/build/makefile.win @@ -47,7 +47,6 @@ SUB_LIBRARIES=\ LLIBS=\ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\gkgfx.lib \ $(DIST)\lib\contentshared_s.lib \ $(LIBNSPR) \ diff --git a/build/mac/build_scripts/MozillaBuildList.pm b/build/mac/build_scripts/MozillaBuildList.pm index 7ac93d41631e..c6b6eeaecd9b 100644 --- a/build/mac/build_scripts/MozillaBuildList.pm +++ b/build/mac/build_scripts/MozillaBuildList.pm @@ -779,7 +779,6 @@ sub BuildClientDist() InstallFromManifest(":mozilla:widget:public:MANIFEST", "$distdirectory:widget:"); InstallFromManifest(":mozilla:widget:public:MANIFEST_IDL", "$distdirectory:idl:"); InstallFromManifest(":mozilla:widget:src:mac:MANIFEST", "$distdirectory:widget:"); - InstallFromManifest(":mozilla:widget:timer:public:MANIFEST", "$distdirectory:widget:"); #RDF InstallFromManifest(":mozilla:rdf:base:idl:MANIFEST", "$distdirectory:idl:"); diff --git a/content/build/makefile.win b/content/build/makefile.win index 54611cb0a96f..d4aa3fa78695 100644 --- a/content/build/makefile.win +++ b/content/build/makefile.win @@ -93,7 +93,6 @@ SUB_LIBRARIES=\ LLIBS=\ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\gkgfx.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\unicharutil_s.lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \ !if defined(MOZ_PERF) diff --git a/docshell/build/makefile.win b/docshell/build/makefile.win index b1997ae3f806..632534d839d0 100644 --- a/docshell/build/makefile.win +++ b/docshell/build/makefile.win @@ -58,7 +58,6 @@ SUB_LIBRARIES=\ LLIBS = \ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\gkgfx.lib \ $(LIBNSPR) diff --git a/embedding/base/nsEmbedAPI.h b/embedding/base/nsEmbedAPI.h index 49bdd83198da..31e723273f73 100644 --- a/embedding/base/nsEmbedAPI.h +++ b/embedding/base/nsEmbedAPI.h @@ -114,21 +114,6 @@ typedef MSG nsEmbedNativeEvent; #ifdef MOZ_SUPPORTS_EMBEDDING_EVENT_PROCESSING -/** - * @fn nsresult NS_DoIdleEmbeddingStuff() - * - * This function should be called during the idle time in your application - * or as each event is processed. This function ensures things such as - * timers are fired correctly. It is recommended you call this function - * even if has no perceived effect for your platform. - * - * @status UNDER_REVIEW - * - * @return NS_OK - */ -extern nsresult NS_DoIdleEmbeddingStuff(); - - /** * @fn nsresult NS_HandleEmbeddingEvent(nsEmbedNativeEvent &aEvent, PRBool &aWasHandled) * diff --git a/embedding/base/nsEmbedWin32.cpp b/embedding/base/nsEmbedWin32.cpp index 44bd80f652b1..d1c77cc2ae40 100644 --- a/embedding/base/nsEmbedWin32.cpp +++ b/embedding/base/nsEmbedWin32.cpp @@ -30,33 +30,6 @@ #ifdef MOZ_SUPPORTS_EMBEDDING_EVENT_PROCESSING -#include "nsWidgetsCID.h" -#include "nsITimer.h" -#include "nsITimerQueue.h" - -static NS_DEFINE_CID(kTimerManagerCID, NS_TIMERMANAGER_CID); - -nsresult NS_DoIdleEmbeddingStuff() -{ - nsresult rv = NS_ERROR_FAILURE; - nsCOMPtr timerQueue(do_GetService(kTimerManagerCID, &rv)); - if (NS_FAILED(rv)) - { - return NS_ERROR_FAILURE; - } - - if (timerQueue->HasReadyTimers(NS_PRIORITY_LOWEST)) - { - MSG wmsg; - do - { - timerQueue->FireNextReadyTimer(NS_PRIORITY_LOWEST); - } while (timerQueue->HasReadyTimers(NS_PRIORITY_LOWEST) && - !::PeekMessage(&wmsg, NULL, 0, 0, PM_NOREMOVE)); - } - return NS_OK; -} - nsresult NS_HandleEmbeddingEvent(nsEmbedNativeEvent &aEvent, PRBool &aWasHandled) { aWasHandled = PR_FALSE; diff --git a/embedding/browser/activex/src/control/MozillaBrowser.cpp b/embedding/browser/activex/src/control/MozillaBrowser.cpp index eeff15f4d929..f53dea24ce1b 100644 --- a/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -3294,7 +3294,6 @@ void PrintListener::WaitForComplete() break; // Do idle stuff - ::NS_DoIdleEmbeddingStuff(); ::MsgWaitForMultipleObjects(1, &hFakeEvent, FALSE, 500, QS_ALLEVENTS); } diff --git a/embedding/tests/mfcembed/MfcEmbed.cpp b/embedding/tests/mfcembed/MfcEmbed.cpp index 4e779f33c174..4536d03c9db2 100644 --- a/embedding/tests/mfcembed/MfcEmbed.cpp +++ b/embedding/tests/mfcembed/MfcEmbed.cpp @@ -48,9 +48,6 @@ // ExitInstance() also takes care of cleaning up of // multiple browser frame windows on app exit // -// NS_DoIdleEmbeddingStuff(); is called in the overridden -// OnIdle() method -// // Code to handle the creation of a new browser window // Next suggested file to look at : BrowserFrm.cpp @@ -438,8 +435,6 @@ BOOL CMfcEmbedApp::OnIdle(LONG lCount) { CWinApp::OnIdle(lCount); - NS_DoIdleEmbeddingStuff(); - return FALSE; } diff --git a/embedding/tests/winEmbed/winEmbed.cpp b/embedding/tests/winEmbed/winEmbed.cpp index 5107e04c99c6..cfa2a96e6636 100644 --- a/embedding/tests/winEmbed/winEmbed.cpp +++ b/embedding/tests/winEmbed/winEmbed.cpp @@ -1387,8 +1387,6 @@ PRUint32 AppCallbacks::RunEventLoop(PRBool &aRunCondition) } // Do idle stuff - ::NS_DoIdleEmbeddingStuff(); - ::MsgWaitForMultipleObjects(1, &hFakeEvent, FALSE, 100, QS_ALLEVENTS); } ::CloseHandle(hFakeEvent); diff --git a/gfx/src/windows/makefile.win b/gfx/src/windows/makefile.win index 4114c74a368f..33532ad095b1 100644 --- a/gfx/src/windows/makefile.win +++ b/gfx/src/windows/makefile.win @@ -82,7 +82,6 @@ LLIBS = \ $(DIST)\lib\gkgfx.lib \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\util.lib \ - $(DIST)\lib\timer_s.lib \ !if defined(NGLAYOUT_DDRAW) $(NGLAYOUT_DDRAW)\lib\ddraw.lib \ !endif diff --git a/js/src/xpconnect/tests/components/makefile.win b/js/src/xpconnect/tests/components/makefile.win index aa99a78e3ceb..b5770579cbd0 100644 --- a/js/src/xpconnect/tests/components/makefile.win +++ b/js/src/xpconnect/tests/components/makefile.win @@ -80,12 +80,6 @@ LLIBS= $(LIBNSPR) \ $(DIST)\lib\xpcom.lib \ $(NULL) -!ifndef XPCOM_STANDALONE -LLIBS= $(LLIBS) \ - $(DIST)\lib\timer_s.lib \ - $(NULL) -!endif - include <$(DEPTH)\config\rules.mak> libs:: $(DLL) diff --git a/layout/build/makefile.win b/layout/build/makefile.win index 672915ef0949..2581d23cda84 100644 --- a/layout/build/makefile.win +++ b/layout/build/makefile.win @@ -85,7 +85,6 @@ SUB_LIBRARIES= \ LLIBS= \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\gkgfx.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\unicharutil_s.lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \ !if defined(MOZ_PERF) diff --git a/layout/html/tests/makefile.win b/layout/html/tests/makefile.win index 07c7dc619706..1868a8059fd8 100644 --- a/layout/html/tests/makefile.win +++ b/layout/html/tests/makefile.win @@ -64,7 +64,6 @@ LLIBS= \ !endif $(DIST)\lib\util.lib \ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(LIBNSPR) \ $(DIST)\lib\js32$(VERSION_NUMBER).lib diff --git a/mailnews/base/build/makefile.win b/mailnews/base/build/makefile.win index f2ec57ed3f45..c10caf2a132e 100644 --- a/mailnews/base/build/makefile.win +++ b/mailnews/base/build/makefile.win @@ -77,7 +77,6 @@ SUB_LIBRARIES= \ LLIBS= \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\msgbsutl.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\rdfutil_s.lib \ $(DIST)\lib\unicharutil_s.lib \ $(LIBNSPR) \ diff --git a/mailnews/news/build/makefile.win b/mailnews/news/build/makefile.win index c99428e26a21..ceaca6a58fbb 100644 --- a/mailnews/news/build/makefile.win +++ b/mailnews/news/build/makefile.win @@ -68,7 +68,6 @@ LLIBS= \ $(DIST)\lib\msgbsutl.lib \ $(DIST)\lib\rdfutil_s.lib \ $(LIBNSPR) \ - $(DIST)\lib\timer_s.lib \ $(NULL) include <$(DEPTH)/config/rules.mak> diff --git a/rdf/build/makefile.win b/rdf/build/makefile.win index 8e8eb7e5dd3a..c6e0c8dd1d16 100644 --- a/rdf/build/makefile.win +++ b/rdf/build/makefile.win @@ -47,7 +47,6 @@ SUB_LIBRARIES=\ LLIBS=\ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\unicharutil_s.lib \ $(LIBNSPR) diff --git a/rdf/chrome/build/makefile.win b/rdf/chrome/build/makefile.win index 95e1d38ac56e..a3fc87d37c09 100644 --- a/rdf/chrome/build/makefile.win +++ b/rdf/chrome/build/makefile.win @@ -44,7 +44,6 @@ SUB_LIBRARIES= \ LLIBS=\ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(LIBNSPR) include <$(DEPTH)\config\rules.mak> diff --git a/view/src/makefile.win b/view/src/makefile.win index 147f32823724..48412f1b1218 100644 --- a/view/src/makefile.win +++ b/view/src/makefile.win @@ -56,7 +56,6 @@ LCFLAGS = \ LLIBS= \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\gkgfx.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\util.lib \ $(LIBNSPR) diff --git a/webshell/src/makefile.win b/webshell/src/makefile.win index f6e0667ca4f3..1eb390eee12f 100644 --- a/webshell/src/makefile.win +++ b/webshell/src/makefile.win @@ -57,7 +57,6 @@ LLIBS= \ $(DIST)\lib\basedocshell_s.lib \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\gkgfx.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\img32$(VERSION_NUMBER).lib \ $(DIST)\lib\util.lib \ $(DIST)\lib\jsdom.lib \ diff --git a/webshell/tests/viewer/makefile.win b/webshell/tests/viewer/makefile.win index 4bbb1943461d..750a508bd8be 100644 --- a/webshell/tests/viewer/makefile.win +++ b/webshell/tests/viewer/makefile.win @@ -88,7 +88,6 @@ OBJS = \ LLIBS= \ $(DIST)\lib\gkgfx.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\util.lib \ $(DIST)\lib\raptornativewidgets_s.lib \ $(DIST)\lib\raptorbasewidget_s.lib \ diff --git a/webshell/tests/viewer/nsSetupRegistry.cpp b/webshell/tests/viewer/nsSetupRegistry.cpp index fef86cf84163..c7f53e82ef8a 100644 --- a/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/webshell/tests/viewer/nsSetupRegistry.cpp @@ -90,8 +90,6 @@ static NS_DEFINE_CID(kCTransferableCID, NS_TRANSFERABLE_CID); static NS_DEFINE_IID(kDataFlavorCID, NS_DATAFLAVOR_CID); static NS_DEFINE_IID(kCHTMLFormatConverterCID, NS_HTMLFORMATCONVERTER_CID); static NS_DEFINE_IID(kCDragServiceCID, NS_DRAGSERVICE_CID); -static NS_DEFINE_IID(kCTimerCID, NS_TIMER_CID); -static NS_DEFINE_IID(kCTimerManagerCID, NS_TIMERMANAGER_CID); static NS_DEFINE_IID(kSoundCID, NS_SOUND_CID); static NS_DEFINE_IID(kCFilePickerCID, NS_FILEPICKER_CID); static NS_DEFINE_IID(kCPopUpCID,NS_POPUP_CID); @@ -153,19 +151,11 @@ NS_SetupRegistry() nsComponentManager::RegisterComponentLib(kCDragServiceCID, "Drag Service", "@mozilla.org/widget/dragservice;1", WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponentLib(kSoundCID, "Sound Services", "@mozilla.org/sound;1", WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponentLib(kCFilePickerCID, "FilePicker", "@mozilla.org/filepicker;1", WIDGET_DLL, PR_FALSE, PR_FALSE); -#ifdef XP_PC - nsComponentManager::RegisterComponentLib(kCTimerCID, "Timer", "@mozilla.org/timer;1", WIDGET_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCTimerManagerCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); -#endif #ifdef IBMBIDI nsComponentManager::RegisterComponentLib(kCBidiKeyboardCID, "Bidi Keyboard", "@mozilla.org/widget/bidikeyboard;1", WIDGET_DLL, PR_FALSE, PR_FALSE); #endif -#ifdef XP_MAC - nsComponentManager::RegisterComponentLib(kCTimerCID, "Timer", "@mozilla.org/timer;1", WIDGET_DLL, PR_FALSE, PR_FALSE); -#endif - // WIDGETS nsComponentManager::RegisterComponentLib(kCLabelCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponentLib(kCButtonCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); diff --git a/webshell/tests/viewer/nsWinMain.cpp b/webshell/tests/viewer/nsWinMain.cpp index 157e06ae3f3e..cec45267bfef 100644 --- a/webshell/tests/viewer/nsWinMain.cpp +++ b/webshell/tests/viewer/nsWinMain.cpp @@ -42,14 +42,10 @@ #include "JSConsole.h" #include "plevent.h" #include "nsIServiceManager.h" -#include "nsIThread.h" #include "nsWidgetsCID.h" -#include "nsTimerManager.h" JSConsole *gConsole; HINSTANCE gInstance, gPrevInstance; -static nsITimer* gNetTimer; -static NS_DEFINE_CID(kTimerManagerCID, NS_TIMERMANAGER_CID); nsNativeViewerApp::nsNativeViewerApp() { @@ -72,10 +68,6 @@ nsNativeViewerApp::Run() MSG msg; int keepGoing = 1; - nsresult rv; - nsCOMPtr queue(do_GetService(kTimerManagerCID, &rv)); - if (NS_FAILED(rv)) return 0; - // Pump all messages do { // Give priority to system messages (in particular keyboard, mouse, @@ -95,15 +87,6 @@ nsNativeViewerApp::Run() } } - // process timer queue. - } else if (queue->HasReadyTimers(NS_PRIORITY_LOWEST)) { - - do { - //printf("fire\n"); - queue->FireNextReadyTimer(NS_PRIORITY_LOWEST); - } while (queue->HasReadyTimers(NS_PRIORITY_LOWEST) && - !::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)); - } else { // Block and wait for any posted application message ::WaitMessage(); diff --git a/widget/Makefile.in b/widget/Makefile.in index 0e0fd46c12e2..965c4cbd5bca 100644 --- a/widget/Makefile.in +++ b/widget/Makefile.in @@ -26,7 +26,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = public timer src +DIRS = public src include $(topsrcdir)/config/rules.mk diff --git a/widget/macbuild/widget.xml b/widget/macbuild/widget.xml index ca1fc8a43d71..88ad4766a86d 100644 --- a/widget/macbuild/widget.xml +++ b/widget/macbuild/widget.xml @@ -105,16 +105,6 @@ FrameworkPathfalse HostFlagsAll - - SearchPath - Path::timer:src:mac: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - SearchPath Path:::gfx:src:mac: @@ -1206,20 +1196,6 @@ Text - - Name - nsTimerPeriodical.cpp - MacOS - Text - Debug - - - Name - nsTimerMac.cpp - MacOS - Text - Debug - Name nsHTMLFormatConverter.cpp @@ -1496,16 +1472,6 @@ nsXPLookAndFeel.h MacOS - - Name - nsTimerPeriodical.cpp - MacOS - - - Name - nsTimerMac.cpp - MacOS - Name nsHTMLFormatConverter.cpp @@ -1630,16 +1596,6 @@ FrameworkPathfalse HostFlagsAll - - SearchPath - Path::timer:src:mac: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - SearchPath Path:::dist: @@ -2728,20 +2684,6 @@ Text - - Name - nsTimerPeriodical.cpp - MacOS - Text - Debug - - - Name - nsTimerMac.cpp - MacOS - Text - Debug - Name nsHTMLFormatConverter.cpp @@ -3016,16 +2958,6 @@ nsXPLookAndFeel.h MacOS - - Name - nsTimerPeriodical.cpp - MacOS - - - Name - nsTimerMac.cpp - MacOS - Name nsHTMLFormatConverter.cpp @@ -3135,16 +3067,6 @@ FrameworkPathfalse HostFlagsAll - - SearchPath - Path::timer:src:mac: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - SearchPath Path:::gfx:src:mac: @@ -4236,20 +4158,6 @@ Text - - Name - nsTimerPeriodical.cpp - MacOS - Text - Debug - - - Name - nsTimerMac.cpp - MacOS - Text - Debug - Name nsHTMLFormatConverter.cpp @@ -4512,16 +4420,6 @@ nsXPLookAndFeel.h MacOS - - Name - nsTimerPeriodical.cpp - MacOS - - - Name - nsTimerMac.cpp - MacOS - Name nsHTMLFormatConverter.cpp @@ -4636,16 +4534,6 @@ FrameworkPathfalse HostFlagsAll - - SearchPath - Path::timer:src:mac: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - SearchPath Path:::dist: @@ -5734,20 +5622,6 @@ Text - - Name - nsTimerPeriodical.cpp - MacOS - Text - Debug - - - Name - nsTimerMac.cpp - MacOS - Text - Debug - Name nsHTMLFormatConverter.cpp @@ -6008,16 +5882,6 @@ nsXPLookAndFeel.h MacOS - - Name - nsTimerPeriodical.cpp - MacOS - - - Name - nsTimerMac.cpp - MacOS - Name nsHTMLFormatConverter.cpp @@ -6368,20 +6232,6 @@ MacOS - Mac Timers - - widgetDebug.shlb - Name - nsTimerPeriodical.cpp - MacOS - - - widgetDebug.shlb - Name - nsTimerMac.cpp - MacOS - - NS Libraries Optimized diff --git a/widget/makefile.win b/widget/makefile.win index cc54f8dd1987..de5beedcab5b 100644 --- a/widget/makefile.win +++ b/widget/makefile.win @@ -22,6 +22,6 @@ DEPTH=.. -DIRS=public timer src +DIRS=public src include <$(DEPTH)\config\rules.mak> diff --git a/widget/public/nsWidgetsCID.h b/widget/public/nsWidgetsCID.h index 2e235d27ff32..1bdfcb7c50d7 100644 --- a/widget/public/nsWidgetsCID.h +++ b/widget/public/nsWidgetsCID.h @@ -135,16 +135,6 @@ { 0xf6cd4f21, 0x53af, 0x11d2, \ { 0x8d, 0xc4, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } } -// {6B6C423A-1DD2-11B2-8888-E540BB169DDD} -#define NS_TIMER_CID \ -{ 0x6b6c423a, 0x1dd2, 0x11b2, \ - { 0x88, 0x88, 0xe5, 0x40, 0xbb, 0x16, 0x9d, 0xdd } } - -// {7783D5A6-1DD2-11B2-BF5E-CA89083D0AA4} -#define NS_TIMERMANAGER_CID \ -{ 0x7783d5a6, 0x1dd2, 0x11b2, \ - { 0xbf, 0x5e, 0xca, 0x89, 0x8, 0x3d, 0xa, 0xa4 } } - //----------------------------------------------------------- //Drag & Drop & Clipboard //----------------------------------------------------------- diff --git a/widget/src/build/makefile.win b/widget/src/build/makefile.win index 388836bf8d2e..bf809c0532fa 100644 --- a/widget/src/build/makefile.win +++ b/widget/src/build/makefile.win @@ -31,7 +31,6 @@ REQUIRES = xpcom \ uconv \ gfx \ dom \ - timer \ accessibility \ $(NULL) @@ -66,7 +65,6 @@ WIN_LIBS= \ SUB_LIBRARIES= \ $(DIST)\lib\raptorbasewidget_s.lib \ $(DIST)\lib\raptorwidget_s.lib \ - $(DIST)\lib\timer_s.lib \ $(NULL) LLIBS= \ diff --git a/widget/src/build/nsWinWidgetFactory.cpp b/widget/src/build/nsWinWidgetFactory.cpp index e520a043a765..724e8bc940f0 100644 --- a/widget/src/build/nsWinWidgetFactory.cpp +++ b/widget/src/build/nsWinWidgetFactory.cpp @@ -50,14 +50,11 @@ #include "nsAppShell.h" #include "nsIServiceManager.h" #include "nsSound.h" -#include "nsITimer.h" #ifdef IBMBIDI #include "nsBidiKeyboard.h" #endif -#include "nsWindowsTimer.h" -#include "nsTimerManager.h" // Drag & Drop, Clipboard #include "nsClipboard.h" @@ -80,8 +77,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimer) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimerManager) #ifdef IBMBIDI NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) #endif @@ -208,14 +203,6 @@ static nsModuleComponentInfo components[] = // "@mozilla.org/widget/dragservice/win;1", "@mozilla.org/widget/dragservice;1", nsDragServiceConstructor }, - { "Timer", - NS_TIMER_CID, - "@mozilla.org/timer;1", - nsTimerConstructor }, - { "Timer Manager", - NS_TIMERMANAGER_CID, - "@mozilla.org/widget/timermanager;1", - nsTimerManagerConstructor }, #ifdef IBMBIDI { "Bidi Keyboard", NS_BIDIKEYBOARD_CID, @@ -225,11 +212,4 @@ static nsModuleComponentInfo components[] = }; -PR_STATIC_CALLBACK(void) -nsWidgetWinModuleDtor(nsIModule *self) -{ - nsTimer::Shutdown(); -} - -NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetModule, components, - nsWidgetWinModuleDtor) +NS_IMPL_NSGETMODULE(nsWidgetModule, components) diff --git a/widget/src/mac/nsWidgetFactory.cpp b/widget/src/mac/nsWidgetFactory.cpp index 38d3e00439ab..1849f60d4a40 100644 --- a/widget/src/mac/nsWidgetFactory.cpp +++ b/widget/src/mac/nsWidgetFactory.cpp @@ -82,7 +82,6 @@ #include "nsIComponentManager.h" #include "nsSound.h" -#include "nsTimerMac.h" #ifdef IBMBIDI #include "nsBidiKeyboard.h" @@ -90,7 +89,6 @@ #include "nsIGenericFactory.h" -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimerImpl) NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton) @@ -124,10 +122,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) static nsModuleComponentInfo components[] = { - { "Timer", - NS_TIMER_CID, - "@mozilla.org/timer;1", - nsTimerImplConstructor }, { "nsWindow", NS_WINDOW_CID, "@mozilla.org/widgets/window/mac;1", diff --git a/widget/src/windows/nsAppShell.cpp b/widget/src/windows/nsAppShell.cpp index c492c8a15abf..c585ee8ef0e4 100644 --- a/widget/src/windows/nsAppShell.cpp +++ b/widget/src/windows/nsAppShell.cpp @@ -43,14 +43,11 @@ #include "nsIServiceManager.h" #include #include "nsWidgetsCID.h" -#include "nsITimer.h" -#include "nsITimerQueue.h" #ifdef MOZ_AIMM #include "aimm.h" #endif static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static NS_DEFINE_CID(kTimerManagerCID, NS_TIMERMANAGER_CID); NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell) @@ -97,10 +94,6 @@ NS_METHOD nsAppShell::Run(void) NS_ADDREF_THIS(); MSG msg; int keepGoing = 1; - - nsresult rv; - nsCOMPtr queue(do_GetService(kTimerManagerCID, &rv)); - if (NS_FAILED(rv)) return rv; gKeepGoing = 1; // Process messages @@ -122,15 +115,6 @@ NS_METHOD nsAppShell::Run(void) if (mDispatchListener) mDispatchListener->AfterDispatch(); } - - // process timer queue. - } else if (queue->HasReadyTimers(NS_PRIORITY_LOWEST)) { - - do { - queue->FireNextReadyTimer(NS_PRIORITY_LOWEST); - } while (queue->HasReadyTimers(NS_PRIORITY_LOWEST) && - !::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)); - } else { if (!gKeepGoing) { // In this situation, PostQuitMessage() was called, but the WM_QUIT @@ -165,10 +149,6 @@ nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent) BOOL gotMessage = false; - nsresult rv; - nsCOMPtr queue(do_GetService(kTimerManagerCID, &rv)); - if (NS_FAILED(rv)) return rv; - do { // Give priority to system messages (in particular keyboard, mouse, // timer, and paint messages). @@ -177,15 +157,6 @@ nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent) ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { gotMessage = true; - - // process timer queue. - } else if (queue->HasReadyTimers(NS_PRIORITY_LOWEST)) { - - do { - queue->FireNextReadyTimer(NS_PRIORITY_LOWEST); - } while (queue->HasReadyTimers(NS_PRIORITY_LOWEST) && - !::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)); - } else { // Block and wait for any posted application message ::WaitMessage(); diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 082a3f395399..75d4856f9871 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -95,7 +95,6 @@ #include "nsWidgetsCID.h" #include "nsITimer.h" -#include "nsITimerQueue.h" // For SetIcon #include "nsSpecialSystemDirectory.h" @@ -114,7 +113,6 @@ static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID); static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID); -static NS_DEFINE_CID(kTimerManagerCID, NS_TIMERMANAGER_CID); // When we build we are currently (11/27/01) setting the WINVER to 0x0400 // Which means we do not compile in the system resource for the HAND cursor @@ -3096,28 +3094,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT case WM_DISPLAYCHANGE: DispatchStandardEvent(NS_DISPLAYCHANGED); break; - - case WM_ENTERIDLE: - { - nsresult rv; - nsCOMPtr queue = - do_GetService(kTimerManagerCID, &rv); - if (NS_SUCCEEDED(rv)) { - - if (queue->HasReadyTimers(NS_PRIORITY_LOWEST)) { - - MSG wmsg; - do { -#ifdef DEBUG - //printf("fire\n"); -#endif - queue->FireNextReadyTimer(NS_PRIORITY_LOWEST); - } while (queue->HasReadyTimers(NS_PRIORITY_LOWEST) && - !::PeekMessage(&wmsg, NULL, 0, 0, PM_NOREMOVE)); - } - } - } - break; case WM_NOTIFY: // TAB change diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp index 15189e982e33..6dc944b5bbdd 100644 --- a/xpcom/build/nsXPComInit.cpp +++ b/xpcom/build/nsXPComInit.cpp @@ -71,6 +71,9 @@ #include "xptinfo.h" #include "nsIInterfaceInfoManager.h" +#include "nsTimerImpl.h" +#include "TimerThread.h" + #include "nsThread.h" #include "nsProcess.h" @@ -127,6 +130,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupportsInterfacePointerImpl) NS_GENERIC_FACTORY_CONSTRUCTOR(nsConsoleService); NS_GENERIC_FACTORY_CONSTRUCTOR(nsAtomService); NS_GENERIC_FACTORY_CONSTRUCTOR(nsExceptionService); +NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimerImpl); NS_GENERIC_FACTORY_CONSTRUCTOR(nsVariant); @@ -236,6 +240,8 @@ static nsModuleComponentInfo components[] = { #define NS_XPCOMPROXY_CID NS_PROXYEVENT_MANAGER_CID COMPONENT(XPCOMPROXY, nsProxyObjectManager::Create), + COMPONENT(TIMER, nsTimerImplConstructor), + #define COMPONENT_SUPPORTS(TYPE, Type) \ COMPONENT(SUPPORTS_##TYPE, nsSupports##Type##ImplConstructor) @@ -552,6 +558,10 @@ nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr) // Shutdown nsLocalFile string conversion NS_ShutdownLocalFile(); + // Shutdown the timer thread and all timers that might still be alive before + // shutting down the component manager + nsTimerImpl::Shutdown(); + // Shutdown xpcom. This will release all loaders and cause others holding // a refcount to the component manager to release it. rv = (nsComponentManagerImpl::gComponentManager)->Shutdown(); diff --git a/xpcom/macbuild/xpcomPPC.xml b/xpcom/macbuild/xpcomPPC.xml index 0c2c458a6ccb..480dd491c492 100644 --- a/xpcom/macbuild/xpcomPPC.xml +++ b/xpcom/macbuild/xpcomPPC.xml @@ -1863,6 +1863,20 @@ Text Debug + + Name + TimerThread.cpp + MacOS + Text + Debug + + + Name + nsTimerImpl.cpp + MacOS + Text + Debug + @@ -2460,6 +2474,16 @@ nsMemory.cpp MacOS + + Name + TimerThread.cpp + MacOS + + + Name + nsTimerImpl.cpp + MacOS + @@ -4279,6 +4303,20 @@ Text Debug + + Name + TimerThread.cpp + MacOS + Text + Debug + + + Name + nsTimerImpl.cpp + MacOS + Text + Debug + @@ -4881,6 +4919,16 @@ nsMemory.cpp MacOS + + Name + TimerThread.cpp + MacOS + + + Name + nsTimerImpl.cpp + MacOS + @@ -5528,6 +5576,18 @@ nsProcessMac.cpp MacOS + + xpcom.shlb + Name + TimerThread.cpp + MacOS + + + xpcom.shlb + Name + nsTimerImpl.cpp + MacOS + proxy diff --git a/xpcom/threads/Makefile.in b/xpcom/threads/Makefile.in index b622d6a1a99e..af2bc5e14262 100644 --- a/xpcom/threads/Makefile.in +++ b/xpcom/threads/Makefile.in @@ -42,14 +42,18 @@ CPPSRCS = \ nsEventQueue.cpp \ nsEventQueueService.cpp \ nsThread.cpp \ + nsTimerImpl.cpp \ nsProcessCommon.cpp \ + TimerThread.cpp \ $(NULL) EXPORTS = \ nsAutoLock.h \ plevent.h \ nsProcess.h \ - $(NULL) + nsITimer.h \ + nsITimerCallback.h \ + $(NULL) XPIDLSRCS = \ nsIThread.idl \ diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp new file mode 100644 index 000000000000..2311465610ad --- /dev/null +++ b/xpcom/threads/TimerThread.cpp @@ -0,0 +1,240 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by the Initial Developer are + * Copyright (C) 2001 the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Parmenter + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +#include "nsTimerImpl.h" +#include "TimerThread.h" + +#include "nsAutoLock.h" +#include "pratom.h" + +#include "nsIServiceManager.h" + +NS_IMPL_THREADSAFE_ISUPPORTS1(TimerThread, nsIRunnable) + +#undef ACCEPT_WRONG_TIMES + +#ifdef ACCEPT_WRONG_TIMES +// allow the thread to wake up and process timers +/- 3ms of when they +// are really supposed to fire. +static const PRIntervalTime kThreeMS = PR_MillisecondsToInterval(3); +#endif + +TimerThread::TimerThread() : + mCondVar(nsnull), + mLock(nsnull), + mProcessing(PR_FALSE), + mWaiting(PR_FALSE) +{ + NS_INIT_REFCNT(); +} + +TimerThread::~TimerThread() +{ + if (mCondVar) + PR_DestroyCondVar(mCondVar); + if (mLock) + PR_DestroyLock(mLock); + + mThread = nsnull; +} + +nsresult TimerThread::Init() +{ + if (mThread) + return NS_OK; + + mLock = PR_NewLock(); + if (!mLock) + return NS_ERROR_OUT_OF_MEMORY; + + mCondVar = PR_NewCondVar(mLock); + if (!mCondVar) + return NS_ERROR_OUT_OF_MEMORY; + + nsresult rv; + mEventQueueService = do_GetService("@mozilla.org/event-queue-service;1", &rv); + if (NS_FAILED(rv)) + return rv; + + // We hold on to mThread to keep the thread alive. + rv = NS_NewThread(getter_AddRefs(mThread), + NS_STATIC_CAST(nsIRunnable*, this), + 0, + PR_JOINABLE_THREAD, + PR_PRIORITY_NORMAL, + PR_GLOBAL_THREAD); + + return rv; +} + +nsresult TimerThread::Shutdown() +{ + if (!mThread) + return NS_ERROR_NOT_INITIALIZED; + + nsAutoLock lock(mLock); + + mProcessing = PR_FALSE; + + // notify the cond var so that Run() can return + if (mCondVar && mWaiting) + PR_NotifyCondVar(mCondVar); + + nsTimerImpl *timer; + for (PRInt32 i = mTimers.Count() - 1; i >= 0; i--) { + timer = NS_STATIC_CAST(nsTimerImpl*, mTimers[i]); + RemoveTimerInternal(timer); + } + + return NS_OK; +} + +/* void Run(); */ +NS_IMETHODIMP TimerThread::Run() +{ + mProcessing = PR_TRUE; + + while (mProcessing) { + nsCOMPtr theTimer; + + if (mTimers.Count() > 0) { + nsAutoLock lock(mLock); + nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl*, mTimers[0]); + + PRIntervalTime itIsNow = PR_IntervalNow(); +#ifdef ACCEPT_WRONG_TIMES + if (itIsNow + kThreeMS > timer->mTimeout - kThreeMS) { +#else + if (itIsNow >= timer->mTimeout) { +#endif + RemoveTimerInternal(timer); + theTimer = timer; + } + } + + if (theTimer) { +#ifdef DEBUG_TIMERS + PRIntervalTime now = PR_IntervalNow(); + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("Timer thread woke up %dms from when it was supposed to\n", + ((now > theTimer->mTimeout) ? PR_IntervalToMilliseconds(now - theTimer->mTimeout) : + -(PRInt32)PR_IntervalToMilliseconds(theTimer->mTimeout - now)))); +#endif + theTimer->Fire(); + } + + nsAutoLock lock(mLock); + + PRIntervalTime waitFor = PR_INTERVAL_NO_TIMEOUT; + + if (mTimers.Count() > 0) { + PRIntervalTime now = PR_IntervalNow(); + PRIntervalTime timeout = NS_STATIC_CAST(nsTimerImpl *, mTimers[0])->mTimeout; + +#ifdef ACCEPT_WRONG_TIMES + if (timeout > now + kThreeMS) +#else + if (timeout > now) +#endif + waitFor = timeout - now; + else + waitFor = PR_INTERVAL_NO_WAIT; + } + +#ifdef DEBUG_TIMERS + if (waitFor == PR_INTERVAL_NO_TIMEOUT) + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("waiting for PR_INTERVAL_NO_TIMEOUT\n")); + else if (waitFor == PR_INTERVAL_NO_WAIT) + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("waiting for PR_INTERVAL_NO_WAIT\n")); + else + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("waiting for %u\n", PR_IntervalToMilliseconds(waitFor))); +#endif + + mWaiting = PR_TRUE; + PR_WaitCondVar(mCondVar, waitFor); + mWaiting = PR_FALSE; + } + + return NS_OK; +} + +nsresult TimerThread::AddTimer(nsTimerImpl *aTimer) +{ + nsAutoLock lock(mLock); + + /* add the timer from our list */ + PRInt32 i = AddTimerInternal(aTimer); + + if (mCondVar && mWaiting && i == 0) + PR_NotifyCondVar(mCondVar); + + return NS_OK; +} + +nsresult TimerThread::TimerDelayChanged(nsTimerImpl *aTimer) +{ + nsAutoLock lock(mLock); + + RemoveTimerInternal(aTimer); + AddTimerInternal(aTimer); + + return NS_OK; +} + +nsresult TimerThread::RemoveTimer(nsTimerImpl *aTimer) +{ + nsAutoLock lock(mLock); + + /* remove the timer from our list */ + RemoveTimerInternal(aTimer); + + return NS_OK; +} + +// This function must be called from within a lock +PRInt32 TimerThread::AddTimerInternal(nsTimerImpl *aTimer) +{ + PRInt32 count = mTimers.Count(); + PRInt32 i = 0; + for (; i < count; i++) { + nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl *, mTimers[i]); + + if (aTimer->mTimeout < timer->mTimeout) { + break; + } + } + mTimers.InsertElementAt(aTimer, i); + + return i; +} diff --git a/xpcom/threads/TimerThread.h b/xpcom/threads/TimerThread.h new file mode 100644 index 000000000000..a759264ec6ff --- /dev/null +++ b/xpcom/threads/TimerThread.h @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by the Initial Developer are + * Copyright (C) 2001 the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Parmenter + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +#ifndef TimerThread_h___ +#define TimerThread_h___ + +#include "nsIEventQueueService.h" +#include "nsIObserver.h" +#include "nsIRunnable.h" +#include "nsIThread.h" + +#include "nsTimerImpl.h" + +#include "nsVoidArray.h" + +#include "prcvar.h" +#include "prlock.h" + +class TimerThread : public nsIRunnable +{ +public: + TimerThread(); + virtual ~TimerThread(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIRUNNABLE + + nsresult Init(); + nsresult Shutdown(); + + nsresult AddTimer(nsTimerImpl *aTimer); + nsresult TimerDelayChanged(nsTimerImpl *aTimer); + nsresult RemoveTimer(nsTimerImpl *aTimer); + + // For use by nsTimerImpl::Fire() + nsCOMPtr mEventQueueService; + +private: + // These two internal functions must be called from within a lock + inline PRInt32 AddTimerInternal(nsTimerImpl *aTimer); + inline void RemoveTimerInternal(nsTimerImpl *aTimer) { + mTimers.RemoveElement(aTimer); + } + + nsCOMPtr mThread; + PRLock *mLock; + PRCondVar *mCondVar; + + PRPackedBool mProcessing; + PRPackedBool mWaiting; + + nsVoidArray mTimers; +}; + +#endif /* TimerThread_h___ */ diff --git a/xpcom/threads/makefile.win b/xpcom/threads/makefile.win index 88a59987e2be..45455aee6942 100644 --- a/xpcom/threads/makefile.win +++ b/xpcom/threads/makefile.win @@ -33,6 +33,8 @@ EXPORTS = \ nsAutoLock.h \ plevent.h \ nsProcess.h \ + nsITimer.h \ + nsITimerCallback.h \ $(NULL) NO_XPT_GEN=1 @@ -62,8 +64,10 @@ CPP_OBJS = \ .\$(OBJDIR)\nsAutoLock.obj \ .\$(OBJDIR)\nsEventQueue.obj \ .\$(OBJDIR)\nsEventQueueService.obj \ + .\$(OBJDIR)\nsTimerImpl.obj \ .\$(OBJDIR)\nsThread.obj \ .\$(OBJDIR)\nsProcessCommon.obj \ + .\$(OBJDIR)\TimerThread.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/xpcom/threads/nsITimer.h b/xpcom/threads/nsITimer.h new file mode 100644 index 000000000000..b5ba9fadec3a --- /dev/null +++ b/xpcom/threads/nsITimer.h @@ -0,0 +1,155 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Netscape Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Parmenter + * Michael Lowe + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the NPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the NPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + + +#ifndef nsITimer_h___ +#define nsITimer_h___ + +#include "nscore.h" +#include "nsISupports.h" +#include "nsCOMPtr.h" +#include "nsIComponentManager.h" + +class nsITimer; +class nsITimerCallback; + +// Implementations of nsITimer should be written such that there are no limitations +// on what can be called by the TimerCallbackFunc. On platforms like the Macintosh this +// means that callback functions must be called from the main event loop NOT from +// an interrupt. + +/// Signature of timer callback function +typedef void +(*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure); + +/// Interface IID for nsITimer +#define NS_ITIMER_IID \ +{ 0x497eed20, 0xb740, 0x11d1, \ +{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } } + +// --- Timer priorities --- +// These are going away, so just use NORMAL for now. See bug 115473 +#define NS_PRIORITY_HIGHEST 10 +#define NS_PRIORITY_HIGH 8 +#define NS_PRIORITY_NORMAL 5 +#define NS_PRIORITY_LOW 2 +#define NS_PRIORITY_LOWEST 0 + +// --- Timer types --- +#define NS_TYPE_ONE_SHOT 0 // Timer which fires once only + +#define NS_TYPE_REPEATING_SLACK 1 // After firing, timer is stopped and not + // restarted until notifcation routine completes. + // Specified timer period will be at least time between + // when processing for last firing notifcation completes + // and when the next firing occurs. This is the preferable + // repeating type for most situations. + +#define NS_TYPE_REPEATING_PRECISE 2 // Timer which aims to have constant time between firings. + // The processing time for each timer notification should + // not influence timer period. However, if the processing + // for the last timer firing could not be completed until + // just before the next firing occurs, then you could have + // two timer notification routines being executed in quick + // sucession. + +#define REPEATING_TIMERS 1 + +/** + * Timer class, used to invoke a function or method after a fixed + * millisecond interval. + */ +class nsITimer : public nsISupports { +public: + NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITIMER_IID) + + /** + * Initialize a timer to fire after the given millisecond interval. + * This version takes a function to call and a closure to pass to + * that function. + * + * @param aFunc - The function to invoke + * @param aClosure - an opaque pointer to pass to that function + * @param aDelay - The millisecond interval + * @param aPriority - The timer priority + * @param aType - The timer type : one shot or repeating + * @result - NS_OK if this operation was successful + */ + NS_IMETHOD Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay, + PRUint32 aPriority = NS_PRIORITY_NORMAL, + PRUint32 aType = NS_TYPE_ONE_SHOT) = 0; + + /** + * Initialize a timer to fire after the given millisecond interval. + * This version takes an interface of type nsITimerCallback. + * The Notify method of this method is invoked. + * + * @param aCallback - The interface to notify + * @param aDelay - The millisecond interval + * @param aPriority - The timer priority + * @param aType - The timer type : one shot or repeating + * @result - NS_OK if this operation was successful + */ + NS_IMETHOD Init(nsITimerCallback *aCallback, + PRUint32 aDelay, + PRUint32 aPriority = NS_PRIORITY_NORMAL, + PRUint32 aType = NS_TYPE_ONE_SHOT) = 0; + + /// Cancels the timeout + NS_IMETHOD_(void) Cancel() = 0; + + /// @return the millisecond delay of the timeout + NS_IMETHOD_(PRUint32) GetDelay() = 0; + + /// Change the millisecond interval for the timeout + NS_IMETHOD_(void) SetDelay(PRUint32 aDelay) = 0; + + NS_IMETHOD_(PRUint32) GetPriority() = 0; + NS_IMETHOD_(void) SetPriority(PRUint32 aPriority) = 0; + + NS_IMETHOD_(PRUint32) GetType() = 0; + NS_IMETHOD_(void) SetType(PRUint32 aType) = 0; + + /// @return the opaque pointer + NS_IMETHOD_(void*) GetClosure() = 0; +}; + +#endif // nsITimer_h___ diff --git a/xpcom/threads/nsITimerCallback.h b/xpcom/threads/nsITimerCallback.h new file mode 100644 index 000000000000..54579bde3e49 --- /dev/null +++ b/xpcom/threads/nsITimerCallback.h @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Netscape Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the NPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the NPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef nsITimerCallback_h___ +#define nsITimerCallback_h___ + +#include "nscore.h" +#include "nsISupports.h" + +class nsITimer; + +/// Interface IID for nsITimerCallback +#define NS_ITIMERCALLBACK_IID \ +{ 0x5079b3a0, 0xb743, 0x11d1, \ +{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } } + +/** + * Interface implemented by users of the nsITimer class. An instance + * of this interface is passed in when creating a timer. The Notify() + * method of that instance is invoked after the specified delay. + */ +class nsITimerCallback : public nsISupports { +public: + NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITIMERCALLBACK_IID) + + NS_IMETHOD_(void) Notify(nsITimer *timer) = 0; +}; + +#endif diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp new file mode 100644 index 000000000000..363b98506407 --- /dev/null +++ b/xpcom/threads/nsTimerImpl.cpp @@ -0,0 +1,327 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by the Initial Developer are + * Copyright (C) 2001 the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Parmenter + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +#include "nsTimerImpl.h" +#include "TimerThread.h" + +#include "nsIEventQueue.h" + +static TimerThread *gThread = nsnull; + +#include "prmem.h" +#include "prinit.h" + +#ifdef DEBUG_TIMERS +#include + +double nsTimerImpl::sDeltaSumSquared = 0; +double nsTimerImpl::sDeltaSum = 0; +double nsTimerImpl::sNum = 0; + +static void +myNS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues, + double *meanResult, double *stdDevResult) +{ + double mean = 0.0, var = 0.0, stdDev = 0.0; + if (n > 0.0 && sumOfValues >= 0) { + mean = sumOfValues / n; + double temp = (n * sumOfSquaredValues) - (sumOfValues * sumOfValues); + if (temp < 0.0 || n <= 1) + var = 0.0; + else + var = temp / (n * (n - 1)); + // for some reason, Windows says sqrt(0.0) is "-1.#J" (?!) so do this: + stdDev = var != 0.0 ? sqrt(var) : 0.0; + } + *meanResult = mean; + *stdDevResult = stdDev; +} +#endif + +NS_IMPL_THREADSAFE_ISUPPORTS1(nsTimerImpl, nsITimer) + + +static PRStatus InitThread() +{ + gThread = new TimerThread(); + if (!gThread) return PR_FAILURE; + + gThread->AddRef(); + + nsresult rv = gThread->Init(); + if (NS_FAILED(rv)) return PR_FAILURE; + + return PR_SUCCESS; +} + +nsTimerImpl::nsTimerImpl() : + mClosure(nsnull), + mCallbackType(CALLBACK_TYPE_UNKNOWN), + mFiring(PR_FALSE) +{ + NS_INIT_REFCNT(); + nsIThread::GetCurrent(getter_AddRefs(mCallingThread)); + + static PRCallOnceType once; + PR_CallOnce(&once, InitThread); + + mCallback.c = nsnull; + +#ifdef DEBUG_TIMERS + mStart = 0; + mStart2 = 0; +#endif +} + +nsTimerImpl::~nsTimerImpl() +{ + mClosure = nsnull; + mCallback.c = nsnull; + mCallbackType = CALLBACK_TYPE_UNKNOWN; + + gThread->RemoveTimer(this); +} + + +void nsTimerImpl::Shutdown() +{ +#ifdef DEBUG_TIMERS + double mean = 0, stddev = 0; + myNS_MeanAndStdDev(sNum, sDeltaSum, sDeltaSumSquared, &mean, &stddev); + + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("sNum = %f, sDeltaSum = %f, sDeltaSumSquared = %f\n", sNum, sDeltaSum, sDeltaSumSquared)); + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("mean: %fms, stddev: %fms\n", mean, stddev)); +#endif + + if (!gThread) + return; + + gThread->Shutdown(); + gThread->Release(); + gThread = nsnull; +} + + +NS_IMETHODIMP nsTimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay, + PRUint32 aPriority, + PRUint32 aType) +{ + SetDelayInternal(aDelay); + + mCallback.c = aFunc; + mCallbackType = CALLBACK_TYPE_FUNC; + + mClosure = aClosure; + + mPriority = (PRUint8)aPriority; + mType = (PRUint8)aType; + + gThread->AddTimer(this); + + return NS_OK; +} + +NS_IMETHODIMP nsTimerImpl::Init(nsITimerCallback *aCallback, + PRUint32 aDelay, + PRUint32 aPriority, + PRUint32 aType) +{ + SetDelayInternal(aDelay); + + mCallback.i = aCallback; + mCallbackType = CALLBACK_TYPE_INTERFACE; + + mPriority = (PRUint8)aPriority; + mType = (PRUint8)aType; + + gThread->AddTimer(this); + + return NS_OK; +} + +NS_IMETHODIMP_(void) nsTimerImpl::Cancel() +{ + mClosure = nsnull; + mCallback.c = nsnull; + mCallbackType = CALLBACK_TYPE_UNKNOWN; + + gThread->RemoveTimer(this); +} + +NS_IMETHODIMP_(void) nsTimerImpl::SetDelay(PRUint32 aDelay) +{ + SetDelayInternal(aDelay); + + if (!mFiring) + gThread->TimerDelayChanged(this); +} + +NS_IMETHODIMP_(void) nsTimerImpl::SetPriority(PRUint32 aPriority) +{ + mPriority = (PRUint8)aPriority; +} + +NS_IMETHODIMP_(void) nsTimerImpl::SetType(PRUint32 aType) +{ + mType = (PRUint8)aType; + // XXX if this is called, we should change the actual type.. this could effect + // repeating timers. we need to ensure in Process() that if mType has changed + // during the callback that we don't end up with the timer in the queue twice. +} + +void nsTimerImpl::Process() +{ +#ifdef DEBUG_TIMERS + PRIntervalTime now = PR_IntervalNow(); + PRIntervalTime a = now - mStart; // actual delay in intervals + PRUint32 b = PR_MillisecondsToInterval(mDelay); // expected delay in intervals + PRUint32 d = PR_IntervalToMilliseconds((a > b) ? a - b : 0); // delta in ms + sDeltaSum += d; + sDeltaSumSquared += double(d) * double(d); + sNum++; + + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("[this=%p] expected delay time %dms\n", this, mDelay)); + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("[this=%p] actual delay time %dms\n", this, PR_IntervalToMilliseconds(a))); + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("[this=%p] -------\n", this)); + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("[this=%p] delta %dms\n", this, d)); + + mStart = mStart2; + mStart2 = 0; +#endif + + mFiring = PR_TRUE; + + if (mCallback.c) { + if (mCallbackType == CALLBACK_TYPE_FUNC) + (*mCallback.c)(this, mClosure); + else if (mCallbackType == CALLBACK_TYPE_INTERFACE) + mCallback.i->Notify(this); + /* else the timer has been canceled, and we shouldn't do anything */ + } + + mFiring = PR_FALSE; + +#ifdef DEBUG_TIMERS + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("[this=%p] Took %dms to fire process timer callback\n", this, + PR_IntervalToMilliseconds(PR_IntervalNow() - now))); +#endif + + if (mType == NS_TYPE_REPEATING_SLACK) { + SetDelayInternal(mDelay); // force mTimeout to be recomputed. + gThread->AddTimer(this); + } +} + + +struct MyEventType { + PLEvent e; + // arguments follow... +#ifdef DEBUG_TIMERS + PRIntervalTime mInit; +#endif +}; + + +void* handleMyEvent(MyEventType* event) +{ +#ifdef DEBUG_TIMERS + PRIntervalTime now = PR_IntervalNow(); + PR_LOG(gTimerLog, PR_LOG_DEBUG, ("[this=%p] time between Fire() and Process(): %dms\n", + event->e.owner, PR_IntervalToMilliseconds(now - event->mInit))); +#endif + NS_STATIC_CAST(nsTimerImpl*, event->e.owner)->Process(); + return NULL; +} + +void destroyMyEvent(MyEventType* event) +{ + nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl*, event->e.owner); + NS_RELEASE(timer); + PR_DELETE(event); +} + + +void nsTimerImpl::Fire() +{ + // XXX we may want to reuse the PLEvent in the case of repeating timers. + MyEventType* event; + + // construct + event = PR_NEW(MyEventType); + if (event == NULL) return; + + // initialize + PL_InitEvent((PLEvent*)event, this, + (PLHandleEventProc)handleMyEvent, + (PLDestroyEventProc)destroyMyEvent); + + NS_ADDREF(this); +#ifdef DEBUG_TIMERS + event->mInit = PR_IntervalNow(); +#endif + + // If this is a repeating precise timer, we need to calulate the time for the next timer to fire + // prior to making the callback. + if (mType == NS_TYPE_REPEATING_PRECISE) { + SetDelayInternal(mDelay); + gThread->AddTimer(this); + } + + PRThread *thread; + mCallingThread->GetPRThread(&thread); + + nsCOMPtr queue; + gThread->mEventQueueService->GetThreadEventQueue(thread, getter_AddRefs(queue)); + + queue->PostEvent(&event->e); +} + +void nsTimerImpl::SetDelayInternal(PRUint32 aDelay) +{ + mDelay = aDelay; + + PRIntervalTime now = PR_IntervalNow(); + + mTimeout = now + PR_MillisecondsToInterval(mDelay); + +#ifdef DEBUG_TIMERS + if (mStart == 0) + mStart = now; + else + mStart2 = now; +#endif +} diff --git a/xpcom/threads/nsTimerImpl.h b/xpcom/threads/nsTimerImpl.h new file mode 100644 index 000000000000..52fee75e0aef --- /dev/null +++ b/xpcom/threads/nsTimerImpl.h @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by the Initial Developer are + * Copyright (C) 2001 the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Parmenter + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +#ifndef nsTimerImpl_h___ +#define nsTimerImpl_h___ + +#define NS_TIMER_CONTRACTID "@mozilla.org/timer;1" + +//#define FORCE_PR_LOG /* Allow logging in the release build */ + +#include "nsITimer.h" +#include "nsITimerCallback.h" + +#include "nsIThread.h" + +#include "nsCOMPtr.h" + +#include "prlog.h" + +#if defined(PR_LOGGING) +// stupid NS_DECL_LOG crap +#ifdef PRLogModuleInfo +#undef PRLogModuleInfo +#endif +#ifdef PR_NewLogModule +#undef PR_NewLogModule +#endif + +static PRLogModuleInfo *gTimerLog = PR_NewLogModule("nsTimerImpl"); +#define DEBUG_TIMERS +#else +#undef DEBUG_TIMERS +#endif + +#define NS_TIMER_CLASSNAME "Timer" +#define NS_TIMER_CID \ +{ /* 5ff24248-1dd2-11b2-8427-fbab44f29bc8 */ \ + 0x5ff24248, \ + 0x1dd2, \ + 0x11b2, \ + {0x84, 0x27, 0xfb, 0xab, 0x44, 0xf2, 0x9b, 0xc8} \ +} + +enum { + CALLBACK_TYPE_UNKNOWN = 0, + CALLBACK_TYPE_INTERFACE = 1, + CALLBACK_TYPE_FUNC = 2 +}; + +class nsTimerImpl : public nsITimer +{ +public: + + nsTimerImpl(); + virtual ~nsTimerImpl(); + + static void Shutdown(); + + friend class TimerThread; + + void Fire(); + void Process(); + void SetDelayInternal(PRUint32 aDelay); + + NS_IMETHOD Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay, + PRUint32 aPriority, + PRUint32 aType); + + NS_IMETHOD Init(nsITimerCallback *aCallback, + PRUint32 aDelay, + PRUint32 aPriority, + PRUint32 aType); + + NS_DECL_ISUPPORTS + + NS_IMETHOD_(void) Cancel(); + + NS_IMETHOD_(PRUint32) GetDelay() { return mDelay; } + NS_IMETHOD_(void) SetDelay(PRUint32 aDelay); + + NS_IMETHOD_(PRUint32) GetPriority() { return (PRUint32)mPriority; } + NS_IMETHOD_(void) SetPriority(PRUint32 aPriority); + + NS_IMETHOD_(PRUint32) GetType() { return (PRUint32)mType; } + NS_IMETHOD_(void) SetType(PRUint32 aType); + + NS_IMETHOD_(void*) GetClosure() { return mClosure; } + +private: + nsCOMPtr mCallingThread; + + void * mClosure; + + union { + nsTimerCallbackFunc c; + nsITimerCallback * i; + } mCallback; + + PRUint8 mCallbackType; + PRUint8 mPriority; + PRUint8 mType; + PRUint8 mFiring; + + PRUint32 mDelay; + PRIntervalTime mTimeout; + +#ifdef DEBUG_TIMERS + PRIntervalTime mStart, mStart2; + static double sDeltaSum; + static double sDeltaSumSquared; + static double sNum; +#endif + +}; + +#endif /* nsTimerImpl_h___ */ diff --git a/xpfe/appshell/src/makefile.win b/xpfe/appshell/src/makefile.win index 4173f1d80604..b846e44dfc04 100644 --- a/xpfe/appshell/src/makefile.win +++ b/xpfe/appshell/src/makefile.win @@ -80,7 +80,6 @@ LCFLAGS = \ # These are the libraries we need to link with to create the DLL LLIBS= \ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\gkgfx.lib \ $(DIST)\lib\js3250.lib \ $(LIBNSPR) \ diff --git a/xpfe/browser/src/makefile.win b/xpfe/browser/src/makefile.win index c187e3c79bdf..7160149d40ba 100644 --- a/xpfe/browser/src/makefile.win +++ b/xpfe/browser/src/makefile.win @@ -62,7 +62,6 @@ LLIBS = \ $(LIBNSPR) \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\js3250.lib \ - $(DIST)\lib\timer_s.lib \ $(NULL) OBJS = \ diff --git a/xpfe/components/build/makefile.win b/xpfe/components/build/makefile.win index 9ffc7b1f6cdf..79f326785df3 100644 --- a/xpfe/components/build/makefile.win +++ b/xpfe/components/build/makefile.win @@ -29,7 +29,6 @@ REQUIRES = xpcom \ necko \ necko2 \ nkcache \ - timer \ intl \ locale \ mork \ @@ -77,7 +76,6 @@ WIN_LIBS = \ LLIBS= \ $(DIST)\lib\js3250.lib \ $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\timer_s.lib \ $(DIST)\lib\unicharutil_s.lib \ $(LIBNSPR) \ $(NULL)