Rename NoncopyableFunction to Function
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 19:40:19 +0000 (19:40 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 19:40:19 +0000 (19:40 +0000)
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202439 268f45cc-cd09-0410-ab3c-d52691b4dbfc

66 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CrossThreadTask.h
Source/WTF/wtf/Function.h [moved from Source/WTF/wtf/NoncopyableFunction.h with 89% similarity]
Source/WTF/wtf/FunctionDispatcher.h
Source/WTF/wtf/MainThread.cpp
Source/WTF/wtf/MainThread.h
Source/WTF/wtf/RunLoop.cpp
Source/WTF/wtf/RunLoop.h
Source/WTF/wtf/WorkQueue.h
Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp
Source/WTF/wtf/efl/DispatchQueueWorkItemEfl.h
Source/WTF/wtf/efl/WorkQueueEfl.cpp
Source/WTF/wtf/generic/RunLoopGeneric.cpp
Source/WTF/wtf/generic/WorkQueueGeneric.cpp
Source/WTF/wtf/glib/RunLoopGLib.cpp
Source/WTF/wtf/win/WorkQueueWin.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
Source/WebCore/Modules/webaudio/AudioDestinationNode.h
Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp
Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bindings/js/SerializedScriptValue.h
Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp
Source/WebCore/dom/ActiveDOMCallbackMicrotask.h
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/fileapi/AsyncFileStream.cpp
Source/WebCore/fileapi/AsyncFileStream.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/scrolling/ScrollingThread.cpp
Source/WebCore/page/scrolling/ScrollingThread.h
Source/WebCore/platform/GenericTaskQueue.cpp
Source/WebCore/platform/GenericTaskQueue.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamPrivate.h
Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.mm
Source/WebCore/platform/network/BlobRegistry.h
Source/WebCore/platform/network/BlobRegistryImpl.cpp
Source/WebCore/platform/network/BlobRegistryImpl.h
Source/WebCore/style/StyleTreeResolver.cpp
Source/WebCore/style/StyleTreeResolver.h
Source/WebKit/ChangeLog
Source/WebKit/Storage/StorageSyncManager.cpp
Source/WebKit/Storage/StorageSyncManager.h
Source/WebKit/Storage/StorageThread.cpp
Source/WebKit/Storage/StorageThread.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h
Source/WebKit2/NetworkProcess/NetworkDataTask.h
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.h
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCache.h
Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h
Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp
Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h

index 0f1c592..190c123 100644 (file)
@@ -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
index fce3bae..434f66e 100644 (file)
                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 */; };
                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>"; };
                                0F9D335C165DBA73005AD387 /* FilePrintStream.h */,
                                0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */,
                                A8A472A6151A825A004123FF /* Forward.h */,
+                               83F2BADE1CF9524E003E99C3 /* Function.h */,
                                1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */,
                                1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */,
                                A8A472A8151A825A004123FF /* GetPtr.h */,
                                1A3F6BE6174ADA2100B2EEA7 /* NeverDestroyed.h */,
                                0F0D85B317234CB100338210 /* NoLock.h */,
                                A8A472D0151A825B004123FF /* Noncopyable.h */,
-                               83F2BADE1CF9524E003E99C3 /* NoncopyableFunction.h */,
                                A8A472D5151A825B004123FF /* NumberOfCores.cpp */,
                                A8A472D6151A825B004123FF /* NumberOfCores.h */,
                                7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */,
                                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 */,
index b4e96c4..0a66ec1 100644 (file)
@@ -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 @@ public:
     }
 
 protected:
-    NoncopyableFunction<void ()> m_taskFunction;
+    Function<void ()> m_taskFunction;
 };
 
 template <typename T>
similarity index 89%
rename from Source/WTF/wtf/NoncopyableFunction.h
rename to Source/WTF/wtf/Function.h
index eec3605..1c95856 100644 (file)
 
 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 @@ public:
     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 @@ private:
 
 } // namespace WTF
 
-using WTF::NoncopyableFunction;
+using WTF::Function;
index b52eecf..344a160 100644 (file)
@@ -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();
index bd11e10..6d42c4f 100644 (file)
@@ -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);
 
index f19f559..94c70c6 100644 (file)
@@ -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)());
index 9660f15..3b0267e 100644 (file)
@@ -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);
index e1558b6..3611d7a 100644 (file)
@@ -59,7 +59,7 @@ public:
     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 @@ public:
 #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 @@ private:
     void performWork();
 
     Mutex m_functionQueueLock;
-    Deque<NoncopyableFunction<void ()>> m_functionQueue;
+    Deque<Function<void ()>> m_functionQueue;
 
 #if USE(WINDOWS_EVENT_LOOP)
     static bool registerRunLoopMessageWindowClass();
index 6ac86f6..5ac32f8 100644 (file)
@@ -70,8 +70,8 @@ public:
     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 @@ private:
     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)
index 995a954..fdbef73 100644 (file)
 
 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;
@@ -39,10 +39,10 @@ void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
     });
 }
 
-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;
index 3ddfe57..162bab4 100644 (file)
@@ -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 @@ public:
 
 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 @@ public:
     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)
     {
index 40d1939..da913bf 100644 (file)
@@ -54,7 +54,7 @@ void WorkQueue::unregisterSocketEventHandler(int fileDescriptor)
     m_dispatchQueue->clearSocketEventHandler();
 }
 
-void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatch(Function<void ()>&& function)
 {
     if (!m_dispatchQueue)
         return;
@@ -62,7 +62,7 @@ void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
     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;
index 171ad30..25ae6f1 100644 (file)
@@ -32,12 +32,12 @@ namespace WTF {
 class RunLoop::TimerBase::ScheduledTask : public ThreadSafeRefCounted<ScheduledTask> {
 WTF_MAKE_NONCOPYABLE(ScheduledTask);
 public:
-    static RefPtr<ScheduledTask> create(NoncopyableFunction<void ()>&& function, double interval, bool repeating)
+    static RefPtr<ScheduledTask> create(Function<void ()>&& function, double interval, bool repeating)
     {
         return adoptRef(new ScheduledTask(WTFMove(function), interval, repeating));
     }
 
-    ScheduledTask(NoncopyableFunction<void ()>&& function, double interval, bool repeating)
+    ScheduledTask(Function<void ()>&& function, double interval, bool repeating)
         : m_function(WTFMove(function))
         , m_fireInterval(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(interval)))
         , m_isRepeating(repeating)
@@ -90,7 +90,7 @@ public:
     }
 
 private:
-    NoncopyableFunction<void ()> m_function;
+    Function<void ()> m_function;
     Condition::Clock::time_point m_scheduledTimePoint;
     std::chrono::microseconds m_fireInterval;
     std::atomic<bool> m_isActive { true };
@@ -237,7 +237,7 @@ void RunLoop::scheduleAndWakeUp(RefPtr<TimerBase::ScheduledTask> task)
     wakeUp(locker);
 }
 
