#446 + #334: trim refresh driver further; restore old Tele removal

This commit is contained in:
Cameron Kaiser 2019-03-25 20:48:57 -07:00
parent b22dfbd773
commit 4594eee516
2 changed files with 28 additions and 12 deletions

View File

@ -430,9 +430,11 @@ private:
void OnTimerStart()
{
#if(0)
if (!XRE_IsParentProcess()) {
mLastChildTick = TimeStamp::Now();
}
#endif
}
private:
@ -440,6 +442,7 @@ private:
void RecordTelemetryProbes(TimeStamp aVsyncTimestamp)
{
#if(0)
MOZ_ASSERT(NS_IsMainThread());
#ifndef ANDROID /* bug 1142079 */
if (XRE_IsParentProcess()) {
@ -467,20 +470,23 @@ private:
mVsyncRate = mVsyncRefreshDriverTimer->mVsyncChild->GetVsyncRate();
}
#endif
#endif
}
void TickRefreshDriver(TimeStamp aVsyncTimestamp)
{
MOZ_ASSERT(NS_IsMainThread());
RecordTelemetryProbes(aVsyncTimestamp);
if (XRE_IsParentProcess()) {
//RecordTelemetryProbes(aVsyncTimestamp);
//if (XRE_IsParentProcess()) {
{ // Make sure the lock expires before we leave this block.
MonitorAutoLock lock(mRefreshTickLock);
aVsyncTimestamp = mRecentVsync;
mProcessedVsync = true;
} else {
mLastChildTick = TimeStamp::Now();
}
//} else {
// mLastChildTick = TimeStamp::Now();
//}
MOZ_ASSERT(aVsyncTimestamp <= TimeStamp::Now());
// We might have a problem that we call ~VsyncRefreshDriverTimer() before
@ -504,9 +510,10 @@ private:
virtual ~VsyncRefreshDriverTimer()
{
if (XRE_IsParentProcess()) {
//if (XRE_IsParentProcess()) {
mVsyncDispatcher->SetParentRefreshTimer(nullptr);
mVsyncDispatcher = nullptr;
#if(0)
} else {
// Since the PVsyncChild actors live through the life of the process, just
// send the unobserveVsync message to disable vsync event. We don't need
@ -516,6 +523,7 @@ private:
mVsyncChild->SetVsyncObserver(nullptr);
mVsyncChild = nullptr;
}
#endif
// Detach current vsync timer from this VsyncObserver. The observer will no
// longer tick this timer.
@ -531,12 +539,12 @@ private:
mLastFireEpoch = JS_Now();
mLastFireTime = TimeStamp::Now();
if (XRE_IsParentProcess()) {
//if (XRE_IsParentProcess()) {
mVsyncDispatcher->SetParentRefreshTimer(mVsyncObserver);
} else {
Unused << mVsyncChild->SendObserve();
mVsyncObserver->OnTimerStart();
}
//} else {
// Unused << mVsyncChild->SendObserve();
// mVsyncObserver->OnTimerStart();
//}
++sActiveVsyncTimers;
}
@ -832,14 +840,14 @@ CreateVsyncRefreshTimer()
return;
}
if (XRE_IsParentProcess()) {
//if (XRE_IsParentProcess()) {
// Make sure all vsync systems are ready.
gfxPlatform::GetPlatform();
// In parent process, we don't need to use ipc. We can create the
// VsyncRefreshDriverTimer directly.
sRegularRateTimer = new VsyncRefreshDriverTimer();
return;
}
//}
#ifdef MOZ_NUWA_PROCESS
// NUWA process will just use software timer. Use NuwaAddFinalConstructor()
@ -1878,8 +1886,10 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
}
}
#if(0)
#ifndef ANDROID /* bug 1142079 */
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::REFRESH_DRIVER_TICK, mTickStart);
#endif
#endif
nsTObserverArray<nsAPostRefreshObserver*>::ForwardIterator iter(mPostRefreshObservers);

View File

@ -237,6 +237,12 @@ XRE_SetProcessType(const char* aProcessTypeString)
i < (int) ArrayLength(kGeckoProcessTypeString);
++i) {
if (!strcmp(kGeckoProcessTypeString[i], aProcessTypeString)) {
// For purposes of TenFourFox issue 446, assert that we never, ever
// launch a child process (it would immediately crash anyway due to
// defective IPC, but let's be paranoid and make it crash predictably).
if (MOZ_UNLIKELY(static_cast<GeckoProcessType>(i) != GeckoProcessType_Default))
MOZ_CRASH("TenFourFox does not support E10S child processes.");
sChildProcessType = static_cast<GeckoProcessType>(i);
return;
}