diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp index 00306674fd24..ceef82f515f2 100644 --- a/widget/android/AndroidBridge.cpp +++ b/widget/android/AndroidBridge.cpp @@ -999,12 +999,12 @@ class AndroidBridge::DelayedTask using TimeDuration = mozilla::TimeDuration; public: - DelayedTask(already_AddRefed aTask) + DelayedTask(already_AddRefed aTask) : mTask(aTask) , mRunTime() // Null timestamp representing no delay. {} - DelayedTask(already_AddRefed aTask, int aDelayMs) + DelayedTask(already_AddRefed aTask, int aDelayMs) : mTask(aTask) , mRunTime(TimeStamp::Now() + TimeDuration::FromMilliseconds(aDelayMs)) {} @@ -1027,19 +1027,19 @@ public: return 0; } - already_AddRefed TakeTask() + already_AddRefed TakeTask() { return mTask.forget(); } private: - RefPtr mTask; + nsCOMPtr mTask; const TimeStamp mRunTime; }; void -AndroidBridge::PostTaskToUiThread(already_AddRefed aTask, int aDelayMs) +AndroidBridge::PostTaskToUiThread(already_AddRefed aTask, int aDelayMs) { // add the new task into the mUiTaskQueue, sorted with // the earliest task first in the queue @@ -1086,7 +1086,7 @@ AndroidBridge::RunDelayedUiThreadTasks() } // Retrieve task before unlocking/running. - RefPtr nextTask(mUiTaskQueue[0].TakeTask()); + nsCOMPtr nextTask(mUiTaskQueue[0].TakeTask()); mUiTaskQueue.RemoveElementAt(0); // Unlock to allow posting new tasks reentrantly. diff --git a/widget/android/AndroidBridge.h b/widget/android/AndroidBridge.h index 1324562078d5..5fc0d5b8d7c0 100644 --- a/widget/android/AndroidBridge.h +++ b/widget/android/AndroidBridge.h @@ -42,16 +42,12 @@ class nsPIDOMWindowOuter; -namespace base { -class Thread; -} // end namespace base - typedef void* EGLSurface; +class nsIRunnable; namespace mozilla { class AutoLocalJNIFrame; -class Runnable; namespace hal { class BatteryInformation; @@ -239,7 +235,7 @@ private: mozilla::Mutex mUiTaskQueueLock; public: - void PostTaskToUiThread(already_AddRefed aTask, int aDelayMs); + void PostTaskToUiThread(already_AddRefed aTask, int aDelayMs); int64_t RunDelayedUiThreadTasks(); };