-void RunLoop::dispatchAfter(std::chrono::nanoseconds delay, NoncopyableFunction<void ()>&& function)
+void RunLoop::dispatchAfter(std::chrono::nanoseconds delay, Function<void ()>&& function)
 {
     LockHolder locker(m_loopLock);
     bool repeating = false;
index 7f80e69..5c7b9b7 100644 (file)
@@ -81,7 +81,7 @@ void WorkQueue::platformInvalidate()
     }
 }
 
-void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatch(Function<void ()>&& function)
 {
     RefPtr<WorkQueue> protect(this);
     m_runLoop->dispatch([protect, function = WTFMove(function)] {
@@ -89,7 +89,7 @@ void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
     });
 }
 
-void WorkQueue::dispatchAfter(std::chrono::nanoseconds delay, NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatchAfter(std::chrono::nanoseconds delay, Function<void ()>&& function)
 {
     RefPtr<WorkQueue> protect(this);
     m_runLoop->dispatchAfter(delay, [protect, function = WTFMove(function)] {
index 89b7f70..927ce32 100644 (file)
@@ -124,7 +124,7 @@ void RunLoop::wakeUp()
 class DispatchAfterContext {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    DispatchAfterContext(NoncopyableFunction<void ()>&& function)
+    DispatchAfterContext(Function<void ()>&& function)
         : m_function(WTFMove(function))
     {
     }
@@ -135,10 +135,10 @@ public:
     }
 
 private:
-    NoncopyableFunction<void ()> m_function;
+    Function<void ()> m_function;
 };
 
-void RunLoop::dispatchAfter(std::chrono::nanoseconds duration, NoncopyableFunction<void ()>&& function)
+void RunLoop::dispatchAfter(std::chrono::nanoseconds duration, Function<void ()>&& function)
 {
     GRefPtr<GSource> source = adoptGRef(g_timeout_source_new(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count()));
     g_source_set_name(source.get(), "[WebKit] RunLoop dispatchAfter");
index 703ef09..f4c4b8c 100644 (file)
@@ -51,7 +51,7 @@ void WorkQueue::performWorkOnRegisteredWorkThread()
     m_functionQueueLock.lock();
 
     while (!m_functionQueue.isEmpty()) {
-        Vector<NoncopyableFunction<void ()>> functionQueue;
+        Vector<Function<void ()>> functionQueue;
         m_functionQueue.swap(functionQueue);
 
         // Allow more work to be scheduled while we're not using the queue directly.
@@ -98,7 +98,7 @@ void WorkQueue::platformInvalidate()
     ::DeleteTimerQueueEx(m_timerQueue, 0);
 }
 
-void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatch(Function<void ()>&& function)
 {
     MutexLocker locker(m_functionQueueLock);
     ref();
@@ -118,7 +118,7 @@ struct TimerContext : public ThreadSafeRefCounted<TimerContext> {
     static RefPtr<TimerContext> create() { return adoptRef(new TimerContext); }
 
     WorkQueue* queue;
-    NoncopyableFunction<void ()> function;
+    Function<void ()> function;
     Mutex timerMutex;
     HANDLE timer;
 
@@ -149,7 +149,7 @@ void WorkQueue::timerCallback(void* context, BOOLEAN timerOrWaitFired)
     }
 }
 
-void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, Function<void ()>&& function)
 {
     ASSERT(m_timerQueue);
     ref();
index aba427f..79a1aec 100644 (file)
@@ -1,3 +1,58 @@
+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.
+
+        * 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:
+
 2016-06-24  Amir Alavi  <aalavi@apple.com>
 
         Use _CFHTTPCookieStorageGetDefault directly instead of NSHTTPCookieStorage to get default cookie storage
index bc4d5c5..eb53818 100644 (file)
@@ -108,7 +108,7 @@ static bool hasUnassociatedTransceivers(const RtpTransceiverVector& transceivers
     });
 }
 
-void MediaEndpointPeerConnection::runTask(NoncopyableFunction<void ()>&& task)
+void MediaEndpointPeerConnection::runTask(Function<void ()>&& task)
 {
     if (m_dtlsFingerprint.isNull()) {
         // Only one task needs to be deferred since it will hold off any others until completed.
index e6ea000..0f3fb5e 100644 (file)
@@ -37,7 +37,7 @@
 #include "MediaEndpointSessionDescription.h"
 #include "NotImplemented.h"
 #include "PeerConnectionBackend.h"
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
@@ -85,7 +85,7 @@ public:
     void clearNegotiationNeededState() override { m_negotiationNeeded = false; };
 
 private:
-    void runTask(NoncopyableFunction<void ()>&&);
+    void runTask(Function<void ()>&&);
     void startRunningTasks();
 
     void createOfferTask(RTCOfferOptions&, PeerConnection::SessionDescriptionPromise&);
@@ -113,7 +113,7 @@ private:
     PeerConnectionBackendClient* m_client;
     std::unique_ptr<MediaEndpoint> m_mediaEndpoint;
 
-    NoncopyableFunction<void ()> m_initialDeferredTask;
+    Function<void ()> m_initialDeferredTask;
 
     std::unique_ptr<SDPProcessor> m_sdpProcessor;
 
index cfe8f15..88a7f71 100644 (file)
@@ -30,7 +30,7 @@
 #include "AudioIOCallback.h"
 #include "AudioNode.h"
 #include "AudioSourceProvider.h"
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 
 namespace WebCore {
 
@@ -59,9 +59,9 @@ public:
     virtual void enableInput(const String& inputDeviceId) = 0;
 
     virtual void startRendering() = 0;
-    virtual void resume(NoncopyableFunction<void ()>&&) { }
-    virtual void suspend(NoncopyableFunction<void ()>&&) { }
-    virtual void close(NoncopyableFunction<void ()>&&) { }
+    virtual void resume(Function<void ()>&&) { }
+    virtual void suspend(Function<void ()>&&) { }
+    virtual void close(Function<void ()>&&) { }
 
     virtual bool isPlaying() { return false; }
     void isPlayingDidChange() override;
index ac1371e..7ceccba 100644 (file)
@@ -106,7 +106,7 @@ void DefaultAudioDestinationNode::startRendering()
         m_destination->start();
 }
 
-void DefaultAudioDestinationNode::resume(NoncopyableFunction<void ()>&& function)
+void DefaultAudioDestinationNode::resume(Function<void ()>&& function)
 {
     ASSERT(isInitialized());
     if (isInitialized())
@@ -115,7 +115,7 @@ void DefaultAudioDestinationNode::resume(NoncopyableFunction<void ()>&& function
         scriptExecutionContext->postTask(WTFMove(function));
 }
 
-void DefaultAudioDestinationNode::suspend(NoncopyableFunction<void ()>&& function)
+void DefaultAudioDestinationNode::suspend(Function<void ()>&& function)
 {
     ASSERT(isInitialized());
     if (isInitialized())
@@ -124,7 +124,7 @@ void DefaultAudioDestinationNode::suspend(NoncopyableFunction<void ()>&& functio
         scriptExecutionContext->postTask(WTFMove(function));
 }
 
-void DefaultAudioDestinationNode::close(NoncopyableFunction<void()>&& function)
+void DefaultAudioDestinationNode::close(Function<void()>&& function)
 {
     ASSERT(isInitialized());
     uninitialize();
index 09c9b38..35a0df1 100644 (file)
@@ -50,9 +50,9 @@ public:
     // AudioDestinationNode
     void enableInput(const String& inputDeviceId) override;
     void startRendering() override;
-    void resume(NoncopyableFunction<void ()>&&) override;
-    void suspend(NoncopyableFunction<void ()>&&) override;
-    void close(NoncopyableFunction<void ()>&&) override;
+    void resume(Function<void ()>&&) override;
+    void suspend(Function<void ()>&&) override;
+    void close(Function<void ()>&&) override;
     unsigned long maxChannelCount() const override;
     bool isPlaying() override;
 
index 869b6ea..bbf9637 100644 (file)
@@ -2798,7 +2798,7 @@ Vector<String> SerializedScriptValue::blobURLsIsolatedCopy() const
     return result;
 }
 
-void SerializedScriptValue::writeBlobsToDiskForIndexedDB(NoncopyableFunction<void (const IDBValue&)>&& completionHandler)
+void SerializedScriptValue::writeBlobsToDiskForIndexedDB(WTF::Function<void (const IDBValue&)>&& completionHandler)
 {
     ASSERT(isMainThread());
     ASSERT(hasBlobURLs());
index 4c670e6..5388bb2 100644 (file)
@@ -31,7 +31,7 @@
 #include <runtime/ArrayBuffer.h>
 #include <runtime/JSCJSValue.h>
 #include <wtf/Forward.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
@@ -87,7 +87,7 @@ public:
 
 #if ENABLE(INDEXED_DATABASE)
     Vector<String> blobURLsIsolatedCopy() const;
-    void writeBlobsToDiskForIndexedDB(NoncopyableFunction<void (const IDBValue&)>&& completionHandler);
+    void writeBlobsToDiskForIndexedDB(Function<void (const IDBValue&)>&& completionHandler);
     IDBValue writeBlobsToDiskForIndexedDBSynchronously();
 #endif // ENABLE(INDEXED_DATABASE)
 
index 7aa2269..66f590a 100644 (file)
@@ -28,7 +28,7 @@
 
 namespace WebCore {
 
-ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask(MicrotaskQueue& queue, ScriptExecutionContext& scriptExecutionContext, NoncopyableFunction<void()>&& task)
+ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask(MicrotaskQueue& queue, ScriptExecutionContext& scriptExecutionContext, Function<void()>&& task)
     : ActiveDOMCallback(&scriptExecutionContext)
     , m_queue(queue)
     , m_task(WTFMove(task))
index e11c4d0..8a7f7f6 100644 (file)
 
 #include "ActiveDOMCallback.h"
 #include "Microtasks.h"
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 
 namespace WebCore {
 
 class ActiveDOMCallbackMicrotask final : public Microtask, public ActiveDOMCallback {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    WEBCORE_EXPORT ActiveDOMCallbackMicrotask(MicrotaskQueue&, ScriptExecutionContext&, NoncopyableFunction<void()>&&);
+    WEBCORE_EXPORT ActiveDOMCallbackMicrotask(MicrotaskQueue&, ScriptExecutionContext&, Function<void()>&&);
     WEBCORE_EXPORT virtual ~ActiveDOMCallbackMicrotask();
 
     Result run() override;
@@ -46,7 +46,7 @@ private:
     // be accessed via the ScriptExecutionContext, which should hold a reference to the relevent
     // queue.
     MicrotaskQueue& m_queue;
-    NoncopyableFunction<void()> m_task;
+    Function<void()> m_task;
 };
 
 } // namespace WebCore
index da58e00..cb2e6e8 100644 (file)
@@ -33,8 +33,8 @@
 #include "Supplementable.h"
 #include <runtime/ConsoleTypes.h>
 #include <wtf/CrossThreadTask.h>
+#include <wtf/Function.h>
 #include <wtf/HashSet.h>
-#include <wtf/NoncopyableFunction.h>
 
 namespace Deprecated {
 class ScriptValue;
@@ -138,20 +138,20 @@ public:
     public:
         enum CleanupTaskTag { CleanupTask };
 
-        template<typename T, typename = typename std::enable_if<!std::is_base_of<Task, T>::value && std::is_convertible<T, NoncopyableFunction<void (ScriptExecutionContext&)>>::value>::type>
+        template<typename T, typename = typename std::enable_if<!std::is_base_of<Task, T>::value && std::is_convertible<T, WTF::Function<void (ScriptExecutionContext&)>>::value>::type>
         Task(T task)
             : m_task(WTFMove(task))
             , m_isCleanupTask(false)
         {
         }
 
-        Task(NoncopyableFunction<void ()>&& task)
+        Task(WTF::Function<void ()>&& task)
             : m_task([task = WTFMove(task)](ScriptExecutionContext&) { task(); })
             , m_isCleanupTask(false)
         {
         }
 
-        template<typename T, typename = typename std::enable_if<std::is_convertible<T, NoncopyableFunction<void (ScriptExecutionContext&)>>::value>::type>
+        template<typename T, typename = typename std::enable_if<std::is_convertible<T, WTF::Function<void (ScriptExecutionContext&)>>::value>::type>
         Task(CleanupTaskTag, T task)
             : m_task(WTFMove(task))
             , m_isCleanupTask(true)
@@ -162,7 +162,7 @@ public:
         bool isCleanupTask() const { return m_isCleanupTask; }
 
     protected:
-        NoncopyableFunction<void (ScriptExecutionContext&)> m_task;
+        WTF::Function<void (ScriptExecutionContext&)> m_task;
         bool m_isCleanupTask;
     };
 
index 4ae6c80..9a93a1b 100644 (file)
 #include "FileStreamClient.h"
 #include "URL.h"
 #include <wtf/AutodrainedPool.h>
+#include <wtf/Function.h>
 #include <wtf/MainThread.h>
 #include <wtf/MessageQueue.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/NoncopyableFunction.h>
 
 namespace WebCore {
 
@@ -64,12 +64,12 @@ inline AsyncFileStream::Internals::Internals(FileStreamClient& client)
 #endif
 }
 
-static void callOnFileThread(NoncopyableFunction<void ()>&& function)
+static void callOnFileThread(Function<void ()>&& function)
 {
     ASSERT(isMainThread());
     ASSERT(function);
 
-    static NeverDestroyed<MessageQueue<NoncopyableFunction<void ()>>> queue;
+    static NeverDestroyed<MessageQueue<Function<void ()>>> queue;
 
     static std::once_flag createFileThreadOnce;
     std::call_once(createFileThreadOnce, [] {
@@ -90,7 +90,7 @@ static void callOnFileThread(NoncopyableFunction<void ()>&& function)
         });
     });
 
-    queue.get().append(std::make_unique<NoncopyableFunction<void ()>>(WTFMove(function)));
+    queue.get().append(std::make_unique<Function<void ()>>(WTFMove(function)));
 }
 
 AsyncFileStream::AsyncFileStream(FileStreamClient& client)
@@ -114,7 +114,7 @@ AsyncFileStream::~AsyncFileStream()
     });
 }
 
-void AsyncFileStream::perform(NoncopyableFunction<std::function<void(FileStreamClient&)>(FileStream&)>&& operation)
+void AsyncFileStream::perform(Function<std::function<void(FileStreamClient&)>(FileStream&)>&& operation)
 {
     auto& internals = *m_internals;
     callOnFileThread([&internals, operation = WTFMove(operation)] {
index 088bb37..35e85a7 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <functional>
 #include <wtf/Forward.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 
 namespace WebCore {
 
@@ -57,7 +57,7 @@ public:
 
 private:
     void start();
-    void perform(NoncopyableFunction<std::function<void(FileStreamClient&)>(FileStream&)>&&);
+    void perform(Function<std::function<void(FileStreamClient&)>(FileStream&)>&&);
 
     struct Internals;
     std::unique_ptr<Internals> m_internals;
index e6ec707..1e12da1 100644 (file)
@@ -3145,7 +3145,7 @@ void FrameView::flushAnyPendingPostLayoutTasks()
         updateEmbeddedObjectsTimerFired();
 }
 
-void FrameView::queuePostLayoutCallback(NoncopyableFunction<void()>&& callback)
+void FrameView::queuePostLayoutCallback(Function<void()>&& callback)
 {
     m_postLayoutCallbackQueue.append(WTFMove(callback));
 }
@@ -3158,7 +3158,7 @@ void FrameView::flushPostLayoutTasksQueue()
     if (!m_postLayoutCallbackQueue.size())
         return;
 
-    Vector<NoncopyableFunction<void()>> queue = WTFMove(m_postLayoutCallbackQueue);
+    Vector<Function<void()>> queue = WTFMove(m_postLayoutCallbackQueue);
     for (auto& task : queue)
         task();
 }
index 9ad8a51..767114b 100644 (file)
@@ -35,9 +35,9 @@
 #include "ScrollView.h"
 #include <memory>
 #include <wtf/Forward.h>
+#include <wtf/Function.h>
 #include <wtf/HashSet.h>
 #include <wtf/ListHashSet.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -111,7 +111,7 @@ public:
     void scheduleRelayout();
     void scheduleRelayoutOfSubtree(RenderElement&);
     void unscheduleRelayout();
-    void queuePostLayoutCallback(NoncopyableFunction<void()>&&);
+    void queuePostLayoutCallback(Function<void()>&&);
     bool layoutPending() const;
     bool isInLayout() const { return m_layoutPhase != OutsideLayout; }
     bool isInRenderTreeLayout() const { return m_layoutPhase == InRenderTreeLayout; }
@@ -828,7 +828,7 @@ private:
     ScrollPinningBehavior m_scrollPinningBehavior;
 
     IntRect* m_cachedWindowClipRect { nullptr };
-    Vector<NoncopyableFunction<void()>> m_postLayoutCallbackQueue;
+    Vector<Function<void()>> m_postLayoutCallbackQueue;
 };
 
 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
index 5760783..730c0a6 100644 (file)
@@ -45,7 +45,7 @@ bool ScrollingThread::isCurrentThread()
     return threadIdentifier && currentThread() == threadIdentifier;
 }
 
-void ScrollingThread::dispatch(NoncopyableFunction<void ()>&& function)
+void ScrollingThread::dispatch(Function<void ()>&& function)
 {
     auto& scrollingThread = ScrollingThread::singleton();
     scrollingThread.createThreadIfNeeded();
@@ -58,7 +58,7 @@ void ScrollingThread::dispatch(NoncopyableFunction<void ()>&& function)
     scrollingThread.wakeUpRunLoop();
 }
 
-void ScrollingThread::dispatchBarrier(NoncopyableFunction<void ()>&& function)
+void ScrollingThread::dispatchBarrier(Function<void ()>&& function)
 {
     dispatch([function = WTFMove(function)]() mutable {
         callOnMainThread(WTFMove(function));
@@ -104,7 +104,7 @@ void ScrollingThread::dispatchFunctionsFromScrollingThread()
 {
     ASSERT(isCurrentThread());
 
-    Vector<NoncopyableFunction<void ()>> functions;
+    Vector<Function<void ()>> functions;
     
     {
         std::lock_guard<Lock> lock(m_functionsMutex);
index 037f95b..28d5755 100644 (file)
@@ -31,9 +31,9 @@
 #include <functional>
 #include <wtf/Condition.h>
 #include <wtf/Forward.h>
+#include <wtf/Function.h>
 #include <wtf/Lock.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
 
@@ -48,11 +48,11 @@ class ScrollingThread {
 
 public:
     static bool isCurrentThread();
-    WEBCORE_EXPORT static void dispatch(NoncopyableFunction<void ()>&&);
+    WEBCORE_EXPORT static void dispatch(Function<void ()>&&);
 
     // Will dispatch the given function on the main thread once all pending functions
     // on the scrolling thread have finished executing. Used for synchronization purposes.
-    WEBCORE_EXPORT static void dispatchBarrier(NoncopyableFunction<void ()>&&);
+    WEBCORE_EXPORT static void dispatchBarrier(Function<void ()>&&);
 
 private:
     friend NeverDestroyed<ScrollingThread>;
@@ -80,7 +80,7 @@ private:
     Lock m_initializeRunLoopMutex;
 
     Lock m_functionsMutex;
-    Vector<NoncopyableFunction<void ()>> m_functions;
+    Vector<Function<void ()>> m_functions;
 
 #if PLATFORM(COCOA)
     // FIXME: We should use WebCore::RunLoop here.
index 0c6c243..1aa7e1b 100644 (file)
@@ -36,7 +36,7 @@ TaskDispatcher<Timer>::TaskDispatcher()
 {
 }
 
-void TaskDispatcher<Timer>::postTask(NoncopyableFunction<void()>&& function)
+void TaskDispatcher<Timer>::postTask(Function<void()>&& function)
 {
     m_pendingTasks.append(WTFMove(function));
     pendingDispatchers().append(m_weakPtrFactory.createWeakPtr());
index 4d85c9a..f50a361 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "Timer.h"
 #include <wtf/Deque.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/WeakPtr.h>
 
 namespace WebCore {
@@ -40,7 +40,7 @@ public:
     {
     }
 
-    void postTask(NoncopyableFunction<void()>&& f)
+    void postTask(Function<void()>&& f)
     {
         m_context.postTask(WTFMove(f));
     }
@@ -53,7 +53,7 @@ template<>
 class TaskDispatcher<Timer> {
 public:
     TaskDispatcher();
-    void postTask(NoncopyableFunction<void()>&&);
+    void postTask(Function<void()>&&);
 
 private:
     static Timer& sharedTimer();
@@ -63,7 +63,7 @@ private:
     void dispatchOneTask();
 
     WeakPtrFactory<TaskDispatcher> m_weakPtrFactory;
-    Deque<NoncopyableFunction<void()>> m_pendingTasks;
+    Deque<Function<void()>> m_pendingTasks;
 };
 
 template <typename T>
@@ -81,7 +81,7 @@ public:
     {
     }
 
-    typedef NoncopyableFunction<void()> TaskFunction;
+    typedef Function<void()> TaskFunction;
 
     void enqueueTask(TaskFunction&& task)
     {
index 869a68e..20c9460 100644 (file)
@@ -30,8 +30,8 @@
 
 #include "MediaPlayerPrivate.h"
 #include "MediaStreamPrivate.h"
+#include <wtf/Function.h>
 #include <wtf/MediaTime.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/Vector.h>
 #include <wtf/WeakPtr.h>
 
@@ -143,7 +143,7 @@ private:
     void updateTracks();
     void renderingModeChanged();
 
-    void scheduleDeferredTask(NoncopyableFunction<void ()>&&);
+    void scheduleDeferredTask(Function<void ()>&&);
 
     enum DisplayMode {
         None,
index 881c3e0..f4c1457 100644 (file)
@@ -624,7 +624,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::setNetworkState(MediaPlayer::NetworkS
     m_player->networkStateChanged();
 }
 
-void MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask(NoncopyableFunction<void ()>&& function)
+void MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask(Function<void ()>&& function)
 {
     ASSERT(function);
     callOnMainThread([weakThis = createWeakPtr(), function = WTFMove(function)] {
index d49d151..1872cd2 100644 (file)
@@ -299,7 +299,7 @@ void MediaStreamPrivate::trackEnded(MediaStreamTrackPrivate&)
     });
 }
 
-void MediaStreamPrivate::scheduleDeferredTask(NoncopyableFunction<void ()>&& function)
+void MediaStreamPrivate::scheduleDeferredTask(Function<void ()>&& function)
 {
     ASSERT(function);
     callOnMainThread([weakThis = createWeakPtr(), function = WTFMove(function)] {
index 92304ef..abfcab6 100644 (file)
@@ -39,9 +39,9 @@
 #include "FloatSize.h"
 #include "MediaStreamTrack.h"
 #include "MediaStreamTrackPrivate.h"
+#include <wtf/Function.h>
 #include <wtf/HashMap.h>
 #include <wtf/MediaTime.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -112,7 +112,7 @@ private:
     void characteristicsChanged();
     void updateActiveVideoTrack();
 
-    void scheduleDeferredTask(NoncopyableFunction<void ()>&&);
+    void scheduleDeferredTask(Function<void ()>&&);
 
     WeakPtrFactory<MediaStreamPrivate> m_weakPtrFactory;
     Vector<Observer*> m_observers;
index f474aeb..74d7ffc 100644 (file)
@@ -31,7 +31,7 @@
 #include "GenericTaskQueue.h"
 #include "RealtimeMediaSource.h"
 #include "Timer.h"
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/WeakPtr.h>
 
@@ -86,7 +86,7 @@ protected:
     void setVideoSampleBufferDelegate(AVCaptureVideoDataOutput*);
     void setAudioSampleBufferDelegate(AVCaptureAudioDataOutput*);
 
-    void scheduleDeferredTask(NoncopyableFunction<void ()>&&);
+    void scheduleDeferredTask(Function<void ()>&&);
 
 private:
     void setupSession();
index 76afd9b..c2d928d 100644 (file)
@@ -240,7 +240,7 @@ void AVMediaCaptureSource::setAudioSampleBufferDelegate(AVCaptureAudioDataOutput
     [audioOutput setSampleBufferDelegate:m_objcObserver.get() queue:globaAudioCaptureSerialQueue()];
 }
 
-void AVMediaCaptureSource::scheduleDeferredTask(NoncopyableFunction<void ()>&& function)
+void AVMediaCaptureSource::scheduleDeferredTask(Function<void ()>&& function)
 {
     ASSERT(function);
     callOnMainThread([weakThis = createWeakPtr(), function = WTFMove(function)] {
index 279579c..e225fec 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <functional>
 #include <wtf/Forward.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -67,7 +67,7 @@ public:
 
     virtual unsigned long long blobSize(const URL&) = 0;
 
-    virtual void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler) = 0;
+    virtual void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler) = 0;
 
     virtual bool isBlobRegistryImpl() const { return false; }
 
index 6806035..a67facf 100644 (file)
@@ -252,7 +252,7 @@ struct BlobForFileWriting {
     Vector<std::pair<String, ThreadSafeDataBuffer>> filePathsOrDataBuffers;
 };
 
-void BlobRegistryImpl::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler)
+void BlobRegistryImpl::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
 {
     Vector<BlobForFileWriting> blobsForWriting;
     for (auto& url : blobURLs) {
index 458c065..20397e9 100644 (file)
@@ -67,7 +67,7 @@ private:
 
     unsigned long long blobSize(const URL&) override;
 
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler) override;
+    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler) override;
 
     HashMap<String, RefPtr<BlobData>> m_blobs;
 };
index 70a1fae..0c19c62 100644 (file)
@@ -532,13 +532,13 @@ std::unique_ptr<Update> TreeResolver::resolve(Change change)
     return WTFMove(m_update);
 }
 
-static Vector<NoncopyableFunction<void ()>>& postResolutionCallbackQueue()
+static Vector<Function<void ()>>& postResolutionCallbackQueue()
 {
-    static NeverDestroyed<Vector<NoncopyableFunction<void ()>>> vector;
+    static NeverDestroyed<Vector<Function<void ()>>> vector;
     return vector;
 }
 
-void queuePostResolutionCallback(NoncopyableFunction<void ()>&& callback)
+void queuePostResolutionCallback(Function<void ()>&& callback)
 {
     postResolutionCallbackQueue().append(WTFMove(callback));
 }
index 3ce7046..f7466d1 100644 (file)
@@ -32,9 +32,8 @@
 #include "StyleChange.h"
 #include "StyleSharingResolver.h"
 #include "StyleUpdate.h"
-#include <functional>
+#include <wtf/Function.h>
 #include <wtf/HashMap.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
@@ -110,7 +109,7 @@ private:
     std::unique_ptr<Update> m_update;
 };
 
-void queuePostResolutionCallback(NoncopyableFunction<void ()>&&);
+void queuePostResolutionCallback(Function<void ()>&&);
 bool postResolutionCallbacksAreSuspended();
 
 bool isPlaceholderStyle(const RenderStyle&);
index 8e65053..5e15921 100644 (file)
@@ -1,3 +1,18 @@
+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.
+
+        * Storage/StorageSyncManager.cpp:
+        (WebCore::StorageSyncManager::dispatch):
+        * Storage/StorageSyncManager.h:
+        * Storage/StorageThread.cpp:
+        (WebCore::StorageThread::dispatch):
+        (WebCore::StorageThread::terminate):
+        * Storage/StorageThread.h:
+
 2016-06-22  Anders Carlsson  <andersca@apple.com>
 
         Move the WebKitLegacy Apple Pay code to the open source repository
index e1a4a15..edc9eb3 100644 (file)
@@ -63,7 +63,7 @@ String StorageSyncManager::fullDatabaseFilename(const String& databaseIdentifier
     return pathByAppendingComponent(m_path, databaseIdentifier + ".localstorage");
 }
 
-void StorageSyncManager::dispatch(NoncopyableFunction<void ()>&& function)
+void StorageSyncManager::dispatch(Function<void ()>&& function)
 {
     ASSERT(isMainThread());
     ASSERT(m_thread);
index 75a486b..89e6b43 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <functional>
 #include <wtf/Forward.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
@@ -43,7 +43,7 @@ public:
     static Ref<StorageSyncManager> create(const String& path);
     ~StorageSyncManager();
 
-    void dispatch(NoncopyableFunction<void ()>&&);
+    void dispatch(Function<void ()>&&);
     void close();
 
 private:
index 2966e04..0b6ed07 100644 (file)
@@ -74,11 +74,11 @@ void StorageThread::threadEntryPoint()
     }
 }
 
-void StorageThread::dispatch(NoncopyableFunction<void ()>&& function)
+void StorageThread::dispatch(Function<void ()>&& function)
 {
     ASSERT(isMainThread());
     ASSERT(!m_queue.killed() && m_threadID);
-    m_queue.append(std::make_unique<NoncopyableFunction<void ()>>(WTFMove(function)));
+    m_queue.append(std::make_unique<Function<void ()>>(WTFMove(function)));
 }
 
 void StorageThread::terminate()
@@ -90,7 +90,7 @@ void StorageThread::terminate()
     if (!m_threadID)
         return;
 
-    m_queue.append(std::make_unique<NoncopyableFunction<void ()>>([this] {
+    m_queue.append(std::make_unique<Function<void ()>>([this] {
         performTerminate();
     }));
     waitForThreadCompletion(m_threadID);
index 4752d5b..3f1b884 100644 (file)
 #ifndef StorageThread_h
 #define StorageThread_h
 
-#include <functional>
+#include <wtf/Function.h>
 #include <wtf/HashSet.h>
 #include <wtf/MessageQueue.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/Threading.h>
 
 namespace WebCore {
@@ -46,7 +45,7 @@ public:
     bool start();
     void terminate();
 
-    void dispatch(NoncopyableFunction<void ()>&&);
+    void dispatch(Function<void ()>&&);
 
     static void releaseFastMallocFreeMemoryInAllThreads();
 
@@ -59,7 +58,7 @@ private:
     void performTerminate();
 
     ThreadIdentifier m_threadID;
-    MessageQueue<NoncopyableFunction<void ()>> m_queue;
+    MessageQueue<Function<void ()>> m_queue;
 };
 
 } // namespace WebCore
index 12cc65a..8d33f85 100644 (file)
@@ -1,3 +1,22 @@
+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.
+
+        * 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:
+
 2016-06-22  Anders Carlsson  <andersca@apple.com>
 
         Move WebKit2 Apple Pay code to the open source repository
index d34d842..8dcf1be 100644 (file)
@@ -132,7 +132,7 @@ uint64_t NetworkBlobRegistry::blobSize(NetworkConnectionToWebProcess* connection
     return blobRegistry().blobSize(url);
 }
 
-void NetworkBlobRegistry::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void(const Vector<String>&)>&& completionHandler)
+void NetworkBlobRegistry::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void(const Vector<String>&)>&& completionHandler)
 {
     blobRegistry().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
 }
index a20169a..7406a3c 100644 (file)
 #define NetworkBlobRegistry_h
 
 #include <WebCore/URLHash.h>
-#include <functional>
+#include <wtf/Function.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/NoncopyableFunction.h>
 
 namespace WebCore {
 class BlobDataFileReference;
@@ -55,7 +54,7 @@ public:
     void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
     void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&);
     uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&);
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void(const Vector<String>&)>&& completionHandler);
+    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>&)>&& completionHandler);
 
     void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*);
 
index dba2c88..d546d91 100644 (file)
@@ -33,7 +33,7 @@
 #include <WebCore/ResourceLoaderOptions.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/Timer.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/text/WTFString.h>
 
@@ -63,9 +63,9 @@ enum class AuthenticationChallengeDisposition {
     RejectProtectionSpace
 };
     
-typedef NoncopyableFunction<void(const WebCore::ResourceRequest&)> RedirectCompletionHandler;
-typedef NoncopyableFunction<void(AuthenticationChallengeDisposition, const WebCore::Credential&)> ChallengeCompletionHandler;
-typedef NoncopyableFunction<void(WebCore::PolicyAction)> ResponseCompletionHandler;
+typedef Function<void(const WebCore::ResourceRequest&)> RedirectCompletionHandler;
+typedef Function<void(AuthenticationChallengeDisposition, const WebCore::Credential&)> ChallengeCompletionHandler;
+typedef Function<void(WebCore::PolicyAction)> ResponseCompletionHandler;
 
 class NetworkDataTaskClient {
 public:
index b4288f5..b871810 100644 (file)
@@ -293,7 +293,7 @@ void NetworkProcess::destroyPrivateBrowsingSession(SessionID sessionID)
     SessionTracker::destroySession(sessionID);
 }
 
-void NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs(const Vector<String>& filenames, NoncopyableFunction<void ()>&& completionHandler)
+void NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs(const Vector<String>& filenames, Function<void ()>&& completionHandler)
 {
     static uint64_t lastRequestID;
 
@@ -308,7 +308,7 @@ void NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs(uint64_t
         handler();
 }
 
-static void fetchDiskCacheEntries(SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, NoncopyableFunction<void (Vector<WebsiteData::Entry>)>&& completionHandler)
+static void fetchDiskCacheEntries(SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void (Vector<WebsiteData::Entry>)>&& completionHandler)
 {
 #if ENABLE(NETWORK_CACHE)
     if (NetworkCache::singleton().isEnabled()) {
@@ -352,7 +352,7 @@ static void fetchDiskCacheEntries(SessionID sessionID, OptionSet<WebsiteDataFetc
 void NetworkProcess::fetchWebsiteData(SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, OptionSet<WebsiteDataFetchOption> fetchOptions, uint64_t callbackID)
 {
     struct CallbackAggregator final : public RefCounted<CallbackAggregator> {
-        explicit CallbackAggregator(NoncopyableFunction<void (WebsiteData)>&& completionHandler)
+        explicit CallbackAggregator(Function<void (WebsiteData)>&& completionHandler)
             : m_completionHandler(WTFMove(completionHandler))
         {
         }
@@ -366,7 +366,7 @@ void NetworkProcess::fetchWebsiteData(SessionID sessionID, OptionSet<WebsiteData
             });
         }
 
-        NoncopyableFunction<void (WebsiteData)> m_completionHandler;
+        Function<void (WebsiteData)> m_completionHandler;
         WebsiteData m_websiteData;
     };
 
@@ -412,7 +412,7 @@ void NetworkProcess::deleteWebsiteData(SessionID sessionID, OptionSet<WebsiteDat
     completionHandler();
 }
 
-static void clearDiskCacheEntries(const Vector<SecurityOriginData>& origins, NoncopyableFunction<void ()>&& completionHandler)
+static void clearDiskCacheEntries(const Vector<SecurityOriginData>& origins, Function<void ()>&& completionHandler)
 {
 #if ENABLE(NETWORK_CACHE)
     if (NetworkCache::singleton().isEnabled()) {
index cb8009e..f218127 100644 (file)
@@ -35,8 +35,8 @@
 #include <WebCore/SessionID.h>
 #include <memory>
 #include <wtf/Forward.h>
+#include <wtf/Function.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS)
@@ -113,7 +113,7 @@ public:
 
     void ensurePrivateBrowsingSession(WebCore::SessionID);
 
-    void grantSandboxExtensionsToDatabaseProcessForBlobs(const Vector<String>& filenames, NoncopyableFunction<void ()>&& completionHandler);
+    void grantSandboxExtensionsToDatabaseProcessForBlobs(const Vector<String>& filenames, Function<void ()>&& completionHandler);
 
 private:
     NetworkProcess();
@@ -205,7 +205,7 @@ private:
     typedef HashMap<const char*, std::unique_ptr<NetworkProcessSupplement>, PtrHash<const char*>> NetworkProcessSupplementMap;
     NetworkProcessSupplementMap m_supplements;
 
-    HashMap<uint64_t, NoncopyableFunction<void ()>> m_sandboxExtensionForBlobsCompletionHandlers;
+    HashMap<uint64_t, Function<void ()>> m_sandboxExtensionForBlobsCompletionHandlers;
 
 #if PLATFORM(COCOA)
     void platformInitializeNetworkProcessCocoa(const NetworkProcessCreationParameters&);
index b975cf9..240380f 100644 (file)
@@ -382,7 +382,7 @@ void Cache::retrieve(const WebCore::ResourceRequest& request, const GlobalFrameI
     });
 }
 
-std::unique_ptr<Entry> Cache::store(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, RefPtr<WebCore::SharedBuffer>&& responseData, NoncopyableFunction<void (MappedBody&)>&& completionHandler)
+std::unique_ptr<Entry> Cache::store(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, RefPtr<WebCore::SharedBuffer>&& responseData, Function<void (MappedBody&)>&& completionHandler)
 {
     ASSERT(isEnabled());
     ASSERT(responseData);
@@ -480,7 +480,7 @@ void Cache::remove(const WebCore::ResourceRequest& request)
     remove(makeCacheKey(request));
 }
 
-void Cache::traverse(NoncopyableFunction<void (const TraversalEntry*)>&& traverseHandler)
+void Cache::traverse(Function<void (const TraversalEntry*)>&& traverseHandler)
 {
     ASSERT(isEnabled());
 
index 58f0c6d..39d7608 100644 (file)
@@ -32,7 +32,7 @@
 #include "NetworkCacheStorage.h"
 #include "ShareableResource.h"
 #include <WebCore/ResourceResponse.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -106,7 +106,7 @@ public:
 
     // Completion handler may get called back synchronously on failure.
     void retrieve(const WebCore::ResourceRequest&, const GlobalFrameID&, std::function<void (std::unique_ptr<Entry>)>&&);
-    std::unique_ptr<Entry> store(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, RefPtr<WebCore::SharedBuffer>&&, NoncopyableFunction<void (MappedBody&)>&&);
+    std::unique_ptr<Entry> store(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, RefPtr<WebCore::SharedBuffer>&&, Function<void (MappedBody&)>&&);
     std::unique_ptr<Entry> storeRedirect(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest& redirectRequest);
     std::unique_ptr<Entry> update(const WebCore::ResourceRequest&, const GlobalFrameID&, const Entry&, const WebCore::ResourceResponse& validatingResponse);
 
@@ -114,7 +114,7 @@ public:
         const Entry& entry;
         const Storage::RecordInfo& recordInfo;
     };
-    void traverse(NoncopyableFunction<void (const TraversalEntry*)>&&);
+    void traverse(Function<void (const TraversalEntry*)>&&);
     void remove(const Key&);
     void remove(const WebCore::ResourceRequest&);
 
index 8c91c9e..84b9497 100644 (file)
@@ -69,7 +69,7 @@ Ref<IOChannel> IOChannel::open(const String& filePath, IOChannel::Type type)
     return adoptRef(*new IOChannel(filePath, type));
 }
 
-static inline void runTaskInQueue(NoncopyableFunction<void ()>&& task, WorkQueue* queue)
+static inline void runTaskInQueue(Function<void ()>&& task, WorkQueue* queue)
 {
     if (queue) {
         queue->dispatch(WTFMove(task));
index 83ba6c7..145f896 100644 (file)
@@ -34,8 +34,8 @@
 #include <WebCore/Timer.h>
 #include <wtf/BloomFilter.h>
 #include <wtf/Deque.h>
+#include <wtf/Function.h>
 #include <wtf/HashSet.h>
-#include <wtf/NoncopyableFunction.h>
 #include <wtf/Optional.h>
 #include <wtf/WorkQueue.h>
 #include <wtf/text/WTFString.h>
@@ -62,7 +62,7 @@ public:
     typedef std::function<bool (std::unique_ptr<Record>)> RetrieveCompletionHandler;
     void retrieve(const Key&, unsigned priority, RetrieveCompletionHandler&&);
 
-    typedef NoncopyableFunction<void (const Data& mappedBody)> MappedBodyHandler;
+    typedef Function<void (const Data& mappedBody)> MappedBodyHandler;
     void store(const Record&, MappedBodyHandler&&);
 
     void remove(const Key&);
@@ -79,7 +79,7 @@ public:
         ShareCount = 1 << 1,
     };
     typedef unsigned TraverseFlags;
-    typedef NoncopyableFunction<void (const Record*, const RecordInfo&)> TraverseHandler;
+    typedef Function<void (const Record*, const RecordInfo&)> TraverseHandler;
     // Null record signals end.
     void traverse(const String& type, TraverseFlags, TraverseHandler&&);
 
index 90f940a..ed040e5 100644 (file)
@@ -81,7 +81,7 @@ unsigned long long BlobRegistryProxy::blobSize(const URL& url)
     return resultSize;
 }
 
-void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler)
+void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
 {
     WebProcess::singleton().networkConnection()->writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
 }
index 58d3abd..8353fa7 100644 (file)
@@ -39,7 +39,7 @@ public:
     void unregisterBlobURL(const WebCore::URL&) override;
     void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override;
     unsigned long long blobSize(const WebCore::URL&) override;
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler) override;
+    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler) override;
 };
 
 }
index 3c83a47..8f77abb 100644 (file)
@@ -85,7 +85,7 @@ void NetworkProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::S
 {
 }
 
-void NetworkProcessConnection::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler)
+void NetworkProcessConnection::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
 {
     static uint64_t writeBlobToFileIdentifier;
     uint64_t requestIdentifier = ++writeBlobToFileIdentifier;
index 77b54da..ef8e0fb 100644 (file)
@@ -58,7 +58,7 @@ public:
 
     void didReceiveNetworkProcessConnectionMessage(IPC::Connection&, IPC::MessageDecoder&);
 
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, NoncopyableFunction<void (const Vector<String>& filePaths)>&& completionHandler);
+    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler);
 
 private:
     NetworkProcessConnection(IPC::Connection::Identifier);
@@ -81,7 +81,7 @@ private:
     // The connection from the web process to the network process.
     RefPtr<IPC::Connection> m_connection;
 
-    HashMap<uint64_t, NoncopyableFunction<void (const Vector<String>&)>> m_writeBlobToFileCompletionHandlers;
+    HashMap<uint64_t, Function<void (const Vector<String>&)>> m_writeBlobToFileCompletionHandlers;
 };
 
 } // namespace WebKit