Skip to content
Permalink
Browse files
RunLoop::Timer should use constructor templates instead of class temp…
…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 371af947ac7a26ec7f29a18da21aeac21126b3bd
Showing with 314 additions and 122 deletions.
  1. +13 −0 Source/JavaScriptCore/ChangeLog
  2. +2 −2 Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
  3. +15 −0 Source/WTF/ChangeLog
  4. +11 −9 Source/WTF/wtf/RunLoop.h
  5. +49 −0 Source/WebCore/ChangeLog
  6. +2 −2 Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
  7. +2 −2 Source/WebCore/Modules/mediasession/WebMediaSessionManager.h
  8. +1 −1 Source/WebCore/page/WheelEventTestTrigger.cpp
  9. +1 −1 Source/WebCore/page/WheelEventTestTrigger.h
  10. +1 −1 Source/WebCore/page/mac/TextIndicatorWindow.h
  11. +1 −1 Source/WebCore/page/mac/TextIndicatorWindow.mm
  12. +1 −1 Source/WebCore/platform/MainThreadSharedTimer.h
  13. +2 −2 Source/WebCore/platform/cocoa/ScrollController.h
  14. +2 −2 Source/WebCore/platform/cocoa/ScrollController.mm
  15. +1 −1 Source/WebCore/platform/glib/MainThreadSharedTimerGLib.cpp
  16. +1 −1 Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp
  17. +1 −1 Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h
  18. +1 −1 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
  19. +1 −1 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
  20. +1 −1 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
  21. +1 −1 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
  22. +2 −2 Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
  23. +2 −2 Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
  24. +2 −2 Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h
  25. +1 −1 Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp
  26. +1 −1 Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h
  27. +1 −1 Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
  28. +1 −1 Source/WebCore/platform/mock/MockRealtimeVideoSource.h
  29. +2 −2 Source/WebCore/platform/network/ResourceHandleInternal.h
  30. +97 −0 Source/WebKit2/ChangeLog
  31. +2 −2 Source/WebKit2/NetworkProcess/Downloads/soup/DownloadSoup.cpp
  32. +2 −2 Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
  33. +2 −2 Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
  34. +2 −2 Source/WebKit2/PluginProcess/PluginControllerProxy.h
  35. +1 −1 Source/WebKit2/PluginProcess/PluginProcess.cpp
  36. +1 −1 Source/WebKit2/PluginProcess/PluginProcess.h
  37. +1 −1 Source/WebKit2/Shared/ChildProcess.cpp
  38. +1 −1 Source/WebKit2/Shared/ChildProcess.h
  39. +1 −1 Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h
  40. +2 −2 Source/WebKit2/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm
  41. +4 −4 Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
  42. +1 −1 Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
  43. +1 −1 Source/WebKit2/UIProcess/DrawingAreaProxy.h
  44. +1 −1 Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
  45. +1 −1 Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
  46. +1 −1 Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp
  47. +1 −1 Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.h
  48. +1 −1 Source/WebKit2/UIProcess/ProcessThrottler.cpp
  49. +1 −1 Source/WebKit2/UIProcess/ProcessThrottler.h
  50. +1 −1 Source/WebKit2/UIProcess/ResponsivenessTimer.cpp
  51. +1 −1 Source/WebKit2/UIProcess/ResponsivenessTimer.h
  52. +2 −2 Source/WebKit2/UIProcess/ViewGestureController.cpp
  53. +1 −1 Source/WebKit2/UIProcess/VisitedLinkStore.cpp
  54. +1 −1 Source/WebKit2/UIProcess/VisitedLinkStore.h
  55. +1 −1 Source/WebKit2/UIProcess/WebInspectorProxy.cpp
  56. +1 −1 Source/WebKit2/UIProcess/WebInspectorProxy.h
  57. +1 −1 Source/WebKit2/UIProcess/WebProcessPool.cpp
  58. +1 −1 Source/WebKit2/UIProcess/WebProcessPool.h
  59. +2 −2 Source/WebKit2/UIProcess/gtk/GestureController.cpp
  60. +2 −2 Source/WebKit2/UIProcess/gtk/GestureController.h
  61. +1 −1 Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
  62. +1 −1 Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h
  63. +2 −2 Source/WebKit2/UIProcess/mac/ViewGestureController.h
  64. +1 −1 Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp
  65. +1 −1 Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h
  66. +1 −1 Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
  67. +1 −1 Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h
  68. +2 −2 Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
  69. +2 −2 Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
  70. +1 −1 Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
  71. +1 −1 Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h
  72. +1 −1 Source/WebKit2/WebProcess/Plugins/PluginView.cpp
  73. +1 −1 Source/WebKit2/WebProcess/Plugins/PluginView.h
  74. +1 −1 Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp
  75. +1 −1 Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h
  76. +1 −1 Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
  77. +1 −1 Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h
  78. +2 −2 Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
  79. +2 −2 Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
  80. +2 −2 Source/WebKit2/WebProcess/WebPage/WebPage.cpp
  81. +2 −2 Source/WebKit2/WebProcess/WebPage/WebPage.h
  82. +1 −1 Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
  83. +1 −1 Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
  84. +1 −1 Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
  85. +1 −1 Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
  86. +16 −0 Tools/ChangeLog
  87. +4 −4 Tools/TestWebKitAPI/Tests/WTF/RunLoop.cpp
  88. +1 −1 Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
  89. +1 −1 Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
@@ -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)
@@ -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)
{
}

@@ -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.
@@ -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.
*
@@ -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;
@@ -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.
@@ -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)
{
}

@@ -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;
@@ -39,7 +39,7 @@
namespace WebCore {

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

@@ -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;
};
@@ -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)
@@ -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)
{
}

@@ -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
};

@@ -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)
@@ -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

@@ -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
{
}
@@ -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);
@@ -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)
{
}

@@ -79,7 +79,7 @@ class MediaPlaybackTargetPicker {

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

} // namespace WebCore
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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
@@ -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)
{
}

@@ -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()
@@ -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;
};

@@ -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");
}
@@ -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 };
};
@@ -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);
@@ -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

0 comments on commit 371af94

Please sign in to comment.