Skip to content

Commit

Permalink
RunLoop::Timer should use constructor templates instead of class temp…
Browse files Browse the repository at this point in the history
…lates

https://bugs.webkit.org/show_bug.cgi?id=159153

Reviewed by Alex Christensen.

Source/JavaScriptCore:

Remove the RunLoop::Timer class template argument, and pass its constructor
a reference to `this` instead of a pointer to `this`.

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask):

Source/WebCore:

Remove the RunLoop::Timer class template argument, and pass its constructor
a reference to `this` instead of a pointer to `this`.

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::WebMediaSessionManager):
* Modules/mediasession/WebMediaSessionManager.h:
* page/WheelEventTestTrigger.cpp:
(WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
* page/WheelEventTestTrigger.h:
* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::TextIndicatorWindow):
* platform/MainThreadSharedTimer.h:
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::ScrollController):
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
* platform/graphics/MediaPlaybackTargetPicker.cpp:
(WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::VideoRenderRequestScheduler):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
(WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
* platform/mock/MediaPlaybackTargetPickerMock.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
* platform/mock/MockRealtimeVideoSource.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):

Source/WebKit2:

Remove the RunLoop::Timer class template argument, and pass its constructor
a reference to `this` instead of a pointer to `this`.

* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::PluginControllerProxy):
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::PluginProcess):
* PluginProcess/PluginProcess.h:
* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::ChildProcess):
* Shared/ChildProcess.h:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
(API::SharedJSContext::SharedJSContext):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
* UIProcess/DrawingAreaProxy.h:
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::PluginInfoCache):
* UIProcess/Plugins/gtk/PluginInfoCache.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::ProcessThrottler):
* UIProcess/ProcessThrottler.h:
* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::ResponsivenessTimer):
* UIProcess/ResponsivenessTimer.h:
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::VisitedLinkStore):
* UIProcess/VisitedLinkStore.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
* UIProcess/WebProcessPool.h:
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::DragGesture::DragGesture):
(WebKit::GestureController::ZoomGesture::ZoomGesture):
* UIProcess/gtk/GestureController.h:
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
* UIProcess/gtk/WebPopupMenuProxyGtk.h:
* UIProcess/mac/ViewGestureController.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::WebLoaderStrategy):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap):
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin):
(WebKit::NetscapePlugin::Timer::Timer):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::NetscapePluginStream):
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::PluginView):
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
(WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):

Source/WTF:

Refactor RunLoop::Timer to align with WebCore::Timer. Use a constructor
template instead of a class template. Store a bound std::function rather than
a templated member and function. Add a constructor that takes a std::function.

* wtf/RunLoop.h:
(WTF::RunLoop::Timer::Timer):
(WTF::RunLoop::Timer::fired):

Tools:

Remove the RunLoop::Timer class template argument, and pass its constructor
a reference to `this` instead of a pointer to `this`.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/177327@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
burg committed Jun 28, 2016
1 parent 887d75d commit 371af94
Show file tree
Hide file tree
Showing 89 changed files with 314 additions and 122 deletions.
13 changes: 13 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
2016-06-28 Brian Burg <bburg@apple.com>

RunLoop::Timer should use constructor templates instead of class templates
https://bugs.webkit.org/show_bug.cgi?id=159153

Reviewed by Alex Christensen.

Remove the RunLoop::Timer class template argument, and pass its constructor
a reference to `this` instead of a pointer to `this`.

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask):

2016-06-28 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: selectElement.options shows unexpected entries in console (named indexes beyond collection length)
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
Expand Up @@ -55,13 +55,13 @@ class SendGarbageCollectionEventsTask {

HeapFrontendDispatcher& m_frontendDispatcher;
Vector<GarbageCollectionData> m_collections;
RunLoop::Timer<SendGarbageCollectionEventsTask> m_timer;
RunLoop::Timer m_timer;
Lock m_mutex;
};

SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask(HeapFrontendDispatcher& frontendDispatcher)
: m_frontendDispatcher(frontendDispatcher)
, m_timer(RunLoop::current(), this, &SendGarbageCollectionEventsTask::timerFired)
, m_timer(RunLoop::current(), *this, &SendGarbageCollectionEventsTask::timerFired)
{
}

