Bug 1217251 - In TaskThrottler, dispatch the timeout task correctly from the Java UI thread on Android. r=kats

--HG--
extra : source : 4d35b236cec7651049af00eac2dd38ba868c6cdd
This commit is contained in:
Botond Ballo 2015-10-22 16:46:11 -04:00
parent 534b661e0d
commit e2037b8b38

View File

@ -6,7 +6,7 @@
#include "TaskThrottler.h"
#include "base/message_loop.h"
#include "mozilla/layers/APZThreadUtils.h"
#define TASK_LOG(...)
// #define TASK_LOG(...) printf_stderr("TASK: " __VA_ARGS__)
@ -49,8 +49,7 @@ TaskThrottler::PostTask(const tracked_objects::Location& aLocation,
// even if we don't get a TaskComplete() until then.
TimeDuration timeout = mMaxWait - TimeSinceLastRequest(aTimeStamp, lock);
mTimeoutTask = NewRunnableMethod(this, &TaskThrottler::OnTimeout);
MessageLoop::current()->PostDelayedTask(FROM_HERE, mTimeoutTask,
timeout.ToMilliseconds());
APZThreadUtils::RunDelayedTaskOnCurrentThread(mTimeoutTask, timeout);
return;
}
// we've been waiting for more than the max-wait limit, so just fall through