Commit 0d4ccffc authored by Olli Pettay's avatar Olli Pettay
Browse files

Bug 1367164 - Use IdleDispatch for async snow white killer on main thread, r=mccr8

parent 1040ee9f
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -155,14 +155,12 @@ public:

  nsresult Dispatch()
  {
      if (NS_IsMainThread()) {
          nsCOMPtr<nsIRunnable> self(this);
          return SystemGroup::Dispatch("AsyncFreeSnowWhite",
                                       TaskCategory::GarbageCollection,
                                       self.forget());
      } else {
          return NS_DispatchToCurrentThread(this);
      nsCOMPtr<nsIThread> thread = do_GetCurrentThread();
      if (!thread) {
          return NS_ERROR_FAILURE;
      }
      nsCOMPtr<nsIRunnable> self(this);
      return thread->IdleDispatch(self.forget());
  }

  void Start(bool aContinuation = false, bool aPurge = false)