Expand Down
15 changes: 15 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,18 @@
2016-06-28 Brian Burg <bburg@apple.com>

RunLoop::Timer should use constructor templates instead of class templates
https://bugs.webkit.org/show_bug.cgi?id=159153

Reviewed by Alex Christensen.

Refactor RunLoop::Timer to align with WebCore::Timer. Use a constructor
template instead of a class template. Store a bound std::function rather than
a templated member and function. Add a constructor that takes a std::function.

* wtf/RunLoop.h:
(WTF::RunLoop::Timer::Timer):
(WTF::RunLoop::Timer::fired):

2016-06-28 Tomas Popela <tpopela@redhat.com>

THUMB2 support not correctly detected on Fedora with GCC 6.1.
Expand Down
20 changes: 11 additions & 9 deletions Source/WTF/wtf/RunLoop.h
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
* Copyright (C) 2010, 2016 Apple Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
* Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
*
Expand Down Expand Up @@ -128,23 +128,25 @@ class RunLoop : public FunctionDispatcher {
#endif
};

template <typename TimerFiredClass>
class Timer : public TimerBase {
public:
typedef void (TimerFiredClass::*TimerFiredFunction)();
template <typename TimerFiredClass, typename TimerFiredBaseClass>
Timer(RunLoop& runLoop, TimerFiredClass& object, void (TimerFiredBaseClass::*function)())
: TimerBase(runLoop)
, m_function(std::bind(function, &object))
{
}

Timer(RunLoop& runLoop, TimerFiredClass* o, TimerFiredFunction f)
Timer(RunLoop& runLoop, std::function<void ()> function)
: TimerBase(runLoop)
, m_object(o)
, m_function(f)
, m_function(WTFMove(function))
{
}

private:
virtual void fired() { (m_object->*m_function)(); }
virtual void fired() { m_function(); }

TimerFiredClass* m_object;
TimerFiredFunction m_function;
std::function<void ()> m_function;
};

class Holder;
Expand Down
49 changes: 49 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,52 @@
2016-06-28 Brian Burg <bburg@apple.com>

RunLoop::Timer should use constructor templates instead of class templates
https://bugs.webkit.org/show_bug.cgi?id=159153

Reviewed by Alex Christensen.

Remove the RunLoop::Timer class template argument, and pass its constructor
a reference to `this` instead of a pointer to `this`.

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::WebMediaSessionManager):
* Modules/mediasession/WebMediaSessionManager.h:
* page/WheelEventTestTrigger.cpp:
(WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
* page/WheelEventTestTrigger.h:
* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::TextIndicatorWindow):
* platform/MainThreadSharedTimer.h:
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::ScrollController):
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
* platform/graphics/MediaPlaybackTargetPicker.cpp:
(WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::VideoRenderRequestScheduler):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
(WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
* platform/mock/MediaPlaybackTargetPickerMock.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
* platform/mock/MockRealtimeVideoSource.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):

2016-06-27 Jer Noble <jer.noble@apple.com>

Cross-domain video loads do not prompt for authorization.
Expand Down
Expand Up @@ -127,8 +127,8 @@ WebCore::MediaPlaybackTargetPicker& WebMediaSessionManager::targetPicker()
}

