Random crashes on the Web Thread due to Timers firing on the wrong thread in the...
[WebKit-https.git] / Source / WebKit2 / UIProcess / ProcessThrottler.cpp
index b9b6d8686b533c03a415ebeb0d90f612508aa402..21a45af13f69fc6fd3a63407ef443e57ad528494 100644 (file)
@@ -65,7 +65,7 @@ ProcessThrottler::BackgroundActivityToken::~BackgroundActivityToken()
 ProcessThrottler::ProcessThrottler(WebProcessProxy* process)
     : m_process(process)
     , m_weakPtrFactory(this)
-    , m_suspendTimer(this, &ProcessThrottler::suspendTimerFired)
+    , m_suspendTimer(RunLoop::main(), this, &ProcessThrottler::suspendTimerFired)
     , m_foregroundCount(0)
     , m_backgroundCount(0)
     , m_suspendMessageCount(0)
@@ -116,7 +116,7 @@ void ProcessThrottler::didConnnectToProcess(pid_t pid)
     m_assertion = std::make_unique<ProcessAndUIAssertion>(pid, assertionState());
 }
     
-void ProcessThrottler::suspendTimerFired(WebCore::Timer<ProcessThrottler>*)
+void ProcessThrottler::suspendTimerFired()
 {
     updateAssertionNow();
 }