Bug 771765 - Support template content process, part 7: Don't schedule timer in the message pump if template process is ready. r=khuey

This commit is contained in:
Thinker Lee ext:(%2C%20Cervantes%20Yu%20%3Ccyu%40mozilla.com%3E) 2013-06-03 18:14:44 +08:00
Родитель f5213d3e66
Коммит ba5a1bd24c
1 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -18,6 +18,10 @@
#include "AndroidBridge.h"
#endif
#ifdef MOZ_NUWA_PROCESS
#include "ipc/Nuwa.h"
#endif
using mozilla::ipc::DoWorkRunnable;
using mozilla::ipc::MessagePump;
using mozilla::ipc::MessagePumpForChildProcess;
@ -96,7 +100,11 @@ MessagePump::Run(MessagePump::Delegate* aDelegate)
did_work |= aDelegate->DoDelayedWork(&delayed_work_time_);
if (did_work && delayed_work_time_.is_null())
if (did_work && delayed_work_time_.is_null()
#ifdef MOZ_NUWA_PROCESS
&& (!IsNuwaReady() || !IsNuwaProcess())
#endif
)
mDelayedWorkTimer->Cancel();
if (!keep_running_)
@ -116,7 +124,10 @@ MessagePump::Run(MessagePump::Delegate* aDelegate)
NS_ProcessNextEvent(mThread, true);
}
mDelayedWorkTimer->Cancel();
#ifdef MOZ_NUWA_PROCESS
if (!IsNuwaReady() || !IsNuwaProcess())
#endif
mDelayedWorkTimer->Cancel();
keep_running_ = true;
}
@ -148,6 +159,11 @@ MessagePump::ScheduleWorkForNestedLoop()
void
MessagePump::ScheduleDelayedWork(const base::TimeTicks& aDelayedTime)
{
#ifdef MOZ_NUWA_PROCESS
if (IsNuwaReady() && IsNuwaProcess())
return;
#endif
if (!mDelayedWorkTimer) {
mDelayedWorkTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
if (!mDelayedWorkTimer) {