Skip to content
Permalink
Browse files
Rename NoncopyableFunction to Function
https://bugs.webkit.org/show_bug.cgi?id=158354

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::runTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/webaudio/AudioDestinationNode.h:
(WebCore::AudioDestinationNode::resume):
(WebCore::AudioDestinationNode::suspend):
(WebCore::AudioDestinationNode::close):
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::resume):
(WebCore::DefaultAudioDestinationNode::suspend):
(WebCore::DefaultAudioDestinationNode::close):
* Modules/webaudio/DefaultAudioDestinationNode.h:
* dom/ActiveDOMCallbackMicrotask.cpp:
(WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
* dom/ActiveDOMCallbackMicrotask.h:
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::Task::Task):
* fileapi/AsyncFileStream.cpp:
(WebCore::callOnFileThread):
(WebCore::AsyncFileStream::perform):
* fileapi/AsyncFileStream.h:
* page/FrameView.cpp:
(WebCore::FrameView::queuePostLayoutCallback):
(WebCore::FrameView::flushPostLayoutTasksQueue):
* page/FrameView.h:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::dispatch):
(WebCore::ScrollingThread::dispatchBarrier):
(WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
* page/scrolling/ScrollingThread.h:
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
* platform/GenericTaskQueue.h:
(WebCore::TaskDispatcher::postTask):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::scheduleDeferredTask):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::scheduleDeferredTask):
* style/StyleTreeResolver.cpp:
(WebCore::Style::postResolutionCallbackQueue):
(WebCore::Style::queuePostResolutionCallback):
* style/StyleTreeResolver.h:

Source/WebKit:

* Storage/StorageSyncManager.cpp:
(WebCore::StorageSyncManager::dispatch):
* Storage/StorageSyncManager.h:
* Storage/StorageThread.cpp:
(WebCore::StorageThread::dispatch):
(WebCore::StorageThread::terminate):
* Storage/StorageThread.h:

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::clearDiskCacheEntries):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::traverse):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
(WebKit::NetworkCache::runTaskInQueue):
* NetworkProcess/cache/NetworkCacheStorage.h:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CrossThreadTask.h:
(WTF::CrossThreadTask::CrossThreadTask):
* wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h.
* wtf/FunctionDispatcher.h:
* wtf/MainThread.cpp:
(WTF::functionQueue):
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
* wtf/MainThread.h:
* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::dispatch):
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
* wtf/efl/DispatchQueueWorkItemEfl.h:
(WorkItem::WorkItem):
(TimerWorkItem::create):
(TimerWorkItem::TimerWorkItem):
* wtf/efl/WorkQueueEfl.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::TimerBase::ScheduledTask::create):
(WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
(WTF::RunLoop::dispatchAfter):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::dispatch):
(WorkQueue::dispatchAfter):
* wtf/glib/RunLoopGLib.cpp:
(WTF::DispatchAfterContext::DispatchAfterContext):
(WTF::RunLoop::dispatchAfter):
* wtf/win/WorkItemWin.cpp:
(WTF::WorkItemWin::WorkItemWin):
(WTF::WorkItemWin::create):
(WTF::HandleWorkItem::HandleWorkItem):
(WTF::HandleWorkItem::createByAdoptingHandle):
* wtf/win/WorkItemWin.h:
(WTF::WorkItemWin::function):
* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):

Canonical link: https://commits.webkit.org/177198@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Jun 24, 2016
1 parent e4d003c commit c8ff0d1f7e84300fb1d7c60e3b54926501869b66
Showing 66 changed files with 304 additions and 165 deletions.
@@ -1,3 +1,56 @@
2016-06-21 Anders Carlsson <andersca@apple.com>

Rename NoncopyableFunction to Function
https://bugs.webkit.org/show_bug.cgi?id=158354

Reviewed by Chris Dumez.

