diff --git a/mozilla/configure.in b/mozilla/configure.in index 0d8d0bf997a..d5eb2ef0f35 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -3352,7 +3352,6 @@ AC_SUBST(MOZ_UPDATE_XTERM) AC_SUBST(MOZ_MATHML) AC_SUBST(MOZ_SVG) AC_SUBST(MOZ_MONOLITHIC_TOOLKIT) -AC_SUBST(MOZ_TIMER_LIBS) AC_SUBST(MOZ_JS_LIBS) AC_SUBST(MOZ_SECURITY) dnl AC_SUBST(MOZ_NETCAST) diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index 0033ffcd078..fc8a51cfd24 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -416,7 +416,7 @@ public: NS_DECL_ISUPPORTS nsAutoScrollTimer() - : mSelection(0), mTimer(0), mFrame(0), mPresContext(0), mPoint(0,0), mScrollPoint(0,0), mDelay(30) + : mSelection(0), mFrame(0), mPresContext(0), mPoint(0,0), mScrollPoint(0,0), mDelay(30) { NS_INIT_ISUPPORTS(); } @@ -426,7 +426,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } } @@ -438,7 +437,8 @@ public: if (!mTimer) { - nsresult result = NS_NewTimer(&mTimer); + nsresult result; + mTimer = do_CreateInstance("component://netscape/timer", &result); if (NS_FAILED(result)) return result; @@ -454,7 +454,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); mTimer = 0; } @@ -499,7 +498,7 @@ public: private: nsSelection *mFrameSelection; nsDOMSelection *mSelection; - nsITimer *mTimer; + nsCOMPtr mTimer; nsIFrame *mFrame; nsIPresContext *mPresContext; nsPoint mPoint; diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 2140dc25c01..4887a47d9a8 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -2377,7 +2377,7 @@ HTMLContentSink::WillInterrupt() mNotificationTimer->Cancel(); } - result = NS_NewTimer(getter_AddRefs(mNotificationTimer)); + mNotificationTimer = do_CreateInstance("component://netscape/timer", &result); if (NS_SUCCEEDED(result)) { SINK_TRACE(SINK_TRACE_REFLOW, ("HTMLContentSink::WillInterrupt: setting up timer with delay %d", delay)); diff --git a/mozilla/content/shared/public/nsXULAtomList.h b/mozilla/content/shared/public/nsXULAtomList.h index e80aec275c6..c59e3429098 100644 --- a/mozilla/content/shared/public/nsXULAtomList.h +++ b/mozilla/content/shared/public/nsXULAtomList.h @@ -45,7 +45,6 @@ XUL_ATOM(button, "button") XUL_ATOM(spinner, "spinner") XUL_ATOM(scrollbar, "scrollbar") XUL_ATOM(slider, "slider") -XUL_ATOM(colorpicker, "colorpicker") XUL_ATOM(palettename, "palettename") XUL_ATOM(fontpicker, "fontpicker") XUL_ATOM(text, "text") diff --git a/mozilla/content/xul/content/src/nsXULPopupListener.cpp b/mozilla/content/xul/content/src/nsXULPopupListener.cpp index 1025915fdbc..fdcac06bdfa 100644 --- a/mozilla/content/xul/content/src/nsXULPopupListener.cpp +++ b/mozilla/content/xul/content/src/nsXULPopupListener.cpp @@ -280,7 +280,7 @@ XULPopupListenerImpl::MouseMove(nsIDOMEvent* aMouseEvent) if (mPopupContent || mTooltipTimer) return NS_OK; - NS_NewTimer ( getter_AddRefs(mTooltipTimer) ); + mTooltipTimer = do_CreateInstance("component://netscape/timer"); if ( mTooltipTimer ) { nsCOMPtr eventTarget; nsCOMPtr eventTargetNode; diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index b66bb561507..425603af7e0 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2004,8 +2004,7 @@ NS_IMETHODIMP nsDocShell::RefreshURI(nsIURI *aURI, PRInt32 aDelay, PRBool aRepea refreshTimer->mDelay = aDelay; refreshTimer->mRepeat = aRepeat; - nsITimer* timer = nsnull; - NS_NewTimer(&timer); + nsCOMPtr timer = do_CreateInstance("component://netscape/timer"); NS_ENSURE_TRUE(timer, NS_ERROR_FAILURE); mRefreshURIList.AppendElement(timer); diff --git a/mozilla/docshell/build/Makefile.in b/mozilla/docshell/build/Makefile.in index eebe31d21cf..4e01574681f 100644 --- a/mozilla/docshell/build/Makefile.in +++ b/mozilla/docshell/build/Makefile.in @@ -43,7 +43,6 @@ EXTRA_DSO_LDOPTS= \ $(EXTRA_DSO_LIBS) \ $(MOZ_JS_LIBS) \ $(MOZ_COMPONENT_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 3875f10cda0..f2007a86ef0 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -3180,7 +3180,8 @@ NS_IMETHODIMP GlobalWindowImpl::SetTimeoutOrInterval(JSContext* cx, jsval* argv, LL_I2L(now, PR_IntervalNow()); LL_D2L(delta, PR_MillisecondsToInterval((PRUint32)interval)); LL_ADD(timeout->when, now, delta); - nsresult err = NS_NewTimer(&timeout->timer); + nsresult err; + timeout->timer = do_CreateInstance("component://netscape/timer", &err); if(NS_OK != err) { DropTimeout(timeout); @@ -3369,11 +3370,10 @@ PRBool GlobalWindowImpl::RunTimeout(nsTimeoutImpl *aTimeout) delay32 = 0; delay32 = PR_IntervalToMilliseconds(delay32); - NS_IF_RELEASE(timeout->timer); - /* Reschedule timeout. Account for possible error return in code below that checks for zero toid. */ - nsresult err = NS_NewTimer(&timeout->timer); + nsresult err; + timeout->timer = do_CreateInstance("component://netscape/timer", &err); if(NS_OK != err) { mTimeoutInsertionPoint = last_insertion_point; NS_RELEASE(temp); @@ -3472,7 +3472,6 @@ void GlobalWindowImpl::DropTimeout(nsTimeoutImpl *aTimeout, } } } - NS_IF_RELEASE(aTimeout->timer); PR_FREEIF(aTimeout->filename); NS_IF_RELEASE(aTimeout->window); NS_IF_RELEASE(aTimeout->principal); @@ -3512,7 +3511,6 @@ NS_IMETHODIMP GlobalWindowImpl::ClearTimeoutOrInterval(PRInt32 aTimerID) if(timeout->timer) { timeout->timer->Cancel(); - NS_RELEASE(timeout->timer); DropTimeout(timeout); } DropTimeout(timeout); @@ -3541,7 +3539,6 @@ void GlobalWindowImpl::ClearAllTimeouts() if(timeout->timer) { timeout->timer->Cancel(); - NS_RELEASE(timeout->timer); // Drop the count since the timer isn't going to hold on // anymore. DropTimeout(timeout); diff --git a/mozilla/dom/src/base/nsGlobalWindow.h b/mozilla/dom/src/base/nsGlobalWindow.h index c4fe925a3a5..6a05f6e617f 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.h +++ b/mozilla/dom/src/base/nsGlobalWindow.h @@ -244,7 +244,7 @@ struct nsTimeoutImpl { GlobalWindowImpl *window; /* window for which this timeout fires */ JSString *expr; /* the JS expression to evaluate */ JSObject *funobj; /* or function to call, if !expr */ - nsITimer *timer; /* The actual timer object */ + nsCOMPtr timer; /* The actual timer object */ jsval *argv; /* function actual arguments */ PRUint16 argc; /* and argument count */ PRUint16 spare; /* alignment padding */ diff --git a/mozilla/dom/src/build/Makefile.in b/mozilla/dom/src/build/Makefile.in index 41640bbbd2c..f8737ec06a4 100644 --- a/mozilla/dom/src/build/Makefile.in +++ b/mozilla/dom/src/build/Makefile.in @@ -48,7 +48,6 @@ SHARED_LIBRARY_LIBS = \ $(NULL) EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(MOZ_JS_LIBS) \ $(NULL) diff --git a/mozilla/editor/base/Makefile.in b/mozilla/editor/base/Makefile.in index 05f1cb244be..83f288294e9 100644 --- a/mozilla/editor/base/Makefile.in +++ b/mozilla/editor/base/Makefile.in @@ -77,7 +77,6 @@ CPPSRCS = \ EXTRA_DSO_LDOPTS = \ $(MOZ_NECKO_UTIL_LIBS) \ $(MOZ_COMPONENT_LIBS) \ - $(MOZ_TIMER_LIBS) \ -lmozjs \ $(NULL) diff --git a/mozilla/editor/base/nsInterfaceState.cpp b/mozilla/editor/base/nsInterfaceState.cpp index 8f125ed4e41..1b9633496b6 100644 --- a/mozilla/editor/base/nsInterfaceState.cpp +++ b/mozilla/editor/base/nsInterfaceState.cpp @@ -269,7 +269,7 @@ nsresult nsInterfaceState::PrimeUpdateTimer() mUpdateTimer = NULL; // free it } - rv = NS_NewTimer(getter_AddRefs(mUpdateTimer)); + mUpdateTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_FAILED(rv)) return rv; const PRUint32 kUpdateTimerDelay = 150; diff --git a/mozilla/editor/composer/src/nsInterfaceState.cpp b/mozilla/editor/composer/src/nsInterfaceState.cpp index 8f125ed4e41..1b9633496b6 100644 --- a/mozilla/editor/composer/src/nsInterfaceState.cpp +++ b/mozilla/editor/composer/src/nsInterfaceState.cpp @@ -269,7 +269,7 @@ nsresult nsInterfaceState::PrimeUpdateTimer() mUpdateTimer = NULL; // free it } - rv = NS_NewTimer(getter_AddRefs(mUpdateTimer)); + mUpdateTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_FAILED(rv)) return rv; const PRUint32 kUpdateTimerDelay = 150; diff --git a/mozilla/embedding/browser/powerplant/source/CThrobber.cpp b/mozilla/embedding/browser/powerplant/source/CThrobber.cpp index e73d36d9651..3c144faf87f 100644 --- a/mozilla/embedding/browser/powerplant/source/CThrobber.cpp +++ b/mozilla/embedding/browser/powerplant/source/CThrobber.cpp @@ -53,7 +53,7 @@ const PRUint32 kThrobFrequency = 66; // animation frequency in milliseconds CThrobber::CThrobber() : mImages(nsnull), mNumImages(0), mCompletedImages(0), mIndex(0), mRunning(false), - mImageGroup(nsnull), mTimer(nsnull) + mImageGroup(nsnull) { NS_INIT_REFCNT(); // caller must add ref as normal @@ -65,7 +65,7 @@ CThrobber::CThrobber(LStream* inStream) : LView(inStream), mImages(nsnull), mNumImages(0), mCompletedImages(0), mIndex(0), mRunning(false), - mImageGroup(nsnull), mTimer(nsnull) + mImageGroup(nsnull) { mRefCnt = 1; // PowerPlant is making us, and it sure isn't going to do an AddRef. @@ -279,7 +279,7 @@ NS_METHOD CThrobber::LoadImages(const nsString& aFileNameMask, PRInt32 aNumImage mImageGroup->Init(deviceCtx, nsnull); NS_RELEASE(deviceCtx); - rv = NS_NewTimer(&mTimer); + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK != rv) { return rv; } @@ -310,7 +310,6 @@ void CThrobber::DestroyImages() if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } if (mImageGroup) @@ -346,9 +345,8 @@ void CThrobber::Tick() } #ifndef REPEATING_TIMERS - NS_RELEASE(mTimer); - - nsresult rv = NS_NewTimer(&mTimer); + nsresult rv; + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK == rv) { mTimer->Init(ThrobTimerCallback, this, kThrobFrequency); } diff --git a/mozilla/embedding/browser/powerplant/source/CThrobber.h b/mozilla/embedding/browser/powerplant/source/CThrobber.h index b952f0bbe5d..721f526eb61 100644 --- a/mozilla/embedding/browser/powerplant/source/CThrobber.h +++ b/mozilla/embedding/browser/powerplant/source/CThrobber.h @@ -100,7 +100,7 @@ public: bool mRunning; SInt32 mNumImages, mCompletedImages, mIndex; nsIImageGroup *mImageGroup; - nsITimer *mTimer; + nsCOMPtr mTimer; static map mgThrobberMap; diff --git a/mozilla/extensions/xmlterm/geckoterm/Makefile.in b/mozilla/extensions/xmlterm/geckoterm/Makefile.in index fcfe24b275a..f9e901adea5 100644 --- a/mozilla/extensions/xmlterm/geckoterm/Makefile.in +++ b/mozilla/extensions/xmlterm/geckoterm/Makefile.in @@ -77,7 +77,6 @@ XP_DIST_LIBS = \ XP_NS_UNDERBAR_CRAP = \ $(MOZ_NECKO_UTIL_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(MOZ_WIDGET_SUPPORT_LIBS) \ $(NULL) diff --git a/mozilla/gfx/src/Makefile.in b/mozilla/gfx/src/Makefile.in index 828f2b012d1..d6a960b6dd3 100644 --- a/mozilla/gfx/src/Makefile.in +++ b/mozilla/gfx/src/Makefile.in @@ -89,7 +89,6 @@ SHARED_LIBRARY_LIBS = \ $(NULL) EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) diff --git a/mozilla/gfx/src/mac/Makefile.in b/mozilla/gfx/src/mac/Makefile.in index 111a36848ab..442f9e1f554 100644 --- a/mozilla/gfx/src/mac/Makefile.in +++ b/mozilla/gfx/src/mac/Makefile.in @@ -50,7 +50,6 @@ CPPSRCS = \ EXTRA_DSO_LDOPTS = \ $(MKSHLIB_FORCE_ALL) \ - $(MOZ_TIMER_LIBS) \ $(DIST)/lib/libimg_s.a \ $(DIST)/lib/libmozutil_s.a \ -lraptorgfx \ @@ -63,4 +62,4 @@ include $(topsrcdir)/config/rules.mk CXXFLAGS += $(TK_CFLAGS) CFLAGS += $(TK_CFLAGS) -INCLUDES += $(TK_CFLAGS) -I$(srcdir)/.. \ No newline at end of file +INCLUDES += $(TK_CFLAGS) -I$(srcdir)/.. diff --git a/mozilla/gfx/src/nsImageNetContextAsync.cpp b/mozilla/gfx/src/nsImageNetContextAsync.cpp index b7d5a310607..c015e7bca76 100644 --- a/mozilla/gfx/src/nsImageNetContextAsync.cpp +++ b/mozilla/gfx/src/nsImageNetContextAsync.cpp @@ -135,7 +135,7 @@ protected: PRBool mInterrupted; ImageNetContextImpl *mContext; nsIInputStream *mStream; - nsITimer *mTimer; + nsCOMPtr mTimer; PRBool mFirstRead; char *mBuffer; PRInt32 mStatus; @@ -154,7 +154,6 @@ ImageConsumer::ImageConsumer(ilIURL *aURL, ImageNetContextImpl *aContext) mInterrupted = PR_FALSE; mFirstRead = PR_TRUE; mStream = nsnull; - mTimer = nsnull; mBuffer = nsnull; mStatus = 0; mChannel = nsnull; @@ -485,7 +484,6 @@ NS_IMETHODIMP ImageConsumer::OnStopRequest(nsIChannel* channel, nsISupports* aContext, nsresult status, const PRUnichar* aMsg) { if (mTimer != nsnull) { - NS_RELEASE(mTimer); } if (NS_BINDING_SUCCEEDED != status) { @@ -507,7 +505,9 @@ ImageConsumer::OnStopRequest(nsIChannel* channel, nsISupports* aContext, nsresul if (mStream) { SetKeepPumpingData(channel, aContext); - if ((NS_OK != NS_NewTimer(&mTimer)) || + nsresult rv; + mTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_FAILED(rv) || (NS_OK != mTimer->Init(ImageConsumer::KeepPumpingStream, this, 0))) { mStatus = MK_IMAGE_LOSSAGE; NS_RELEASE(mStream); @@ -556,7 +556,6 @@ ImageConsumer::~ImageConsumer() NS_IF_RELEASE(mURL); NS_IF_RELEASE(mContext); NS_IF_RELEASE(mStream); - NS_IF_RELEASE(mTimer); if (mBuffer != nsnull) { PR_DELETE(mBuffer); } diff --git a/mozilla/gfx/src/nsImageSystemServices.cpp b/mozilla/gfx/src/nsImageSystemServices.cpp index 559b66b0805..458fb0f2efb 100644 --- a/mozilla/gfx/src/nsImageSystemServices.cpp +++ b/mozilla/gfx/src/nsImageSystemServices.cpp @@ -80,7 +80,14 @@ ImageSystemServicesImpl::SetTimeout(ilTimeoutCallbackFunction aFunc, nsITimer *timer; TimerClosure *tc; - if (NS_NewTimer(&timer) != NS_OK) { + nsresult rv; + rv = nsComponentManager::CreateInstance("component://netscape/timer", + nsnull, + NS_GET_IID(nsITimer), + (void**)&timer); + + + if (NS_FAILED(rv)) { return nsnull; } diff --git a/mozilla/gfx/tests/Makefile.in b/mozilla/gfx/tests/Makefile.in index 12eac5e3886..32ef9d91f70 100644 --- a/mozilla/gfx/tests/Makefile.in +++ b/mozilla/gfx/tests/Makefile.in @@ -44,7 +44,6 @@ LIBS = \ $(EXTRA_DSO_LIBS) \ $(XPCOM_LIBS) \ $(MOZ_JS_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(TK_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/gfx/tests/coverage/Makefile.in b/mozilla/gfx/tests/coverage/Makefile.in index dc27ffdd172..6eb8c4eb064 100644 --- a/mozilla/gfx/tests/coverage/Makefile.in +++ b/mozilla/gfx/tests/coverage/Makefile.in @@ -38,7 +38,6 @@ LIBS = \ -lmozjs \ $(MOZ_WIDGET_SUPPORT_LIBS) \ -lraptorgfx \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/intl/strres/tests/Makefile.in b/mozilla/intl/strres/tests/Makefile.in index 78b5187a54c..2abf0317d23 100644 --- a/mozilla/intl/strres/tests/Makefile.in +++ b/mozilla/intl/strres/tests/Makefile.in @@ -41,7 +41,6 @@ EXPORT_RESOURCE = \ LIBS = \ $(MOZ_JS_LIBS) \ $(XPCOM_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/js/src/xpconnect/tests/components/Makefile.in b/mozilla/js/src/xpconnect/tests/components/Makefile.in index 7f641d94e31..ffd87848715 100644 --- a/mozilla/js/src/xpconnect/tests/components/Makefile.in +++ b/mozilla/js/src/xpconnect/tests/components/Makefile.in @@ -60,10 +60,6 @@ CPPSRCS = \ xpctest_out.cpp \ $(NULL) -LIBS += \ - $(MOZ_TIMER_LIBS) \ - $(NULL) - EXTRA_DSO_LDOPTS += \ $(MOZ_COMPONENT_LIBS) \ -lmozjs \ diff --git a/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp b/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp index 72d5ff5d4d3..4ecb699655b 100644 --- a/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp +++ b/mozilla/js/src/xpconnect/tests/components/xpctest_echo.cpp @@ -415,8 +415,10 @@ xpctestEcho::CallReceiverSometimeLater(void) // as it is built today. This is only test code and we can stand to // have it only work on Win32 for now. #ifdef WIN32 - nsITimer *timer; - if(NS_FAILED(NS_NewTimer(&timer))) + nsCOMPtr timer; + nsresult rv; + timer = do_CreateInstance("component://netscape/timer", &rv); + if(NS_FAILED(rv)) return NS_ERROR_FAILURE; timer->Init(NS_STATIC_CAST(nsITimerCallback*,this), 2000); return NS_OK; diff --git a/mozilla/layout/base/nsCaret.cpp b/mozilla/layout/base/nsCaret.cpp index 3da4377aca2..a6595ce85d1 100644 --- a/mozilla/layout/base/nsCaret.cpp +++ b/mozilla/layout/base/nsCaret.cpp @@ -55,7 +55,6 @@ static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID); nsCaret::nsCaret() : mPresShell(nsnull) -, mBlinkTimer(nsnull) , mBlinkRate(500) , mCaretWidth(20) , mVisible(PR_FALSE) @@ -344,7 +343,6 @@ void nsCaret::KillTimer() if (mBlinkTimer) { mBlinkTimer->Cancel(); - NS_RELEASE(mBlinkTimer); } } @@ -357,7 +355,8 @@ nsresult nsCaret::PrimeTimer() // set up the blink timer if (!mReadOnly && mBlinkRate > 0) { - nsresult err = NS_NewTimer(&mBlinkTimer); + nsresult err; + mBlinkTimer = do_CreateInstance("component://netscape/timer", &err); if (NS_FAILED(err)) return err; diff --git a/mozilla/layout/base/nsCaret.h b/mozilla/layout/base/nsCaret.h index 0b8a4db09be..1ab9ae9be17 100644 --- a/mozilla/layout/base/nsCaret.h +++ b/mozilla/layout/base/nsCaret.h @@ -87,7 +87,7 @@ class nsCaret : public nsICaret, nsCOMPtr mPresShell; - nsITimer* mBlinkTimer; + nsCOMPtr mBlinkTimer; PRUint32 mBlinkRate; // time for one cyle (off then on), in milliseconds nscoord mCaretWidth; // caret width in twips diff --git a/mozilla/layout/base/src/nsCaret.cpp b/mozilla/layout/base/src/nsCaret.cpp index 3da4377aca2..a6595ce85d1 100644 --- a/mozilla/layout/base/src/nsCaret.cpp +++ b/mozilla/layout/base/src/nsCaret.cpp @@ -55,7 +55,6 @@ static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID); nsCaret::nsCaret() : mPresShell(nsnull) -, mBlinkTimer(nsnull) , mBlinkRate(500) , mCaretWidth(20) , mVisible(PR_FALSE) @@ -344,7 +343,6 @@ void nsCaret::KillTimer() if (mBlinkTimer) { mBlinkTimer->Cancel(); - NS_RELEASE(mBlinkTimer); } } @@ -357,7 +355,8 @@ nsresult nsCaret::PrimeTimer() // set up the blink timer if (!mReadOnly && mBlinkRate > 0) { - nsresult err = NS_NewTimer(&mBlinkTimer); + nsresult err; + mBlinkTimer = do_CreateInstance("component://netscape/timer", &err); if (NS_FAILED(err)) return err; diff --git a/mozilla/layout/base/src/nsCaret.h b/mozilla/layout/base/src/nsCaret.h index 0b8a4db09be..1ab9ae9be17 100644 --- a/mozilla/layout/base/src/nsCaret.h +++ b/mozilla/layout/base/src/nsCaret.h @@ -87,7 +87,7 @@ class nsCaret : public nsICaret, nsCOMPtr mPresShell; - nsITimer* mBlinkTimer; + nsCOMPtr mBlinkTimer; PRUint32 mBlinkRate; // time for one cyle (off then on), in milliseconds nscoord mCaretWidth; // caret width in twips diff --git a/mozilla/layout/base/src/nsSelection.cpp b/mozilla/layout/base/src/nsSelection.cpp index 0033ffcd078..fc8a51cfd24 100644 --- a/mozilla/layout/base/src/nsSelection.cpp +++ b/mozilla/layout/base/src/nsSelection.cpp @@ -416,7 +416,7 @@ public: NS_DECL_ISUPPORTS nsAutoScrollTimer() - : mSelection(0), mTimer(0), mFrame(0), mPresContext(0), mPoint(0,0), mScrollPoint(0,0), mDelay(30) + : mSelection(0), mFrame(0), mPresContext(0), mPoint(0,0), mScrollPoint(0,0), mDelay(30) { NS_INIT_ISUPPORTS(); } @@ -426,7 +426,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } } @@ -438,7 +437,8 @@ public: if (!mTimer) { - nsresult result = NS_NewTimer(&mTimer); + nsresult result; + mTimer = do_CreateInstance("component://netscape/timer", &result); if (NS_FAILED(result)) return result; @@ -454,7 +454,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); mTimer = 0; } @@ -499,7 +498,7 @@ public: private: nsSelection *mFrameSelection; nsDOMSelection *mSelection; - nsITimer *mTimer; + nsCOMPtr mTimer; nsIFrame *mFrame; nsIPresContext *mPresContext; nsPoint mPoint; diff --git a/mozilla/layout/base/tests/Makefile.in b/mozilla/layout/base/tests/Makefile.in index 2a64908533d..9dcbe56bb79 100644 --- a/mozilla/layout/base/tests/Makefile.in +++ b/mozilla/layout/base/tests/Makefile.in @@ -36,7 +36,6 @@ LIBS += \ $(DIST)/lib/libraptorlayout_s.a \ -lraptorgfx \ -lmozjs \ - $(MOZ_TIMER_LIBS) \ $(XPCOM_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ diff --git a/mozilla/layout/build/Makefile.in b/mozilla/layout/build/Makefile.in index 9910019f7e4..b4268eacf3c 100644 --- a/mozilla/layout/build/Makefile.in +++ b/mozilla/layout/build/Makefile.in @@ -91,7 +91,6 @@ SHARED_LIBRARY_LIBS += \ endif EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ -L$(DIST)/bin \ $(EXTRA_DSO_LIBS) \ $(MOZ_COMPONENT_LIBS) \ diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 3af9aaea9e1..b5e5c85b20d 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -607,6 +607,9 @@ nsImageFrame::Paint(nsIPresContext* aPresContext, inner.height = NSIntPixelsToTwips(image->GetHeight(), p2t); } + nsRect damageRect; + damageRect.IntersectRect(inner, aDirtyRect); + if (lowImage != nsnull && lowSrcLinesLoaded > 0) { //inner.height = lowSrcLinesLoaded; aRenderingContext.DrawImage(lowImage, inner); diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 847eca41f20..ceb34affab0 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -171,7 +171,7 @@ private: char *mDocumentBase; nsIWidget *mWidget; nsIPresContext *mContext; - nsITimer *mPluginTimer; + nsCOMPtr mPluginTimer; nsIPluginHost *mPluginHost; }; @@ -1314,7 +1314,6 @@ nsPluginInstanceOwner::nsPluginInstanceOwner() mParamNames = nsnull; mParamVals = nsnull; mDocumentBase = nsnull; - mPluginTimer = nsnull; mPluginHost = nsnull; } @@ -1325,7 +1324,6 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner() // shut off the timer. if (mPluginTimer != nsnull) { mPluginTimer->Cancel(); - NS_RELEASE(mPluginTimer); } if (nsnull != mInstance) @@ -2256,8 +2254,9 @@ NS_IMETHODIMP_(void) nsPluginInstanceOwner::Notify(nsITimer* /* timer */) #ifndef REPEATING_TIMERS // reprime the timer? currently have to create a new timer for each call, which is // kind of wasteful. need to get periodic timers working on all platforms. - NS_IF_RELEASE(mPluginTimer); - if (NS_NewTimer(&mPluginTimer) == NS_OK) + nsresult rv; + mPluginTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_SUCCEEDED(rv)) mPluginTimer->Init(this, 1000 / 60); #endif } @@ -2266,7 +2265,6 @@ void nsPluginInstanceOwner::CancelTimer() { if (mPluginTimer != NULL) { mPluginTimer->Cancel(); - NS_RELEASE(mPluginTimer); } } @@ -2348,7 +2346,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void) #if defined(XP_MAC) // start a periodic timer to provide null events to the plugin instance. - rv = NS_NewTimer(&mPluginTimer); + mPluginTimer = do_CreateInstance("component://netscape/timer", &rv); if (rv == NS_OK) rv = mPluginTimer->Init(this, 1000 / 60, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_SLACK); #endif diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index 0033ffcd078..fc8a51cfd24 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -416,7 +416,7 @@ public: NS_DECL_ISUPPORTS nsAutoScrollTimer() - : mSelection(0), mTimer(0), mFrame(0), mPresContext(0), mPoint(0,0), mScrollPoint(0,0), mDelay(30) + : mSelection(0), mFrame(0), mPresContext(0), mPoint(0,0), mScrollPoint(0,0), mDelay(30) { NS_INIT_ISUPPORTS(); } @@ -426,7 +426,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } } @@ -438,7 +437,8 @@ public: if (!mTimer) { - nsresult result = NS_NewTimer(&mTimer); + nsresult result; + mTimer = do_CreateInstance("component://netscape/timer", &result); if (NS_FAILED(result)) return result; @@ -454,7 +454,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); mTimer = 0; } @@ -499,7 +498,7 @@ public: private: nsSelection *mFrameSelection; nsDOMSelection *mSelection; - nsITimer *mTimer; + nsCOMPtr mTimer; nsIFrame *mFrame; nsIPresContext *mPresContext; nsPoint mPoint; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 980502aaf4f..c5e690347fe 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -185,7 +185,7 @@ protected: : mPresContext(aPresContext), mFrame(aFrame) {} }; - nsITimer* mTimer; + nsCOMPtr mTimer; nsVoidArray mFrames; nsIPresContext* mPresContext; @@ -206,7 +206,6 @@ static PRTime gLastTick; nsBlinkTimer::nsBlinkTimer() { NS_INIT_REFCNT(); - mTimer = nsnull; } nsBlinkTimer::~nsBlinkTimer() @@ -217,7 +216,8 @@ nsBlinkTimer::~nsBlinkTimer() void nsBlinkTimer::Start() { - nsresult rv = NS_NewTimer(&mTimer); + nsresult rv; + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK == rv) { mTimer->Init(this, 750, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_PRECISE); } @@ -227,7 +227,6 @@ void nsBlinkTimer::Stop() { if (nsnull != mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } } diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 3af9aaea9e1..b5e5c85b20d 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -607,6 +607,9 @@ nsImageFrame::Paint(nsIPresContext* aPresContext, inner.height = NSIntPixelsToTwips(image->GetHeight(), p2t); } + nsRect damageRect; + damageRect.IntersectRect(inner, aDirtyRect); + if (lowImage != nsnull && lowSrcLinesLoaded > 0) { //inner.height = lowSrcLinesLoaded; aRenderingContext.DrawImage(lowImage, inner); diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index 847eca41f20..ceb34affab0 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -171,7 +171,7 @@ private: char *mDocumentBase; nsIWidget *mWidget; nsIPresContext *mContext; - nsITimer *mPluginTimer; + nsCOMPtr mPluginTimer; nsIPluginHost *mPluginHost; }; @@ -1314,7 +1314,6 @@ nsPluginInstanceOwner::nsPluginInstanceOwner() mParamNames = nsnull; mParamVals = nsnull; mDocumentBase = nsnull; - mPluginTimer = nsnull; mPluginHost = nsnull; } @@ -1325,7 +1324,6 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner() // shut off the timer. if (mPluginTimer != nsnull) { mPluginTimer->Cancel(); - NS_RELEASE(mPluginTimer); } if (nsnull != mInstance) @@ -2256,8 +2254,9 @@ NS_IMETHODIMP_(void) nsPluginInstanceOwner::Notify(nsITimer* /* timer */) #ifndef REPEATING_TIMERS // reprime the timer? currently have to create a new timer for each call, which is // kind of wasteful. need to get periodic timers working on all platforms. - NS_IF_RELEASE(mPluginTimer); - if (NS_NewTimer(&mPluginTimer) == NS_OK) + nsresult rv; + mPluginTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_SUCCEEDED(rv)) mPluginTimer->Init(this, 1000 / 60); #endif } @@ -2266,7 +2265,6 @@ void nsPluginInstanceOwner::CancelTimer() { if (mPluginTimer != NULL) { mPluginTimer->Cancel(); - NS_RELEASE(mPluginTimer); } } @@ -2348,7 +2346,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void) #if defined(XP_MAC) // start a periodic timer to provide null events to the plugin instance. - rv = NS_NewTimer(&mPluginTimer); + mPluginTimer = do_CreateInstance("component://netscape/timer", &rv); if (rv == NS_OK) rv = mPluginTimer->Init(this, 1000 / 60, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_SLACK); #endif diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index 980502aaf4f..c5e690347fe 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -185,7 +185,7 @@ protected: : mPresContext(aPresContext), mFrame(aFrame) {} }; - nsITimer* mTimer; + nsCOMPtr mTimer; nsVoidArray mFrames; nsIPresContext* mPresContext; @@ -206,7 +206,6 @@ static PRTime gLastTick; nsBlinkTimer::nsBlinkTimer() { NS_INIT_REFCNT(); - mTimer = nsnull; } nsBlinkTimer::~nsBlinkTimer() @@ -217,7 +216,8 @@ nsBlinkTimer::~nsBlinkTimer() void nsBlinkTimer::Start() { - nsresult rv = NS_NewTimer(&mTimer); + nsresult rv; + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK == rv) { mTimer->Init(this, 750, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_PRECISE); } @@ -227,7 +227,6 @@ void nsBlinkTimer::Stop() { if (nsnull != mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } } diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 2140dc25c01..4887a47d9a8 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -2377,7 +2377,7 @@ HTMLContentSink::WillInterrupt() mNotificationTimer->Cancel(); } - result = NS_NewTimer(getter_AddRefs(mNotificationTimer)); + mNotificationTimer = do_CreateInstance("component://netscape/timer", &result); if (NS_SUCCEEDED(result)) { SINK_TRACE(SINK_TRACE_REFLOW, ("HTMLContentSink::WillInterrupt: setting up timer with delay %d", delay)); diff --git a/mozilla/layout/html/forms/src/nsGfxListControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxListControlFrame.cpp index 5dd3fd251a9..b18ce43d80a 100644 --- a/mozilla/layout/html/forms/src/nsGfxListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxListControlFrame.cpp @@ -3892,7 +3892,7 @@ public: NS_DECL_ISUPPORTS nsSelectAutoScrollTimer() - : mTimer(0), mFrame(0), mPresContext(0), mPoint(0,0), mDelay(30) + : mFrame(0), mPresContext(0), mPoint(0,0), mDelay(30) { NS_INIT_ISUPPORTS(); } @@ -3902,7 +3902,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } } @@ -3914,7 +3913,8 @@ public: if (!mTimer) { - nsresult result = NS_NewTimer(&mTimer); + nsresult result; + mTimer = do_CreateInstance("component://netscape/timer", &result); if (NS_FAILED(result)) return result; @@ -3930,7 +3930,6 @@ public: if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); mTimer = 0; } @@ -3959,7 +3958,7 @@ public: private: nsGfxListControlFrame *mListControl; - nsITimer *mTimer; + nsCOMPtr mTimer; nsIFrame *mFrame; nsIPresContext *mPresContext; nsPoint mPoint; diff --git a/mozilla/layout/html/tests/Makefile.in b/mozilla/layout/html/tests/Makefile.in index 26d79aa4eff..caa654e7c9c 100644 --- a/mozilla/layout/html/tests/Makefile.in +++ b/mozilla/layout/html/tests/Makefile.in @@ -57,7 +57,6 @@ LIBS = \ $(DIST)/lib/libraptorxmldoc_s.$(LIB_SUFFIX) \ $(DIST)/lib/libraptorxulbase_s.$(LIB_SUFFIX) \ $(DIST)/lib/libraptorxulcontent_s.$(LIB_SUFFIX) \ - $(MOZ_TIMER_LIBS) \ $(MOZ_JS_LIBS) \ $(EXTRA_DSO_LIBS) \ $(TK_LIBS) \ diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 1cf8445808a..500dd6dd899 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -372,7 +372,7 @@ nsMenuFrame::HandleEvent(nsIPresContext* aPresContext, } // We're a menu, we're built, we're closed, and no timer has been kicked off. - NS_NewTimer(getter_AddRefs(mOpenTimer)); + mOpenTimer = do_CreateInstance("component://netscape/timer"); mOpenTimer->Init(this, menuDelay, NS_PRIORITY_HIGHEST); } } diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 37d950f7634..368a83904dc 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -892,7 +892,7 @@ NS_IMETHODIMP nsMenuPopupFrame::SetCurrentMenuItem(nsIMenuFrame* aMenuItem) } // Kick off the timer. - NS_NewTimer(getter_AddRefs(mCloseTimer)); + mCloseTimer = do_CreateInstance("component://netscape/timer"); mCloseTimer->Init(this, menuDelay, NS_PRIORITY_HIGHEST); mTimerMenu = mCurrentMenu; } diff --git a/mozilla/layout/xul/base/src/nsRepeatService.cpp b/mozilla/layout/xul/base/src/nsRepeatService.cpp index df4d8a02317..f914ceace84 100644 --- a/mozilla/layout/xul/base/src/nsRepeatService.cpp +++ b/mozilla/layout/xul/base/src/nsRepeatService.cpp @@ -57,7 +57,8 @@ void nsRepeatService::Start(nsITimerCallback* aCallback) return; mCallback = aCallback; - nsresult rv = NS_NewTimer(getter_AddRefs(mRepeatTimer)); + nsresult rv; + mRepeatTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK == rv) { mRepeatTimer->Init(this, INITAL_REPEAT_DELAY); @@ -88,7 +89,7 @@ NS_IMETHODIMP_(void) nsRepeatService::Notify(nsITimer *timer) // start timer again. if (mRepeatTimer) { - NS_NewTimer(getter_AddRefs(mRepeatTimer)); + mRepeatTimer = do_CreateInstance("component://netscape/timer"); mRepeatTimer->Init(this, REPEAT_DELAY); } diff --git a/mozilla/layout/xul/content/src/nsXULAtomList.h b/mozilla/layout/xul/content/src/nsXULAtomList.h index e80aec275c6..c59e3429098 100644 --- a/mozilla/layout/xul/content/src/nsXULAtomList.h +++ b/mozilla/layout/xul/content/src/nsXULAtomList.h @@ -45,7 +45,6 @@ XUL_ATOM(button, "button") XUL_ATOM(spinner, "spinner") XUL_ATOM(scrollbar, "scrollbar") XUL_ATOM(slider, "slider") -XUL_ATOM(colorpicker, "colorpicker") XUL_ATOM(palettename, "palettename") XUL_ATOM(fontpicker, "fontpicker") XUL_ATOM(text, "text") diff --git a/mozilla/mailnews/base/build/Makefile.in b/mozilla/mailnews/base/build/Makefile.in index 95f63ce3b6b..4cc9a53adbf 100644 --- a/mozilla/mailnews/base/build/Makefile.in +++ b/mozilla/mailnews/base/build/Makefile.in @@ -47,7 +47,6 @@ SHARED_LIBRARY_LIBS = \ EXTRA_DSO_LDOPTS = \ -L$(DIST)/lib \ $(DIST)/lib/librdfutil_s.$(LIB_SUFFIX) \ - $(MOZ_TIMER_LIBS) \ -L$(DIST)/bin \ $(EXTRA_DSO_LIBS) \ $(MOZ_JS_LIBS) \ diff --git a/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp b/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp index 0c415af250c..39053a00147 100644 --- a/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp @@ -414,13 +414,13 @@ nsresult nsMsgSearchSession::AddUrl(const char *url) nsresult nsMsgSearchSession::SearchWOUrls () { - nsresult err = NS_OK; - PRBool done; + nsresult err = NS_OK; + PRBool done; - NS_NewTimer(getter_AddRefs(m_backgroundTimer)); - m_backgroundTimer->Init(TimerCallback, (void *) this, 0, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_SLACK); - // ### start meteors? - err = TimeSlice(&done); + m_backgroundTimer = do_CreateInstance("component://netscape/timer", &err); + m_backgroundTimer->Init(TimerCallback, (void *) this, 0, NS_PRIORITY_NORMAL, NS_TYPE_REPEATING_SLACK); + // ### start meteors? + err = TimeSlice(&done); #if 0 if (!m_urlStruct) m_urlStruct = NET_CreateURLStruct ("search-libmsg:", NET_DONT_RELOAD); diff --git a/mozilla/mailnews/base/src/nsMsgBiffManager.cpp b/mozilla/mailnews/base/src/nsMsgBiffManager.cpp index 50bcb84f1df..63e4fa75d81 100644 --- a/mozilla/mailnews/base/src/nsMsgBiffManager.cpp +++ b/mozilla/mailnews/base/src/nsMsgBiffManager.cpp @@ -41,7 +41,6 @@ nsMsgBiffManager::nsMsgBiffManager() { NS_INIT_REFCNT(); - mBiffTimer = nsnull; mBiffArray = nsnull; mHaveShutdown = PR_FALSE; } @@ -53,7 +52,6 @@ nsMsgBiffManager::~nsMsgBiffManager() if (mBiffTimer) { mBiffTimer->Cancel(); } - NS_IF_RELEASE(mBiffTimer); PRInt32 count = mBiffArray->Count(); PRInt32 i; @@ -284,9 +282,8 @@ nsresult nsMsgBiffManager::SetupNextBiff() if(mBiffTimer) { mBiffTimer->Cancel(); - NS_RELEASE(mBiffTimer); } - NS_NewTimer(&mBiffTimer); + mBiffTimer = do_CreateInstance("component://netscape/timer"); mBiffTimer->Init(OnBiffTimer, (void*)this, timeInMSUint32); } diff --git a/mozilla/mailnews/base/src/nsMsgBiffManager.h b/mozilla/mailnews/base/src/nsMsgBiffManager.h index 84c25e10dc6..751a68c6ab2 100644 --- a/mozilla/mailnews/base/src/nsMsgBiffManager.h +++ b/mozilla/mailnews/base/src/nsMsgBiffManager.h @@ -66,7 +66,7 @@ protected: nsresult AddBiffEntry(nsBiffEntry *biffEntry); protected: - nsITimer *mBiffTimer; + nsCOMPtr mBiffTimer; nsVoidArray *mBiffArray; PRBool mHaveShutdown; }; diff --git a/mozilla/mailnews/base/tests/identity/Makefile.in b/mozilla/mailnews/base/tests/identity/Makefile.in index b1147ab7602..79cd266932b 100644 --- a/mozilla/mailnews/base/tests/identity/Makefile.in +++ b/mozilla/mailnews/base/tests/identity/Makefile.in @@ -32,7 +32,6 @@ CPPSRCS = identity.cpp LIBS = \ -L$(DIST)/bin \ $(XPCOM_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/compose/tests/compose/Makefile.in b/mozilla/mailnews/compose/tests/compose/Makefile.in index ef58c7f8f96..78873e0fc57 100644 --- a/mozilla/mailnews/compose/tests/compose/Makefile.in +++ b/mozilla/mailnews/compose/tests/compose/Makefile.in @@ -39,7 +39,6 @@ endif LIBS = \ $(EXTRA_DSO_LIBS) \ $(XPCOM_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/compose/tests/compose2/Makefile.in b/mozilla/mailnews/compose/tests/compose2/Makefile.in index 2ad1e2e17f3..293701541d2 100644 --- a/mozilla/mailnews/compose/tests/compose2/Makefile.in +++ b/mozilla/mailnews/compose/tests/compose2/Makefile.in @@ -37,7 +37,6 @@ EXTRA_DSO_LIBS = raptorgfx msgbaseutil endif LIBS = \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(XPCOM_LIBS) \ $(MOZ_JS_LIBS) \ diff --git a/mozilla/mailnews/compose/tests/geturl/Makefile.in b/mozilla/mailnews/compose/tests/geturl/Makefile.in index 36a2661588f..b88a7d640a0 100644 --- a/mozilla/mailnews/compose/tests/geturl/Makefile.in +++ b/mozilla/mailnews/compose/tests/geturl/Makefile.in @@ -34,7 +34,6 @@ CPPSRCS = \ $(NULL) LIBS = \ - $(MOZ_TIMER_LIBS) \ $(XPCOM_LIBS) \ $(MOZ_JS_LIBS) \ $(NSPR_LIBS) \ diff --git a/mozilla/mailnews/compose/tests/sendlater/Makefile.in b/mozilla/mailnews/compose/tests/sendlater/Makefile.in index 5a536bf13b2..dc5a70faba8 100644 --- a/mozilla/mailnews/compose/tests/sendlater/Makefile.in +++ b/mozilla/mailnews/compose/tests/sendlater/Makefile.in @@ -37,7 +37,6 @@ EXTRA_DSO_LIBS = raptorgfx msgbaseutil endif LIBS = \ - $(MOZ_TIMER_LIBS) \ $(EXTRA_DSO_LIBS) \ $(XPCOM_LIBS) \ $(MOZ_JS_LIBS) \ diff --git a/mozilla/mailnews/compose/tests/sendpage/Makefile.in b/mozilla/mailnews/compose/tests/sendpage/Makefile.in index 0fe0f74fab8..8f90e04d211 100644 --- a/mozilla/mailnews/compose/tests/sendpage/Makefile.in +++ b/mozilla/mailnews/compose/tests/sendpage/Makefile.in @@ -37,7 +37,6 @@ EXTRA_DSO_LIBS = msgbaseutil endif LIBS = \ - $(MOZ_TIMER_LIBS) \ $(EXTRA_DSO_LIBS) \ $(XPCOM_LIBS) \ $(MOZ_JS_LIBS) \ diff --git a/mozilla/mailnews/compose/tests/smtp/Makefile.in b/mozilla/mailnews/compose/tests/smtp/Makefile.in index 176ff491240..1c2355a3b00 100644 --- a/mozilla/mailnews/compose/tests/smtp/Makefile.in +++ b/mozilla/mailnews/compose/tests/smtp/Makefile.in @@ -32,7 +32,6 @@ CPPSRCS = smtpTest.cpp LIBS = \ $(XPCOM_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/imap/tests/harness/Makefile.in b/mozilla/mailnews/imap/tests/harness/Makefile.in index a070cec7b77..f24e373650e 100644 --- a/mozilla/mailnews/imap/tests/harness/Makefile.in +++ b/mozilla/mailnews/imap/tests/harness/Makefile.in @@ -43,7 +43,6 @@ LIBS = \ -L$(DIST)/bin \ $(XPCOM_LIBS) \ $(EXTRA_DSO_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/local/tests/pop3/Makefile.in b/mozilla/mailnews/local/tests/pop3/Makefile.in index bda38a858e8..9cafce4acd8 100644 --- a/mozilla/mailnews/local/tests/pop3/Makefile.in +++ b/mozilla/mailnews/local/tests/pop3/Makefile.in @@ -38,7 +38,6 @@ endif LIBS = \ $(EXTRA_DSO_LIBS) \ $(XPCOM_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/mime/tests/mimetest/Makefile.in b/mozilla/mailnews/mime/tests/mimetest/Makefile.in index c4870c591ee..65a83edebea 100644 --- a/mozilla/mailnews/mime/tests/mimetest/Makefile.in +++ b/mozilla/mailnews/mime/tests/mimetest/Makefile.in @@ -33,7 +33,6 @@ LIBS = \ -L$(DIST)/bin \ -lmozjs \ $(XPCOM_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/news/build/Makefile.in b/mozilla/mailnews/news/build/Makefile.in index a5eb72676be..8ca3467f7dd 100644 --- a/mozilla/mailnews/news/build/Makefile.in +++ b/mozilla/mailnews/news/build/Makefile.in @@ -47,7 +47,6 @@ EXTRA_DSO_LDOPTS = \ -L$(DIST)/bin \ -L$(DIST)/lib \ $(EXTRA_DSO_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(MOZ_JS_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) diff --git a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp index 5baef61efa1..a1f7185f863 100644 --- a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp @@ -2930,8 +2930,8 @@ PRInt32 nsNNTPProtocol::ReadNewsList(nsIInputStream * inputStream, PRUint32 leng if (mUpdateTimer) { mUpdateTimer->Cancel(); mUpdateTimer = nsnull; - } - rv = NS_NewTimer(getter_AddRefs(mUpdateTimer)); + } + mUpdateTimer = do_CreateInstance("component://netscape/timer", &rv); NS_ASSERTION(NS_SUCCEEDED(rv),"failed to create timer"); if (NS_FAILED(rv)) return -1; diff --git a/mozilla/mailnews/news/tests/newsParser/Makefile.in b/mozilla/mailnews/news/tests/newsParser/Makefile.in index 4dd336a7540..e5b719136ba 100644 --- a/mozilla/mailnews/news/tests/newsParser/Makefile.in +++ b/mozilla/mailnews/news/tests/newsParser/Makefile.in @@ -30,7 +30,6 @@ PROGRAM = newsParserTest CPPSRCS = newsParserTest.cpp LIBS = \ - $(MOZ_TIMER_LIBS) \ $(DIST)/lib/libmsgnews_s.a \ -lmozjs \ -lraptorgfx \ diff --git a/mozilla/mailnews/news/tests/nntp/Makefile.in b/mozilla/mailnews/news/tests/nntp/Makefile.in index 053ef4bb2b5..057c43a9aa4 100644 --- a/mozilla/mailnews/news/tests/nntp/Makefile.in +++ b/mozilla/mailnews/news/tests/nntp/Makefile.in @@ -35,7 +35,6 @@ LIBS = \ -lxpcom \ -lmozjs \ -lmsgbaseutil \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/netwerk/test/TestSocketTransport.cpp b/mozilla/netwerk/test/TestSocketTransport.cpp index d918f9c86b8..64007508a79 100644 --- a/mozilla/netwerk/test/TestSocketTransport.cpp +++ b/mozilla/netwerk/test/TestSocketTransport.cpp @@ -608,9 +608,8 @@ void TimerCallback(nsITimer* aTimer, void* aClosure) } flag = !flag; - NS_RELEASE(gPeriodicTimer); - - if (NS_OK == NS_NewTimer(&gPeriodicTimer)) { + gPeriodicTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_SUCCEEDED(rv)) { gPeriodicTimer->Init(TimerCallback, nsnull, 1000*5); } } @@ -702,7 +701,9 @@ main(int argc, char* argv[]) // // Start up the timer to test Suspend/Resume APIs on the transport... // - if (NS_OK == NS_NewTimer(&gPeriodicTimer)) { + nsresult rv; + gPeriodicTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_SUCCEEDED(rv)) { gPeriodicTimer->Init(TimerCallback, nsnull, 1000); } #endif /* USE_TIMERS */ diff --git a/mozilla/profile/src/nsProfile.cpp b/mozilla/profile/src/nsProfile.cpp index e37d956413e..f0b77ccc738 100644 --- a/mozilla/profile/src/nsProfile.cpp +++ b/mozilla/profile/src/nsProfile.cpp @@ -623,7 +623,7 @@ nsProfile::ProcessArgs(nsICmdLineService *cmdLineArgs, } /* hack so we don't do this for tinderbox. otherwise the tree goes orange */ -#if !defined(DEBUG_cltbld) && !defined(MOZ_BYPASS_PROFILE_AT_STARTUP) +#if !defined(DEBUG_cltbld) && !defined(MOZ_BYPASS_PROFILE_AT_STARTUP) && !defined(DEBUG_pavlov) #ifdef DEBUG if (profileURLStr.Length() == 0) { printf("DEBUG BUILDS ONLY: we are forcing you to use the profile manager to help smoke test it.\n"); diff --git a/mozilla/rdf/build/Makefile.in b/mozilla/rdf/build/Makefile.in index 502ff617797..223cc615e61 100644 --- a/mozilla/rdf/build/Makefile.in +++ b/mozilla/rdf/build/Makefile.in @@ -50,7 +50,6 @@ SHARED_LIBRARY_LIBS = \ $(NULL) EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ -L$(DIST)/bin \ $(EXTRA_DSO_LIBS) \ $(MOZ_JS_LIBS) \ diff --git a/mozilla/rdf/chrome/build/Makefile.in b/mozilla/rdf/chrome/build/Makefile.in index 56ea98eaaba..532f26f978e 100644 --- a/mozilla/rdf/chrome/build/Makefile.in +++ b/mozilla/rdf/chrome/build/Makefile.in @@ -42,9 +42,5 @@ EXTRA_DSO_LDOPTS = \ $(MOZ_COMPONENT_LIBS) \ $(NULL) -ifeq ($(OS_ARCH),os2) -EXTRA_DSO_LDOPTS += $(MOZ_TIMER_LIBS) -endif - include $(topsrcdir)/config/rules.mk diff --git a/mozilla/rdf/content/src/nsXULPopupListener.cpp b/mozilla/rdf/content/src/nsXULPopupListener.cpp index 1025915fdbc..fdcac06bdfa 100644 --- a/mozilla/rdf/content/src/nsXULPopupListener.cpp +++ b/mozilla/rdf/content/src/nsXULPopupListener.cpp @@ -280,7 +280,7 @@ XULPopupListenerImpl::MouseMove(nsIDOMEvent* aMouseEvent) if (mPopupContent || mTooltipTimer) return NS_OK; - NS_NewTimer ( getter_AddRefs(mTooltipTimer) ); + mTooltipTimer = do_CreateInstance("component://netscape/timer"); if ( mTooltipTimer ) { nsCOMPtr eventTarget; nsCOMPtr eventTargetNode; diff --git a/mozilla/rdf/tests/rdfcat/Makefile.in b/mozilla/rdf/tests/rdfcat/Makefile.in index 777560e22e5..6f507d8b20f 100644 --- a/mozilla/rdf/tests/rdfcat/Makefile.in +++ b/mozilla/rdf/tests/rdfcat/Makefile.in @@ -30,7 +30,6 @@ PROGRAM = rdfcat$(BIN_SUFFIX) CPPSRCS = rdfcat.cpp LIBS = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_JS_LIBS) \ $(XPCOM_LIBS) \ $(NSPR_LIBS) \ diff --git a/mozilla/rdf/tests/rdfpoll/Makefile.in b/mozilla/rdf/tests/rdfpoll/Makefile.in index 608bd025808..2848a6c7cf1 100644 --- a/mozilla/rdf/tests/rdfpoll/Makefile.in +++ b/mozilla/rdf/tests/rdfpoll/Makefile.in @@ -30,7 +30,6 @@ PROGRAM = rdfpoll$(BIN_SUFFIX) CPPSRCS = rdfpoll.cpp LIBS = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_JS_LIBS) \ $(XPCOM_LIBS) \ $(TK_LIBS) \ diff --git a/mozilla/view/src/Makefile.in b/mozilla/view/src/Makefile.in index 49f03f10fae..8bd5cc977db 100644 --- a/mozilla/view/src/Makefile.in +++ b/mozilla/view/src/Makefile.in @@ -51,7 +51,6 @@ REQUIRES = raptor xpcom EXTRA_DSO_LDOPTS = \ -L$(DIST)/bin \ $(EXTRA_DSO_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) diff --git a/mozilla/view/src/nsScrollingView.cpp b/mozilla/view/src/nsScrollingView.cpp index 6f26f790a9b..2a1f5f87a99 100644 --- a/mozilla/view/src/nsScrollingView.cpp +++ b/mozilla/view/src/nsScrollingView.cpp @@ -372,7 +372,6 @@ nsScrollingView::nsScrollingView() mHScrollBarView = nsnull; mCornerView = nsnull; mScrollPref = nsScrollPreference_kAuto; - mScrollingTimer = nsnull; mLineHeight = 240; mListeners = nsnull; } @@ -394,10 +393,9 @@ nsScrollingView::~nsScrollingView() mClipView = nsnull; mCornerView = nsnull; - if (nsnull != mScrollingTimer) + if (mScrollingTimer) { mScrollingTimer->Cancel(); - NS_RELEASE(mScrollingTimer); } if (nsnull != mListeners) { @@ -791,9 +789,9 @@ NS_IMETHODIMP_(void) nsScrollingView::Notify(nsITimer * aTimer) NS_RELEASE(obs); } - NS_RELEASE(mScrollingTimer); - - if (NS_OK == NS_NewTimer(&mScrollingTimer)) + nsresult rv; + mScrollingTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_SUCCEEDED(rv)) mScrollingTimer->Init(this, 25); } diff --git a/mozilla/view/src/nsScrollingView.h b/mozilla/view/src/nsScrollingView.h index 5e8130028b7..150a630b6e9 100644 --- a/mozilla/view/src/nsScrollingView.h +++ b/mozilla/view/src/nsScrollingView.h @@ -133,7 +133,7 @@ protected: nsIView *mCornerView; nsScrollPreference mScrollPref; nsMargin mInsets; - nsITimer *mScrollingTimer; + nsCOMPtr mScrollingTimer; nscoord mScrollingDelta; PRUint32 mScrollProperties; nscoord mLineHeight; diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 615409d761c..7299b9f055a 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -135,7 +135,6 @@ nsViewManager :: ~nsViewManager() if (nsnull != mTimer) { mTimer->Cancel(); //XXX this should not be necessary. MMP - NS_RELEASE(mTimer); } #endif @@ -276,9 +275,6 @@ NS_IMETHODIMP nsViewManager :: Init(nsIDeviceContext* aContext, nscoord aX, nsco return NS_ERROR_ALREADY_INITIALIZED; } mContext = aContext; -#ifdef NS_VIEWMANAGER_NEEDS_TIMER - mTimer = nsnull; -#endif mFrameRate = 0; mTrueFrameRate = 0; mTransCnt = 0; @@ -366,7 +362,6 @@ NS_IMETHODIMP nsViewManager :: SetFrameRate(PRUint32 aFrameRate) if (nsnull != mTimer) { mTimer->Cancel(); //XXX this should not be necessary. MMP - NS_RELEASE(mTimer); } #endif @@ -376,7 +371,7 @@ NS_IMETHODIMP nsViewManager :: SetFrameRate(PRUint32 aFrameRate) if (mFrameRate != 0) { #ifdef NS_VIEWMANAGER_NEEDS_TIMER - rv = NS_NewTimer(&mTimer); + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK == rv) mTimer->Init(vm_timer_callback, this, 1000 / mFrameRate); diff --git a/mozilla/view/src/nsViewManager.h b/mozilla/view/src/nsViewManager.h index 531372d0ddb..7a16c3ffc54 100644 --- a/mozilla/view/src/nsViewManager.h +++ b/mozilla/view/src/nsViewManager.h @@ -274,7 +274,7 @@ private: public: //these are public so that our timer callback can poke them. #if NS_VIEWMANAGER_NEEDS_TIMER - nsITimer *mTimer; + nsCOMPtr mTimer; #endif nsRect mDirtyRect; nsIView *mRootView; diff --git a/mozilla/view/src/nsViewManager2.cpp b/mozilla/view/src/nsViewManager2.cpp index dcb103e4c57..b9b29104016 100755 --- a/mozilla/view/src/nsViewManager2.cpp +++ b/mozilla/view/src/nsViewManager2.cpp @@ -154,7 +154,6 @@ nsViewManager2::~nsViewManager2() #ifdef NS_VIEWMANAGER_NEEDS_TIMER if (nsnull != mTimer) { mTimer->Cancel(); //XXX this should not be necessary. MMP - NS_RELEASE(mTimer); } #endif @@ -300,9 +299,6 @@ NS_IMETHODIMP nsViewManager2::Init(nsIDeviceContext* aContext, nscoord aX, nscoo mContext->GetAppUnitsToDevUnits(mTwipsToPixels); mContext->GetDevUnitsToAppUnits(mPixelsToTwips); -#ifdef NS_VIEWMANAGER_NEEDS_TIMER - mTimer = nsnull; -#endif mFrameRate = 0; mTrueFrameRate = 0; mTransCnt = 0; @@ -389,7 +385,6 @@ NS_IMETHODIMP nsViewManager2::SetFrameRate(PRUint32 aFrameRate) if (nsnull != mTimer) { mTimer->Cancel(); //XXX this should not be necessary. MMP - NS_RELEASE(mTimer); } #endif @@ -399,10 +394,10 @@ NS_IMETHODIMP nsViewManager2::SetFrameRate(PRUint32 aFrameRate) if (mFrameRate != 0) { #ifdef NS_VIEWMANAGER_NEEDS_TIMER - rv = NS_NewTimer(&mTimer); + mTimer = do_CreateInstance("component://netscape/timer", &rv); - if (NS_OK == rv) - mTimer->Init(vm_timer_callback, this, 1000 / mFrameRate); + if (NS_OK == rv) + mTimer->Init(vm_timer_callback, this, 1000 / mFrameRate); #endif } diff --git a/mozilla/view/src/nsViewManager2.h b/mozilla/view/src/nsViewManager2.h index 9800a0047cf..7360d9982e0 100755 --- a/mozilla/view/src/nsViewManager2.h +++ b/mozilla/view/src/nsViewManager2.h @@ -352,7 +352,7 @@ private: public: //these are public so that our timer callback can poke them. #ifdef NS_VIEWMANAGER_NEEDS_TIMER - nsITimer *mTimer; + nsCOMPtr mTimer; #endif nsRect mDirtyRect; nsIView *mRootView; diff --git a/mozilla/webshell/embed/gtk/mozilla_config.mk.in b/mozilla/webshell/embed/gtk/mozilla_config.mk.in index 07aeea692b6..d48302cdefd 100644 --- a/mozilla/webshell/embed/gtk/mozilla_config.mk.in +++ b/mozilla/webshell/embed/gtk/mozilla_config.mk.in @@ -19,5 +19,4 @@ # Contributor(s): # -MOZ_TIMER_LIBS=@MOZ_TIMER_LIBS@ diff --git a/mozilla/webshell/embed/xlib/gtk/Makefile.in b/mozilla/webshell/embed/xlib/gtk/Makefile.in index 6c0f2c993d2..db105cf11a3 100644 --- a/mozilla/webshell/embed/xlib/gtk/Makefile.in +++ b/mozilla/webshell/embed/xlib/gtk/Makefile.in @@ -35,7 +35,6 @@ CPPSRCS = \ LIBS = \ -lraptorgfx \ - $(MOZ_TIMER_LIBS) \ $(NETLIB_LIBS) \ -lmozjs \ $(XPCOM_LIBS) \ diff --git a/mozilla/webshell/embed/xlib/motif/Makefile.in b/mozilla/webshell/embed/xlib/motif/Makefile.in index 7b1e9dcbf7d..b883b0a7758 100644 --- a/mozilla/webshell/embed/xlib/motif/Makefile.in +++ b/mozilla/webshell/embed/xlib/motif/Makefile.in @@ -37,7 +37,6 @@ CPPSRCS = \ LIBS = \ -lraptorgfx \ - $(MOZ_TIMER_LIBS) \ $(NETLIB_LIBS) \ -lmozjs \ $(XPCOM_LIBS) \ diff --git a/mozilla/webshell/embed/xlib/qt/Makefile.in b/mozilla/webshell/embed/xlib/qt/Makefile.in index 4291a58509c..ce57f03956c 100644 --- a/mozilla/webshell/embed/xlib/qt/Makefile.in +++ b/mozilla/webshell/embed/xlib/qt/Makefile.in @@ -44,7 +44,6 @@ CPPSRCS = \ LIBS = \ -lraptorgfx \ - $(MOZ_TIMER_LIBS) \ $(NETLIB_LIBS) \ -lmozjs \ $(XPCOM_LIBS) \ diff --git a/mozilla/webshell/embed/xlib/xt/Makefile.in b/mozilla/webshell/embed/xlib/xt/Makefile.in index 1102ef387e9..a8e8d9ea6ee 100644 --- a/mozilla/webshell/embed/xlib/xt/Makefile.in +++ b/mozilla/webshell/embed/xlib/xt/Makefile.in @@ -36,7 +36,6 @@ CPPSRCS = \ LIBS = \ -lraptorgfx \ - $(MOZ_TIMER_LIBS) \ $(NETLIB_LIBS) \ -lmozjs \ $(XPCOM_LIBS) \ diff --git a/mozilla/webshell/src/Makefile.in b/mozilla/webshell/src/Makefile.in index ef1ee8254dd..d62ba358ab9 100644 --- a/mozilla/webshell/src/Makefile.in +++ b/mozilla/webshell/src/Makefile.in @@ -42,7 +42,6 @@ CPPSRCS = \ $(NULL) EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ -L$(DIST)/bin \ $(EXTRA_DSO_LIBS) \ $(MOZ_JS_LIBS) \ diff --git a/mozilla/webshell/tests/viewer/Makefile.in b/mozilla/webshell/tests/viewer/Makefile.in index 35fbc956493..8b55bddf783 100644 --- a/mozilla/webshell/tests/viewer/Makefile.in +++ b/mozilla/webshell/tests/viewer/Makefile.in @@ -108,7 +108,6 @@ XP_DIST_LIBS = \ $(NULL) XP_NS_UNDERBAR_CRAP = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_WIDGET_SUPPORT_LIBS) \ $(NULL) diff --git a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp index b7fbd42aefc..e052021b89a 100644 --- a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp @@ -211,7 +211,7 @@ NS_SetupRegistry() NS_FILESPECWITHUI_PROGID, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponentLib(kCFilePickerCID, "FilePicker", "component://mozilla/filepicker", WIDGET_DLL, PR_FALSE, PR_FALSE); #ifdef XP_PC - nsComponentManager::RegisterComponentLib(kCTimerCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); + nsComponentManager::RegisterComponentLib(kCTimerCID, "Timer", "component://netscape/timer", WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponentLib(kCTimerManagerCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); #endif diff --git a/mozilla/webshell/tests/viewer/nsThrobber.cpp b/mozilla/webshell/tests/viewer/nsThrobber.cpp index 87c45f2dd4d..87e8f7b411b 100644 --- a/mozilla/webshell/tests/viewer/nsThrobber.cpp +++ b/mozilla/webshell/tests/viewer/nsThrobber.cpp @@ -313,9 +313,9 @@ nsThrobber::Tick() } #ifndef REPEATING_TIMERS - NS_RELEASE(mTimer); - nsresult rv = NS_NewTimer(&mTimer); + nsresult rv; + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK == rv) { mTimer->Init(ThrobTimerCallback, this, 33); } @@ -341,7 +341,7 @@ nsThrobber::LoadThrobberImages(const nsString& aFileNameMask, PRInt32 aNumImages mImageGroup->Init(deviceCtx, nsnull); NS_RELEASE(deviceCtx); - rv = NS_NewTimer(&mTimer); + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_OK != rv) { return rv; } @@ -373,7 +373,6 @@ nsThrobber::DestroyThrobberImages() { if (mTimer) { mTimer->Cancel(); - NS_RELEASE(mTimer); } if (mImageGroup) { diff --git a/mozilla/webshell/tests/viewer/nsThrobber.h b/mozilla/webshell/tests/viewer/nsThrobber.h index 2a0d6f2b5f8..17875fcdd4a 100644 --- a/mozilla/webshell/tests/viewer/nsThrobber.h +++ b/mozilla/webshell/tests/viewer/nsThrobber.h @@ -27,9 +27,10 @@ #include "nsIWidget.h" #include "nsVoidArray.h" #include "nsCRT.h" +#include "nsCOMPtr.h" +#include "nsITimer.h" class nsIImageGroup; -class nsITimer; struct nsRect; class nsThrobber : public nsIImageRequestObserver { @@ -78,7 +79,7 @@ protected: PRInt32 mNumImages; PRInt32 mIndex; nsIImageGroup* mImageGroup; - nsITimer* mTimer; + nsCOMPtr mTimer; PRBool mRunning; PRUint32 mCompletedImages; diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index a3b6ff6ac6b..805d902af72 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -175,7 +175,6 @@ nsWebCrawler::nsWebCrawler(nsViewerApp* aViewer) mBrowser = nsnull; mViewer = aViewer; - mTimer = nsnull; mCrawl = PR_FALSE; mJiggleLayout = PR_FALSE; mPostExit = PR_FALSE; @@ -210,7 +209,6 @@ nsWebCrawler::~nsWebCrawler() FreeStrings(mSafeDomains); FreeStrings(mAvoidDomains); NS_IF_RELEASE(mBrowser); - NS_IF_RELEASE(mTimer); delete mVisited; } @@ -809,8 +807,7 @@ void nsWebCrawler::LoadNextURL(PRBool aQueueLoad) { if (0 != mDelay) { - NS_IF_RELEASE(mTimer); - NS_NewTimer(&mTimer); + mTimer = do_CreateInstance("component://netscape/timer"); mTimer->Init(TimerCallBack, (void *)this, mDelay * 1000); } diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.h b/mozilla/webshell/tests/viewer/nsWebCrawler.h index 2ab187dba14..9be8c6d9976 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.h +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.h @@ -145,7 +145,7 @@ protected: nsCOMPtr mDocLoader; nsBrowserWindow* mBrowser; nsViewerApp* mViewer; - nsITimer* mTimer; + nsCOMPtr mTimer; FILE* mRecord; nsCOMPtr mLinkTag; nsCOMPtr mFrameTag; diff --git a/mozilla/widget/src/beos/Makefile.in b/mozilla/widget/src/beos/Makefile.in index 445ba539d14..81f83c1b30f 100644 --- a/mozilla/widget/src/beos/Makefile.in +++ b/mozilla/widget/src/beos/Makefile.in @@ -64,7 +64,6 @@ SHARED_LIBRARY_LIBS = $(DIST)/lib/libraptorbasewidget_s.a EXTRA_DSO_LDOPTS = \ $(TOOLKIT_DSO_LDOPTS) \ $(MOZ_COMPONENT_LIBS) \ - $(MOZ_TIMER_LIBS) \ -lraptorgfx \ $(TK_LIBS) \ $(NULL) diff --git a/mozilla/widget/src/gtk/Makefile.in b/mozilla/widget/src/gtk/Makefile.in index 682506ef33b..19d1aaf1e5a 100644 --- a/mozilla/widget/src/gtk/Makefile.in +++ b/mozilla/widget/src/gtk/Makefile.in @@ -59,7 +59,6 @@ SHARED_LIBRARY_LIBS = $(DIST)/lib/libraptorbasewidget_s.a EXTRA_DSO_LDOPTS = \ $(MOZ_COMPONENT_LIBS) \ -lraptorgfx \ - $(MOZ_TIMER_LIBS) \ $(NULL) ifndef MOZ_MONOLITHIC_TOOLKIT diff --git a/mozilla/widget/src/gtk/nsWidget.cpp b/mozilla/widget/src/gtk/nsWidget.cpp index b6a0f229966..ef068cbc710 100644 --- a/mozilla/widget/src/gtk/nsWidget.cpp +++ b/mozilla/widget/src/gtk/nsWidget.cpp @@ -123,7 +123,6 @@ nsresult nsWidget::KillICSpotTimer () if(mICSpotTimer) { mICSpotTimer->Cancel(); - NS_RELEASE(mICSpotTimer); mICSpotTimer = nsnull; } return NS_OK; @@ -131,9 +130,10 @@ nsresult nsWidget::KillICSpotTimer () nsresult nsWidget::PrimeICSpotTimer () { KillICSpotTimer(); - nsresult err = NS_NewTimer(&mICSpotTimer); - if(NS_FAILED(err)) - return err; + nsresult err; + mICSpotTimer = do_CreateInstance("component://netscape/timer", &err); + if (NS_FAILED(err)) + return err; mICSpotTimer->Init(ICSpotCallback, this, 1000); return NS_OK; } diff --git a/mozilla/widget/src/gtk/nsWidget.h b/mozilla/widget/src/gtk/nsWidget.h index 61c1276c0d0..e4e7d7d4d40 100644 --- a/mozilla/widget/src/gtk/nsWidget.h +++ b/mozilla/widget/src/gtk/nsWidget.h @@ -351,7 +351,7 @@ protected: void IMECheckPreedit_PostProc(); void GetXYFromPosition(unsigned long *aX, unsigned long *aY); - nsITimer *mICSpotTimer; + nsCOMPtr mICSpotTimer; static void ICSpotCallback(nsITimer* aTimer, void* aClosure); nsresult KillICSpotTimer(); nsresult PrimeICSpotTimer(); diff --git a/mozilla/widget/src/mac/Makefile.in b/mozilla/widget/src/mac/Makefile.in index 66df25d86d1..b9ee936e77f 100644 --- a/mozilla/widget/src/mac/Makefile.in +++ b/mozilla/widget/src/mac/Makefile.in @@ -63,7 +63,6 @@ CPPSRCS = nsAppShell.cpp \ include $(topsrcdir)/config/rules.mk EXTRA_DSO_LDOPTS += \ - $(MOZ_TIMER_LIBS) \ $(DIST)/lib/libraptorbasewidget_s.a \ $(TK_LIBS) \ -lraptorgfx \ diff --git a/mozilla/widget/src/os2/Makefile.in b/mozilla/widget/src/os2/Makefile.in index 85821c8e6b8..b3ef40cae12 100644 --- a/mozilla/widget/src/os2/Makefile.in +++ b/mozilla/widget/src/os2/Makefile.in @@ -80,7 +80,6 @@ CPPSRCS = \ SHARED_LIBRARY_LIBS = $(DIST)/lib/libraptorbasewidget_s.$(LIB_SUFFIX) EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) diff --git a/mozilla/widget/tests/scribble/Makefile.in b/mozilla/widget/tests/scribble/Makefile.in index 8e3cc943c71..2a4c41efabc 100644 --- a/mozilla/widget/tests/scribble/Makefile.in +++ b/mozilla/widget/tests/scribble/Makefile.in @@ -35,7 +35,6 @@ CPPSRCS = \ LIBS = \ $(MOZ_WIDGET_SUPPORT_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(XPCOM_LIBS) \ -lmozjs \ -lraptorgfx \ diff --git a/mozilla/widget/tests/widget/Makefile.in b/mozilla/widget/tests/widget/Makefile.in index 3cd9a924974..e3da2e85475 100644 --- a/mozilla/widget/tests/widget/Makefile.in +++ b/mozilla/widget/tests/widget/Makefile.in @@ -34,7 +34,6 @@ CPPSRCS = \ $(NULL) LIBS = \ - $(MOZ_TIMER_LIBS) \ $(MOZ_WIDGET_SUPPORT_LIBS) \ $(XPCOM_LIBS) \ -lmozjs \ diff --git a/mozilla/widget/timer/public/nsITimer.h b/mozilla/widget/timer/public/nsITimer.h index 583294f43cb..a92c2328cb6 100644 --- a/mozilla/widget/timer/public/nsITimer.h +++ b/mozilla/widget/timer/public/nsITimer.h @@ -139,26 +139,4 @@ public: NS_IMETHOD_(void*) GetClosure()=0; }; -// -// Factory method for creating an nsITimer -// -// Warning: This function should NOT be defined with NS_TIMER because -// the intention is that it be linked statically with the library/DLL -// or app that uses it. -#ifdef XP_UNIX -inline nsresult NS_NewTimer(nsITimer **aInstancePtrResult) -{ - nsresult rv; - nsCOMPtr timer = do_CreateInstance("component://netscape/timer", &rv); - if (NS_SUCCEEDED(rv)) { - *aInstancePtrResult = timer; - NS_ADDREF(*aInstancePtrResult); - } - return rv; -} -#else -extern nsresult NS_NewTimer(nsITimer** aInstancePtrResult); -#endif - - #endif // nsITimer_h___ diff --git a/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp b/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp index 5f84c8cd47d..c424d26ca31 100644 --- a/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp +++ b/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp @@ -24,9 +24,13 @@ #include "nsIModule.h" #include "nsCOMPtr.h" -#include "nsUnixTimerCIID.h" #include "nsTimerGtk.h" +// {48B62AD2-48D3-11d3-B224-000064657374} +#define NS_TIMER_GTK_CID \ +{ 0x48b62ad2, 0x48d3, 0x11d3, \ + { 0xb2, 0x24, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } } + NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimerGtk) static nsModuleComponentInfo components[] = diff --git a/mozilla/widget/timer/src/unix/nsUnixTimerCIID.h b/mozilla/widget/timer/src/unix/nsUnixTimerCIID.h index 40dd63d56ea..36373de5930 100644 --- a/mozilla/widget/timer/src/unix/nsUnixTimerCIID.h +++ b/mozilla/widget/timer/src/unix/nsUnixTimerCIID.h @@ -30,11 +30,6 @@ { 0x48b62ad1, 0x48d3, 0x11d3, \ { 0xb2, 0x24, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } } -// {48B62AD2-48D3-11d3-B224-000064657374} -#define NS_TIMER_GTK_CID \ -{ 0x48b62ad2, 0x48d3, 0x11d3, \ - { 0xb2, 0x24, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } } - // {48B62AD3-48D3-11d3-B224-000064657374} #define NS_TIMER_XLIB_CID \ { 0x48b62ad3, 0x48d3, 0x11d3, \ diff --git a/mozilla/xpcom/tests/Makefile.in b/mozilla/xpcom/tests/Makefile.in index 01254576676..d287121c060 100644 --- a/mozilla/xpcom/tests/Makefile.in +++ b/mozilla/xpcom/tests/Makefile.in @@ -69,7 +69,6 @@ CPPSRCS += \ endif LIBS += \ - $(MOZ_TIMER_LIBS) \ $(MOZ_JS_LIBS) \ $(XPCOM_LIBS) \ $(TK_LIBS) \ diff --git a/mozilla/xpcom/tests/RegFactory.cpp b/mozilla/xpcom/tests/RegFactory.cpp index 8809a86774b..976c3e4a839 100644 --- a/mozilla/xpcom/tests/RegFactory.cpp +++ b/mozilla/xpcom/tests/RegFactory.cpp @@ -132,18 +132,3 @@ int main(int argc, char *argv[]) return ret; } - -#ifdef XP_UNIX -/* The timer code doesn't get linked in. Some components link with libraries - * in bin/ directory that assume that app that they are used in has libtimer_s.a - * So ensure libtimer_s.a gets linked in. - */ -#include "nsITimer.h" - -void dummy() -{ - nsITimer *timer; - (void) NS_NewTimer(&timer); - NS_IF_RELEASE(timer); -} -#endif /* XP_UNIX */ diff --git a/mozilla/xpfe/appshell/src/Makefile.in b/mozilla/xpfe/appshell/src/Makefile.in index 22e48bd3169..26c56970565 100644 --- a/mozilla/xpfe/appshell/src/Makefile.in +++ b/mozilla/xpfe/appshell/src/Makefile.in @@ -65,7 +65,6 @@ EXTRA_DSO_LDOPTS = \ $(MOZ_NECKO_UTIL_LIBS) \ $(FULLCIRCLE_LIBS) \ $(MOZ_COMPONENT_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(MOZ_JS_LIBS) \ $(NULL) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 82465337c2c..fa85fb5c0bd 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -1179,11 +1179,14 @@ nsWebShellWindow::SetPersistenceTimer(PRBool aSize, PRBool aPosition) mSPTimerSize |= aSize; mSPTimerPosition |= aPosition; } else { - if (NS_SUCCEEDED(NS_NewTimer(getter_AddRefs(mSPTimer)))) + nsresult rv; + mSPTimer = do_CreateInstance("component://netscape/timer", &rv); + if (NS_SUCCEEDED(rv)) { mSPTimer->Init(FirePersistenceTimer, this, SIZE_PERSISTENCE_TIMEOUT, NS_TYPE_ONE_SHOT); mSPTimerSize = aSize; mSPTimerPosition = aPosition; + } } PR_Unlock(mSPTimerLock); } diff --git a/mozilla/xpfe/bootstrap/Makefile.in b/mozilla/xpfe/bootstrap/Makefile.in index 032a57e1fab..ecd954c1de3 100644 --- a/mozilla/xpfe/bootstrap/Makefile.in +++ b/mozilla/xpfe/bootstrap/Makefile.in @@ -51,12 +51,7 @@ XP_DIST_LIBS = \ $(OJI_LIBS) \ $(NULL) -XP_NS_UNDERBAR_CRAP = \ - $(MOZ_TIMER_LIBS) \ - $(NULL) - XP_LIBS = \ - $(XP_NS_UNDERBAR_CRAP) \ $(XP_DIST_LIBS) \ $(NSPR_LIBS) \ $(NULL) @@ -120,7 +115,6 @@ XP_DIST_DEP_LIBS := $(filter-out -L$(DIST)/bin -L$(DIST)/lib, $(XP_DIST_LIBS)) ifneq ($(MOZ_WIDGET_TOOLKIT),os2) EXTRA_DEPS = \ $(addprefix $(DIST)/,$(patsubst -l%,bin/lib%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s.a))) \ - $(XP_NS_UNDERBAR_CRAP) \ $(NULL) endif diff --git a/mozilla/xpfe/browser/src/Makefile.in b/mozilla/xpfe/browser/src/Makefile.in index 309fad7669e..4ffe918c635 100644 --- a/mozilla/xpfe/browser/src/Makefile.in +++ b/mozilla/xpfe/browser/src/Makefile.in @@ -37,7 +37,6 @@ EXTRA_DSO_LDOPTS = \ -L$(DIST)/lib \ $(MOZ_COMPONENT_LIBS) \ -lmozjs \ - $(MOZ_TIMER_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp index dfbe26d5c10..e2849f4db7e 100644 --- a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp +++ b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp @@ -310,7 +310,7 @@ public: { nsresult rv=NS_OK; if (mTimeoutValue > 0){ - rv=NS_NewTimer(getter_AddRefs(mShutdownTimer)); + mShutdownTimer = do_CreateInstance("component://netscape/timer", &rv); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create timer for PageCycler..."); if (NS_SUCCEEDED(rv) && mShutdownTimer){ mShutdownTimer->Init(TimesUp, (void *)this, mTimeoutValue*1000); diff --git a/mozilla/xpfe/components/bookmarks/src/Makefile.in b/mozilla/xpfe/components/bookmarks/src/Makefile.in index d218203f416..d736f800b42 100644 --- a/mozilla/xpfe/components/bookmarks/src/Makefile.in +++ b/mozilla/xpfe/components/bookmarks/src/Makefile.in @@ -34,7 +34,6 @@ IS_COMPONENT = 1 CPPSRCS = nsBookmarksService.cpp EXTRA_DSO_LDOPTS = \ - $(MOZ_TIMER_LIBS) \ -L$(DIST)/bin \ $(MOZ_JS_LIBS) \ $(MOZ_COMPONENT_LIBS) \ diff --git a/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp index 98d3ce2caea..308d5fd97bd 100644 --- a/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -1951,8 +1951,7 @@ nsBookmarksService::Init() if (!mTimer) { busySchedule = PR_FALSE; - - rv = NS_NewTimer(getter_AddRefs(mTimer)); + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_FAILED(rv)) return rv; mTimer->Init(nsBookmarksService::FireTimer, this, BOOKMARK_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK); // Note: don't addref "this" as we'll cancel the timer in the nsBookmarkService destructor @@ -2270,7 +2269,7 @@ else mTimer->Cancel(); mTimer = nsnull; } - nsresult rv = NS_NewTimer(getter_AddRefs(mTimer)); + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_FAILED(rv) || (!mTimer)) return; mTimer->Init(nsBookmarksService::FireTimer, bmks, BOOKMARK_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK); // Note: don't addref "this" as we'll cancel the timer in the nsBookmarkService destructor diff --git a/mozilla/xpfe/components/search/src/Makefile.in b/mozilla/xpfe/components/search/src/Makefile.in index 4e10852a125..41f93f6705e 100755 --- a/mozilla/xpfe/components/search/src/Makefile.in +++ b/mozilla/xpfe/components/search/src/Makefile.in @@ -40,7 +40,6 @@ EXTRA_DSO_LDOPTS = \ -L$(DIST)/bin \ $(XPCOM_LIBS) \ -lmozjs \ - $(MOZ_TIMER_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp b/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp index 425c49c9b54..5aa25d90e69 100755 --- a/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp +++ b/mozilla/xpfe/components/search/src/nsInternetSearchService.cpp @@ -724,7 +724,7 @@ InternetSearchDataSource::FireTimer(nsITimer* aTimer, void* aClosure) mTimer->Cancel(); mTimer = nsnull; } - nsresult rv = NS_NewTimer(getter_AddRefs(mTimer)); + mTimer = do_CreateInstance("component://netscape/timer", &rv); if (NS_FAILED(rv) || (!mTimer)) return; mTimer->Init(InternetSearchDataSource::FireTimer, search, SEARCH_UPDATE_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK); @@ -916,14 +916,14 @@ InternetSearchDataSource::Init() if (!mTimer) { - rv = NS_NewTimer(getter_AddRefs(mTimer)); - if (mTimer) - { - mTimer->Init(InternetSearchDataSource::FireTimer, this, - SEARCH_UPDATE_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK); - // Note: don't addref "this" as we'll cancel the timer in the - // InternetSearchDataSource destructor - } + mTimer = do_CreateInstance("component://netscape/timer", &rv); + if (mTimer) + { + mTimer->Init(InternetSearchDataSource::FireTimer, this, + SEARCH_UPDATE_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK); + // Note: don't addref "this" as we'll cancel the timer in the + // InternetSearchDataSource destructor + } } mEngineListBuilt = PR_FALSE;