WebMediaSessionManager::WebMediaSessionManager()
: m_taskTimer(RunLoop::current(), this, &WebMediaSessionManager::taskTimerFired)
, m_watchdogTimer(RunLoop::current(), this, &WebMediaSessionManager::watchdogTimerFired)
: m_taskTimer(RunLoop::current(), *this, &WebMediaSessionManager::taskTimerFired)
, m_watchdogTimer(RunLoop::current(), *this, &WebMediaSessionManager::watchdogTimerFired)
{
}

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/Modules/mediasession/WebMediaSessionManager.h
Expand Up @@ -96,8 +96,8 @@ class WebMediaSessionManager : public MediaPlaybackTargetPicker::Client {

void watchdogTimerFired();

RunLoop::Timer<WebMediaSessionManager> m_taskTimer;
RunLoop::Timer<WebMediaSessionManager> m_watchdogTimer;
RunLoop::Timer m_taskTimer;
RunLoop::Timer m_watchdogTimer;

Vector<std::unique_ptr<ClientState>> m_clientState;
RefPtr<MediaPlaybackTarget> m_playbackTarget;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/WheelEventTestTrigger.cpp
Expand Up @@ -39,7 +39,7 @@
namespace WebCore {

WheelEventTestTrigger::WheelEventTestTrigger()
: m_testTriggerTimer(RunLoop::current(), this, &WheelEventTestTrigger::triggerTestTimerFired)
: m_testTriggerTimer(RunLoop::current(), *this, &WheelEventTestTrigger::triggerTestTimerFired)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/WheelEventTestTrigger.h
Expand Up @@ -59,7 +59,7 @@ class WheelEventTestTrigger : public ThreadSafeRefCounted<WheelEventTestTrigger>

private:
std::function<void()> m_testNotificationCallback;
RunLoop::Timer<WheelEventTestTrigger> m_testTriggerTimer;
RunLoop::Timer m_testTriggerTimer;
mutable Lock m_testTriggerMutex;
WTF::HashMap<ScrollableAreaIdentifier, std::set<DeferTestTriggerReason>> m_deferTestTriggerReasons;
};
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/mac/TextIndicatorWindow.h
Expand Up @@ -74,7 +74,7 @@ class TextIndicatorWindow {
RetainPtr<NSWindow> m_textIndicatorWindow;
RetainPtr<WebTextIndicatorView> m_textIndicatorView;

RunLoop::Timer<TextIndicatorWindow> m_temporaryTextIndicatorTimer;
RunLoop::Timer m_temporaryTextIndicatorTimer;
};

#endif // PLATFORM(MAC)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/mac/TextIndicatorWindow.mm
Expand Up @@ -404,7 +404,7 @@ - (BOOL)isFlipped

TextIndicatorWindow::TextIndicatorWindow(NSView *targetView)
: m_targetView(targetView)
, m_temporaryTextIndicatorTimer(RunLoop::main(), this, &TextIndicatorWindow::startFadeOut)
, m_temporaryTextIndicatorTimer(RunLoop::main(), *this, &TextIndicatorWindow::startFadeOut)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/MainThreadSharedTimer.h
Expand Up @@ -55,7 +55,7 @@ class MainThreadSharedTimer final : public SharedTimer {

std::function<void()> m_firedFunction;
#if PLATFORM(GTK)
RunLoop::Timer<MainThreadSharedTimer> m_timer;
RunLoop::Timer m_timer;
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/cocoa/ScrollController.h
Expand Up @@ -177,7 +177,7 @@ class ScrollController {
CFTimeInterval m_startTime { 0 };
FloatSize m_startStretch;
FloatSize m_origVelocity;
RunLoop::Timer<ScrollController> m_snapRubberbandTimer;
RunLoop::Timer m_snapRubberbandTimer;
#endif

#if ENABLE(CSS_SCROLL_SNAP)
Expand All @@ -187,7 +187,7 @@ class ScrollController {
std::unique_ptr<ScrollSnapAnimatorState> m_verticalScrollSnapState;
std::unique_ptr<ScrollSnapAnimationCurveState> m_scrollSnapCurveState;
#if PLATFORM(MAC)
RunLoop::Timer<ScrollController> m_scrollSnapTimer;
RunLoop::Timer m_scrollSnapTimer;
#endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/cocoa/ScrollController.mm
Expand Up @@ -121,10 +121,10 @@ static float scrollWheelMultiplier()
ScrollController::ScrollController(ScrollControllerClient& client)
: m_client(client)
#if ENABLE(RUBBER_BANDING)
, m_snapRubberbandTimer(RunLoop::current(), this, &ScrollController::snapRubberBandTimerFired)
, m_snapRubberbandTimer(RunLoop::current(), *this, &ScrollController::snapRubberBandTimerFired)
#endif
#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
, m_scrollSnapTimer(RunLoop::current(), this, &ScrollController::scrollSnapTimerFired)
, m_scrollSnapTimer(RunLoop::current(), *this, &ScrollController::scrollSnapTimerFired)
#endif
{
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/glib/MainThreadSharedTimerGLib.cpp
Expand Up @@ -33,7 +33,7 @@
namespace WebCore {

MainThreadSharedTimer::MainThreadSharedTimer()
: m_timer(RunLoop::main(), this, &MainThreadSharedTimer::fired)
: m_timer(RunLoop::main(), *this, &MainThreadSharedTimer::fired)
{
// This is GDK_PRIORITY_REDRAW, but we don't want to depend on GDK here just to use a constant.
m_timer.setPriority(G_PRIORITY_HIGH_IDLE + 20);
Expand Down
Expand Up @@ -37,7 +37,7 @@ static const double pendingActionInterval = 1.0 / 10.0;

MediaPlaybackTargetPicker::MediaPlaybackTargetPicker(Client& client)
: m_client(&client)
, m_pendingActionTimer(RunLoop::main(), this, &MediaPlaybackTargetPicker::pendingActionTimerFired)
, m_pendingActionTimer(RunLoop::main(), *this, &MediaPlaybackTargetPicker::pendingActionTimerFired)
{
}

Expand Down
Expand Up @@ -79,7 +79,7 @@ class MediaPlaybackTargetPicker {

PendingActionFlags m_pendingActionFlags { 0 };
Client* m_client;
RunLoop::Timer<MediaPlaybackTargetPicker> m_pendingActionTimer;
RunLoop::Timer m_pendingActionTimer;
};

} // namespace WebCore
Expand Down
Expand Up @@ -163,7 +163,7 @@ MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer(MediaPlayer* player)
, m_volumeAndMuteInitialized(false)
, m_hasVideo(false)
, m_hasAudio(false)
, m_readyTimerHandler(RunLoop::main(), this, &MediaPlayerPrivateGStreamer::readyTimerFired)
, m_readyTimerHandler(RunLoop::main(), *this, &MediaPlayerPrivateGStreamer::readyTimerFired)
, m_totalBytes(0)
, m_preservesPitch(false)
#if ENABLE(WEB_AUDIO)
Expand Down
Expand Up @@ -231,7 +231,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
bool m_volumeAndMuteInitialized;
bool m_hasVideo;
bool m_hasAudio;
RunLoop::Timer<MediaPlayerPrivateGStreamer> m_readyTimerHandler;
RunLoop::Timer m_readyTimerHandler;
mutable unsigned long long m_totalBytes;
URL m_url;
bool m_preservesPitch;
Expand Down
Expand Up @@ -150,7 +150,7 @@ MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase(MediaPlayer* pl
, m_readyState(MediaPlayer::HaveNothing)
, m_networkState(MediaPlayer::Empty)
#if USE(GSTREAMER_GL)
, m_drawTimer(RunLoop::main(), this, &MediaPlayerPrivateGStreamerBase::repaint)
, m_drawTimer(RunLoop::main(), *this, &MediaPlayerPrivateGStreamerBase::repaint)
#endif
, m_usingFallbackVideoSink(false)
, m_videoSourceRotation(NoVideoSourceRotation)
Expand Down
Expand Up @@ -182,7 +182,7 @@ class MediaPlayerPrivateGStreamerBase : public MediaPlayerPrivateInterface
mutable GMutex m_sampleMutex;
GRefPtr<GstSample> m_sample;
#if USE(GSTREAMER_GL)
RunLoop::Timer<MediaPlayerPrivateGStreamerBase> m_drawTimer;
RunLoop::Timer m_drawTimer;
#endif
mutable FloatSize m_videoSize;
bool m_usingFallbackVideoSink;
Expand Down
Expand Up @@ -74,7 +74,7 @@ class VideoRenderRequestScheduler {
public:
VideoRenderRequestScheduler()
#if !USE(COORDINATED_GRAPHICS_THREADED)
: m_timer(RunLoop::main(), this, &VideoRenderRequestScheduler::render)
: m_timer(RunLoop::main(), *this, &VideoRenderRequestScheduler::render)
#endif
{
#if PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED)
Expand Down Expand Up @@ -140,7 +140,7 @@ class VideoRenderRequestScheduler {
GRefPtr<GstSample> m_sample;
#if !USE(COORDINATED_GRAPHICS_THREADED)
RunLoop::Timer<VideoRenderRequestScheduler> m_timer;
RunLoop::Timer m_timer;
Condition m_dataCondition;
GRefPtr<WebKitVideoSink> m_sink;
#endif
Expand Down
Expand Up @@ -41,7 +41,7 @@ namespace WebCore {
TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy()
: m_compositor(nullptr)
, m_targetLayer(nullptr)
, m_releaseUnusedBuffersTimer(RunLoop::current(), this, &TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired)
, m_releaseUnusedBuffersTimer(RunLoop::current(), *this, &TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired)
{
}

Expand All @@ -66,7 +66,7 @@ void TextureMapperPlatformLayerProxy::activateOnCompositingThread(Compositor* co
if (m_targetLayer && m_currentBuffer)
m_targetLayer->setContentsLayer(m_currentBuffer.get());

m_compositorThreadUpdateTimer = std::make_unique<RunLoop::Timer<TextureMapperPlatformLayerProxy>>(RunLoop::current(), this, &TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired);
m_compositorThreadUpdateTimer = std::make_unique<RunLoop::Timer>(RunLoop::current(), *this, &TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired);
}

void TextureMapperPlatformLayerProxy::invalidate()
Expand Down
Expand Up @@ -93,13 +93,13 @@ class TextureMapperPlatformLayerProxy : public ThreadSafeRefCounted<TextureMappe

Vector<std::unique_ptr<TextureMapperPlatformLayerBuffer>> m_usedBuffers;

RunLoop::Timer<TextureMapperPlatformLayerProxy> m_releaseUnusedBuffersTimer;
RunLoop::Timer m_releaseUnusedBuffersTimer;
#ifndef NDEBUG
ThreadIdentifier m_compositorThreadID { 0 };
#endif

void compositorThreadUpdateTimerFired();
std::unique_ptr<RunLoop::Timer<TextureMapperPlatformLayerProxy>> m_compositorThreadUpdateTimer;
std::unique_ptr<RunLoop::Timer> m_compositorThreadUpdateTimer;
std::function<void()> m_compositorThreadUpdateFunction;
};

Expand Down
Expand Up @@ -41,7 +41,7 @@ static const double timerInterval = 1.0 / 10.0;

MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock(MediaPlaybackTargetPicker::Client& client)
: MediaPlaybackTargetPicker(client)
, m_timer(RunLoop::main(), this, &MediaPlaybackTargetPickerMock::timerFired)
, m_timer(RunLoop::main(), *this, &MediaPlaybackTargetPickerMock::timerFired)
{
LOG(Media, "MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock");
}
Expand Down
Expand Up @@ -55,7 +55,7 @@ class MediaPlaybackTargetPickerMock final : public MediaPlaybackTargetPicker {
void timerFired();

String m_deviceName;
RunLoop::Timer<MediaPlaybackTargetPickerMock> m_timer;
RunLoop::Timer m_timer;
MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Unknown };
bool m_showingMenu { false };
};
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Expand Up @@ -64,7 +64,7 @@ Ref<MockRealtimeVideoSource> MockRealtimeVideoSource::createMuted(const String&

MockRealtimeVideoSource::MockRealtimeVideoSource(const String& name)
: MockRealtimeMediaSource(createCanonicalUUIDString(), RealtimeMediaSource::Video, name)
, m_timer(RunLoop::current(), this, &MockRealtimeVideoSource::generateFrame)
, m_timer(RunLoop::current(), *this, &MockRealtimeVideoSource::generateFrame)
{
m_dashWidths.reserveInitialCapacity(2);
m_dashWidths.uncheckedAppend(6);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/mock/MockRealtimeVideoSource.h
Expand Up @@ -103,7 +103,7 @@ class MockRealtimeVideoSource : public MockRealtimeMediaSource {
unsigned m_frameRate { 30 };
unsigned m_frameNumber { 0 };

RunLoop::Timer<MockRealtimeVideoSource> m_timer;
RunLoop::Timer m_timer;
};

} // namespace WebCore
Expand Down

0 comments on commit 371af94

Please sign in to comment.