* WTF.xcodeproj/project.pbxproj:
* wtf/CrossThreadTask.h:
(WTF::CrossThreadTask::CrossThreadTask):
* wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h.
* wtf/FunctionDispatcher.h:
* wtf/MainThread.cpp:
(WTF::functionQueue):
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
* wtf/MainThread.h:
* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::dispatch):
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
* wtf/efl/DispatchQueueWorkItemEfl.h:
(WorkItem::WorkItem):
(TimerWorkItem::create):
(TimerWorkItem::TimerWorkItem):
* wtf/efl/WorkQueueEfl.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::TimerBase::ScheduledTask::create):
(WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
(WTF::RunLoop::dispatchAfter):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::dispatch):
(WorkQueue::dispatchAfter):
* wtf/glib/RunLoopGLib.cpp:
(WTF::DispatchAfterContext::DispatchAfterContext):
(WTF::RunLoop::dispatchAfter):
* wtf/win/WorkItemWin.cpp:
(WTF::WorkItemWin::WorkItemWin):
(WTF::WorkItemWin::create):
(WTF::HandleWorkItem::HandleWorkItem):
(WTF::HandleWorkItem::createByAdoptingHandle):
* wtf/win/WorkItemWin.h:
(WTF::WorkItemWin::function):
* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):

2016-06-23 David Kilzer <ddkilzer@apple.com>

REGRESSION (r202380): iOS 9.x internal builds are broken
@@ -119,7 +119,7 @@
7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; };
8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
8134013915B092FD001FF0B8 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; };
83F2BADF1CF9524E003E99C3 /* NoncopyableFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F2BADE1CF9524E003E99C3 /* NoncopyableFunction.h */; };
83F2BADF1CF9524E003E99C3 /* Function.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F2BADE1CF9524E003E99C3 /* Function.h */; };
83FBA93219DF459700F30ADB /* TypeCasts.h in Headers */ = {isa = PBXBuildFile; fileRef = 83FBA93119DF459700F30ADB /* TypeCasts.h */; };
86F46F611A2840EE00CCBF22 /* RefCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F46F5F1A2840EE00CCBF22 /* RefCounter.h */; };
93934BD318A1E8C300D0D6A1 /* StringViewObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */; };
@@ -449,7 +449,7 @@
7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcRuntimeExtras.h; sourceTree = "<group>"; };
8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; };
8134013715B092FD001FF0B8 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
83F2BADE1CF9524E003E99C3 /* NoncopyableFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoncopyableFunction.h; sourceTree = "<group>"; };
83F2BADE1CF9524E003E99C3 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Function.h; sourceTree = "<group>"; };
83FBA93119DF459700F30ADB /* TypeCasts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeCasts.h; sourceTree = "<group>"; };
86F46F5F1A2840EE00CCBF22 /* RefCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefCounter.h; sourceTree = "<group>"; };
93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringViewObjC.mm; path = mac/StringViewObjC.mm; sourceTree = "<group>"; };
@@ -843,6 +843,7 @@
0F9D335C165DBA73005AD387 /* FilePrintStream.h */,
0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */,
A8A472A6151A825A004123FF /* Forward.h */,
83F2BADE1CF9524E003E99C3 /* Function.h */,
1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */,
1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */,
A8A472A8151A825A004123FF /* GetPtr.h */,
@@ -889,7 +890,6 @@
1A3F6BE6174ADA2100B2EEA7 /* NeverDestroyed.h */,
0F0D85B317234CB100338210 /* NoLock.h */,
A8A472D0151A825B004123FF /* Noncopyable.h */,
83F2BADE1CF9524E003E99C3 /* NoncopyableFunction.h */,
A8A472D5151A825B004123FF /* NumberOfCores.cpp */,
A8A472D6151A825B004123FF /* NumberOfCores.h */,
7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */,
@@ -1254,7 +1254,7 @@
A8A473D9151A825B004123FF /* HashTable.h in Headers */,
A8A473DA151A825B004123FF /* HashTraits.h in Headers */,
A8A473DB151A825B004123FF /* HexNumber.h in Headers */,
83F2BADF1CF9524E003E99C3 /* NoncopyableFunction.h in Headers */,
83F2BADF1CF9524E003E99C3 /* Function.h in Headers */,
2684D4361C000D400081D663 /* IndexSparseSet.h in Headers */,
A8A473DC151A825B004123FF /* InlineASM.h in Headers */,
A70DA0841799F04D00529A9B /* Insertion.h in Headers */,
@@ -26,7 +26,7 @@
#pragma once

