Bug 1217251 - In TaskThrottler, dispatch the timeout task correctly from the Java UI thread on Android. r=kats
authorBotond Ballo <botond@mozilla.com>
Thu, 22 Oct 2015 16:46:11 -0400
changeset 304582 c6404f3d787c497242d7a5cc2d1ea9796205e991
parent 304581 027c42d1dcc89962df6a9185e3f463ffd6aeccc6
child 304583 2d225edfccbf2227ab60e932be1d64a1e688b0c2
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1217251
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1217251 - In TaskThrottler, dispatch the timeout task correctly from the Java UI thread on Android. r=kats
gfx/layers/apz/src/TaskThrottler.cpp
--- a/gfx/layers/apz/src/TaskThrottler.cpp
+++ b/gfx/layers/apz/src/TaskThrottler.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
 /* vim: set sw=2 sts=2 ts=8 et tw=80 : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TaskThrottler.h"
 
-#include "base/message_loop.h"
+#include "mozilla/layers/APZThreadUtils.h"
 
 #define TASK_LOG(...)
 // #define TASK_LOG(...) printf_stderr("TASK: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
 TaskThrottler::TaskThrottler(const TimeStamp& aTimeStamp, const TimeDuration& aMaxWait)
@@ -44,18 +44,17 @@ TaskThrottler::PostTask(const tracked_ob
     CancelPendingTask(lock);
     if (TimeSinceLastRequest(aTimeStamp, lock) < mMaxWait) {
       mQueuedTask = Move(aTask);
       TASK_LOG("%p queued task %p\n", this, mQueuedTask.get());
       // Make sure the queued task is sent after mMaxWait time elapses,
       // 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
     // and send the new task already.
   }
 
   mStartTime = aTimeStamp;
   aTask->Run();