Bug 1404198: Part 2h - Switch to NS_NewTimer* in gfx. r=njn

MozReview-Commit-ID: 3EUyHzdkbqH
This commit is contained in:
Kris Maglione committed 2017-10-15 23:15:12 -07:00
1 parent 6c232c6f2c
commit 13325252d2
6 files changed
+22 -25

No files matched your search

+1 -1
View File
@@ -207,7 +207,7 @@ APZEventState::ProcessSingleTap(const CSSPoint& aPoint,
LayoutDevicePoint ldPoint = aPoint * aScale;
APZES_LOG("Scheduling timer for click event\n");
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
nsCOMPtr<nsITimer> timer = NS_NewTimer();
dom::TabChild* tabChild = widget->GetOwningTabChild();
if (tabChild && XRE_IsContentProcess()) {
+2 -2
View File
@@ -62,8 +62,8 @@ TextureClientPool::TextureClientPool(LayersBackend aLayersBackend,
{
TCP_LOG("TexturePool %p created with maximum unused texture clients %u\n",
this, mInitialPoolSize);
mShrinkTimer = do_CreateInstance("@mozilla.org/timer;1");
mClearTimer = do_CreateInstance("@mozilla.org/timer;1");
mShrinkTimer = NS_NewTimer();
mClearTimer = NS_NewTimer();
if (aFormat == gfx::SurfaceFormat::UNKNOWN) {
gfxWarning() << "Creating texture pool for SurfaceFormat::UNKNOWN format";
}
+7 -9
View File
@@ -1250,15 +1250,13 @@ gfxFcPlatformFontList::gfxFcPlatformFontList()
int rescanInterval = FcConfigGetRescanInterval(nullptr);
if (rescanInterval) {
mLastConfig = FcConfigGetCurrent();
mCheckFontUpdatesTimer = do_CreateInstance("@mozilla.org/timer;1");
if (mCheckFontUpdatesTimer) {
mCheckFontUpdatesTimer->InitWithNamedFuncCallback(
CheckFontUpdates,
this,
(rescanInterval + 1) * 1000,
nsITimer::TYPE_REPEATING_SLACK,
"gfxFcPlatformFontList::gfxFcPlatformFontList");
} else {
NS_NewTimerWithFuncCallback(getter_AddRefs(mCheckFontUpdatesTimer),
CheckFontUpdates,
this,
(rescanInterval + 1) * 1000,
nsITimer::TYPE_REPEATING_SLACK,
"gfxFcPlatformFontList::gfxFcPlatformFontList");
if (!mCheckFontUpdatesTimer) {
NS_WARNING("Failure to create font updates timer");
}
}
+10 -11
View File
@@ -184,18 +184,17 @@ gfxFontCache::gfxFontCache(nsIEventTarget* aEventTarget)
#ifndef RELEASE_OR_BETA
// Currently disabled for release builds, due to unexplained crashes
// during expiration; see bug 717175 & 894798.
mWordCacheExpirationTimer = do_CreateInstance("@mozilla.org/timer;1");
if (mWordCacheExpirationTimer) {
if (XRE_IsContentProcess() && NS_IsMainThread()) {
mWordCacheExpirationTimer->SetTarget(aEventTarget);
}
mWordCacheExpirationTimer->InitWithNamedFuncCallback(
WordCacheExpirationTimerCallback,
this,
SHAPED_WORD_TIMEOUT_SECONDS * 1000,
nsITimer::TYPE_REPEATING_SLACK,
"gfxFontCache::gfxFontCache");
nsIEventTarget* target = nullptr;
if (XRE_IsContentProcess() && NS_IsMainThread()) {
target = aEventTarget;
}
NS_NewTimerWithFuncCallback(getter_AddRefs(mWordCacheExpirationTimer),
WordCacheExpirationTimerCallback,
this,
SHAPED_WORD_TIMEOUT_SECONDS * 1000,
nsITimer::TYPE_REPEATING_SLACK,
"gfxFontCache::gfxFontCache",
target);
#endif
}
+1 -1
View File
@@ -152,7 +152,7 @@ gfxFontInfoLoader::StartLoader(uint32_t aDelay, uint32_t aInterval)
// set up timer
if (!mTimer) {
mTimer = do_CreateInstance("@mozilla.org/timer;1");
mTimer = NS_NewTimer();
if (!mTimer) {
NS_WARNING("Failure to create font info loader timer");
return;
+1 -1
View File
@@ -399,7 +399,7 @@ public:
: mDisplayLink(nullptr)
{
MOZ_ASSERT(NS_IsMainThread());
mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
mTimer = NS_NewTimer();
}
~OSXDisplay() override