#include <wtf/CrossThreadCopier.h>
#include <wtf/NoncopyableFunction.h>
#include <wtf/Function.h>
#include <wtf/StdLibExtras.h>

namespace WTF {
@@ -35,7 +35,7 @@ class CrossThreadTask {
public:
CrossThreadTask() = default;

CrossThreadTask(NoncopyableFunction<void ()>&& taskFunction)
CrossThreadTask(Function<void ()>&& taskFunction)
: m_taskFunction(WTFMove(taskFunction))
{
ASSERT(m_taskFunction);
@@ -47,7 +47,7 @@ class CrossThreadTask {
}

protected:
NoncopyableFunction<void ()> m_taskFunction;
Function<void ()> m_taskFunction;
};

template <typename T>
@@ -30,16 +30,16 @@

namespace WTF {

template<typename> class NoncopyableFunction;
template<typename> class Function;

template <typename Out, typename... In>
class NoncopyableFunction<Out(In...)> {
class Function<Out(In...)> {
public:
NoncopyableFunction() = default;
NoncopyableFunction(std::nullptr_t) { }
Function() = default;
Function(std::nullptr_t) { }

template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>
NoncopyableFunction(CallableType&& callable)
Function(CallableType&& callable)
: m_callableWrapper(std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable)))
{
}
@@ -54,13 +54,13 @@ class NoncopyableFunction<Out(In...)> {
explicit operator bool() const { return !!m_callableWrapper; }

template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>
NoncopyableFunction& operator=(CallableType&& callable)
Function& operator=(CallableType&& callable)
{
m_callableWrapper = std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable));
return *this;
}

NoncopyableFunction& operator=(std::nullptr_t)
Function& operator=(std::nullptr_t)
{
m_callableWrapper = nullptr;
return *this;
@@ -97,4 +97,4 @@ class NoncopyableFunction<Out(In...)> {

} // namespace WTF

using WTF::NoncopyableFunction;
using WTF::Function;
@@ -27,7 +27,7 @@
#define FunctionDispatcher_h

#include <functional>
#include <wtf/NoncopyableFunction.h>
#include <wtf/Function.h>
#include <wtf/ThreadSafeRefCounted.h>

namespace WTF {
@@ -39,7 +39,7 @@ class FunctionDispatcher : public ThreadSafeRefCounted<FunctionDispatcher> {
public:
WTF_EXPORT_PRIVATE virtual ~FunctionDispatcher();

virtual void dispatch(NoncopyableFunction<void ()>&&) = 0;
virtual void dispatch(Function<void ()>&&) = 0;

protected:
WTF_EXPORT_PRIVATE FunctionDispatcher();
@@ -47,9 +47,9 @@ static ThreadIdentifier mainThreadIdentifier;

static StaticLock mainThreadFunctionQueueMutex;

static Deque<NoncopyableFunction<void ()>>& functionQueue()
static Deque<Function<void ()>>& functionQueue()
{
static NeverDestroyed<Deque<NoncopyableFunction<void ()>>> functionQueue;
static NeverDestroyed<Deque<Function<void ()>>> functionQueue;
return functionQueue;
}

@@ -120,7 +120,7 @@ void dispatchFunctionsFromMainThread()

auto startTime = std::chrono::steady_clock::now();

NoncopyableFunction<void ()> function;
Function<void ()> function;

while (true) {
{
@@ -144,7 +144,7 @@ void dispatchFunctionsFromMainThread()
}
}

void callOnMainThread(NoncopyableFunction<void ()>&& function)
void callOnMainThread(Function<void ()>&& function)
{
ASSERT(function);

@@ -32,7 +32,7 @@

#include <functional>
#include <stdint.h>
#include <wtf/NoncopyableFunction.h>
#include <wtf/Function.h>

namespace WTF {

@@ -41,7 +41,7 @@ typedef uint32_t ThreadIdentifier;
// Must be called from the main thread.
WTF_EXPORT_PRIVATE void initializeMainThread();

WTF_EXPORT_PRIVATE void callOnMainThread(NoncopyableFunction<void ()>&&);
WTF_EXPORT_PRIVATE void callOnMainThread(Function<void ()>&&);

#if PLATFORM(COCOA)
WTF_EXPORT_PRIVATE void callOnWebThreadOrDispatchAsyncOnMainThread(void (^block)());
@@ -91,7 +91,7 @@ void RunLoop::performWork()

size_t functionsToHandle = 0;
{
NoncopyableFunction<void ()> function;
Function<void ()> function;
{
MutexLocker locker(m_functionQueueLock);
functionsToHandle = m_functionQueue.size();
@@ -106,7 +106,7 @@ void RunLoop::performWork()
}

for (size_t functionsHandled = 1; functionsHandled < functionsToHandle; ++functionsHandled) {
NoncopyableFunction<void ()> function;
Function<void ()> function;
{
MutexLocker locker(m_functionQueueLock);

@@ -123,7 +123,7 @@ void RunLoop::performWork()
}
}

void RunLoop::dispatch(NoncopyableFunction<void ()>&& function)
void RunLoop::dispatch(Function<void ()>&& function)
{
{
MutexLocker locker(m_functionQueueLock);
@@ -59,7 +59,7 @@ class RunLoop : public FunctionDispatcher {
WTF_EXPORT_PRIVATE static bool isMain();
~RunLoop();

void dispatch(NoncopyableFunction<void ()>&&) override;
void dispatch(Function<void ()>&&) override;

WTF_EXPORT_PRIVATE static void run();
WTF_EXPORT_PRIVATE void stop();
@@ -79,7 +79,7 @@ class RunLoop : public FunctionDispatcher {
#endif

#if USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP)
WTF_EXPORT_PRIVATE void dispatchAfter(std::chrono::nanoseconds, NoncopyableFunction<void ()>&&);
WTF_EXPORT_PRIVATE void dispatchAfter(std::chrono::nanoseconds, Function<void ()>&&);
#endif

class TimerBase {
@@ -155,7 +155,7 @@ class RunLoop : public FunctionDispatcher {
void performWork();

Mutex m_functionQueueLock;
Deque<NoncopyableFunction<void ()>> m_functionQueue;
Deque<Function<void ()>> m_functionQueue;

#if USE(WINDOWS_EVENT_LOOP)
static bool registerRunLoopMessageWindowClass();
@@ -70,8 +70,8 @@ class WorkQueue final : public FunctionDispatcher {
WTF_EXPORT_PRIVATE static Ref<WorkQueue> create(const char* name, Type = Type::Serial, QOS = QOS::Default);
virtual ~WorkQueue();

WTF_EXPORT_PRIVATE void dispatch(NoncopyableFunction<void ()>&&) override;
WTF_EXPORT_PRIVATE void dispatchAfter(std::chrono::nanoseconds, NoncopyableFunction<void ()>&&);
WTF_EXPORT_PRIVATE void dispatch(Function<void ()>&&) override;
WTF_EXPORT_PRIVATE void dispatchAfter(std::chrono::nanoseconds, Function<void ()>&&);

WTF_EXPORT_PRIVATE static void concurrentApply(size_t iterations, const std::function<void (size_t index)>&);

@@ -108,7 +108,7 @@ class WorkQueue final : public FunctionDispatcher {
volatile LONG m_isWorkThreadRegistered;

Mutex m_functionQueueLock;
Vector<NoncopyableFunction<void ()>> m_functionQueue;
Vector<Function<void ()>> m_functionQueue;

HANDLE m_timerQueue;
#elif USE(GLIB_EVENT_LOOP) || USE(GENERIC_EVENT_LOOP)
@@ -28,21 +28,21 @@

namespace WTF {

void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
void WorkQueue::dispatch(Function<void ()>&& function)
{
ref();
auto* functionPtr = new NoncopyableFunction<void ()>(WTFMove(function));
auto* functionPtr = new Function<void ()>(WTFMove(function));
dispatch_async(m_dispatchQueue, ^{
(*functionPtr)();
delete functionPtr;
deref();
});
}

void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, NoncopyableFunction<void ()>&& function)
void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, Function<void ()>&& function)
{
ref();
auto* functionPtr = new NoncopyableFunction<void ()>(WTFMove(function));
auto* functionPtr = new Function<void ()>(WTFMove(function));
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, duration.count()), m_dispatchQueue, ^{
(*functionPtr)();
delete functionPtr;
@@ -34,7 +34,7 @@

class WorkItem {
public:
WorkItem(Ref<WorkQueue>&& workQueue, NoncopyableFunction<void ()>&& function)
WorkItem(Ref<WorkQueue>&& workQueue, Function<void ()>&& function)
: m_workQueue(WTFMove(workQueue))
, m_function(WTFMove(function))
{
@@ -44,12 +44,12 @@ class WorkItem {

private:
Ref<WorkQueue> m_workQueue;
NoncopyableFunction<void ()> m_function;
Function<void ()> m_function;
};

class TimerWorkItem : public WorkItem {
public:
static std::unique_ptr<TimerWorkItem> create(Ref<WorkQueue>&& workQueue, NoncopyableFunction<void ()>&& function, std::chrono::nanoseconds delayNanoSeconds)
static std::unique_ptr<TimerWorkItem> create(Ref<WorkQueue>&& workQueue, Function<void ()>&& function, std::chrono::nanoseconds delayNanoSeconds)
{
ASSERT(delayNanoSeconds.count() >= 0);
return std::unique_ptr<TimerWorkItem>(new TimerWorkItem(WTFMove(workQueue), WTFMove(function), monotonicallyIncreasingTime() * 1000000000.0 + delayNanoSeconds.count()));
@@ -58,7 +58,7 @@ class TimerWorkItem : public WorkItem {
bool hasExpired(double currentTimeNanoSeconds) const { return currentTimeNanoSeconds >= m_expirationTimeNanoSeconds; }

protected:
TimerWorkItem(Ref<WorkQueue>&& workQueue, NoncopyableFunction<void ()>&& function, double expirationTimeNanoSeconds)
TimerWorkItem(Ref<WorkQueue>&& workQueue, Function<void ()>&& function, double expirationTimeNanoSeconds)
: WorkItem(WTFMove(workQueue), WTFMove(function))
, m_expirationTimeNanoSeconds(expirationTimeNanoSeconds)
{
@@ -54,15 +54,15 @@ void WorkQueue::unregisterSocketEventHandler(int fileDescriptor)
m_dispatchQueue->clearSocketEventHandler();
}

void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
void WorkQueue::dispatch(Function<void ()>&& function)
{
if (!m_dispatchQueue)
return;

m_dispatchQueue->dispatch(std::make_unique<WorkItem>(*this, WTFMove(function)));
}

void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, NoncopyableFunction<void ()>&& function)
void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, Function<void ()>&& function)
{
if (!m_dispatchQueue)
return;

0 comments on commit c8ff0d1

Please sign in to comment.