Diff
Modified: trunk/Source/WTF/ChangeLog (201662 => 201663)
--- trunk/Source/WTF/ChangeLog 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/ChangeLog 2016-06-03 22:24:06 UTC (rev 201663)
@@ -1,3 +1,56 @@
+2016-06-03 Anders Carlsson <ander...@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-03 Mark Lam <mark....@apple.com>
Clean up how StackVisitor dumps its frames.
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (201662 => 201663)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2016-06-03 22:24:06 UTC (rev 201663)
@@ -118,7 +118,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 */; };
@@ -447,7 +447,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>"; };
@@ -840,6 +840,7 @@
0F9D335C165DBA73005AD387 /* FilePrintStream.h */,
0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */,
A8A472A6151A825A004123FF /* Forward.h */,
+ 83F2BADE1CF9524E003E99C3 /* Function.h */,
1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */,
1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */,
A8A472A8151A825A004123FF /* GetPtr.h */,
@@ -886,7 +887,6 @@
1A3F6BE6174ADA2100B2EEA7 /* NeverDestroyed.h */,
0F0D85B317234CB100338210 /* NoLock.h */,
A8A472D0151A825B004123FF /* Noncopyable.h */,
- 83F2BADE1CF9524E003E99C3 /* NoncopyableFunction.h */,
A8A472D5151A825B004123FF /* NumberOfCores.cpp */,
A8A472D6151A825B004123FF /* NumberOfCores.h */,
7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */,
@@ -1250,7 +1250,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 */,
Modified: trunk/Source/WTF/wtf/CrossThreadTask.h (201662 => 201663)
--- trunk/Source/WTF/wtf/CrossThreadTask.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/CrossThreadTask.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
public:
CrossThreadTask() = default;
- CrossThreadTask(NoncopyableFunction<void ()>&& taskFunction)
+ CrossThreadTask(Function<void ()>&& taskFunction)
: m_taskFunction(WTFMove(taskFunction))
{
ASSERT(taskFunction);
@@ -47,7 +47,7 @@
}
protected:
- NoncopyableFunction<void ()> m_taskFunction;
+ Function<void ()> m_taskFunction;
};
template <typename T, typename... Arguments>
Copied: trunk/Source/WTF/wtf/Function.h (from rev 201662, trunk/Source/WTF/wtf/NoncopyableFunction.h) (0 => 201663)
--- trunk/Source/WTF/wtf/Function.h (rev 0)
+++ trunk/Source/WTF/wtf/Function.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <memory>
+#include <wtf/FastMalloc.h>
+
+namespace WTF {
+
+template<typename> class Function;
+
+template <typename Out, typename... In>
+class Function<Out(In...)> {
+public:
+ Function() = default;
+
+ template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>
+ Function(CallableType&& callable)
+ : m_callableWrapper(std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable)))
+ {
+ }
+
+ Out operator()(In... in) const
+ {
+ if (m_callableWrapper)
+ return m_callableWrapper->call(std::forward<In>(in)...);
+ return Out();
+ }
+
+ explicit operator bool() const { return !!m_callableWrapper; }
+
+ template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>
+ Function& operator=(CallableType&& callable)
+ {
+ m_callableWrapper = std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable));
+ return *this;
+ }
+
+ Function& operator=(std::nullptr_t)
+ {
+ m_callableWrapper = nullptr;
+ return *this;
+ }
+
+private:
+ class CallableWrapperBase {
+ WTF_MAKE_FAST_ALLOCATED;
+ public:
+ virtual ~CallableWrapperBase() { }
+
+ virtual Out call(In...) = 0;
+ };
+
+ template<typename CallableType>
+ class CallableWrapper : public CallableWrapperBase {
+ public:
+ explicit CallableWrapper(CallableType&& callable)
+ : m_callable(WTFMove(callable))
+ {
+ }
+
+ CallableWrapper(const CallableWrapper&) = delete;
+ CallableWrapper& operator=(const CallableWrapper&) = delete;
+
+ Out call(In... in) final { return m_callable(std::forward<In>(in)...); }
+
+ private:
+ CallableType m_callable;
+ };
+
+ std::unique_ptr<CallableWrapperBase> m_callableWrapper;
+};
+
+} // namespace WTF
+
+using WTF::Function;
Modified: trunk/Source/WTF/wtf/FunctionDispatcher.h (201662 => 201663)
--- trunk/Source/WTF/wtf/FunctionDispatcher.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/FunctionDispatcher.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
public:
WTF_EXPORT_PRIVATE virtual ~FunctionDispatcher();
- virtual void dispatch(NoncopyableFunction<void ()>&&) = 0;
+ virtual void dispatch(Function<void ()>&&) = 0;
protected:
WTF_EXPORT_PRIVATE FunctionDispatcher();
Modified: trunk/Source/WTF/wtf/MainThread.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/MainThread.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/MainThread.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -47,9 +47,9 @@
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 @@
auto startTime = std::chrono::steady_clock::now();
- NoncopyableFunction<void ()> function;
+ Function<void ()> function;
while (true) {
{
@@ -144,7 +144,7 @@
}
}
-void callOnMainThread(NoncopyableFunction<void ()>&& function)
+void callOnMainThread(Function<void ()>&& function)
{
ASSERT(function);
Modified: trunk/Source/WTF/wtf/MainThread.h (201662 => 201663)
--- trunk/Source/WTF/wtf/MainThread.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/MainThread.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -32,7 +32,7 @@
#include <functional>
#include <stdint.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
namespace WTF {
@@ -41,7 +41,7 @@
// 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)());
Deleted: trunk/Source/WTF/wtf/NoncopyableFunction.h (201662 => 201663)
--- trunk/Source/WTF/wtf/NoncopyableFunction.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/NoncopyableFunction.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <memory>
-#include <wtf/FastMalloc.h>
-
-namespace WTF {
-
-template<typename> class NoncopyableFunction;
-
-template <typename Out, typename... In>
-class NoncopyableFunction<Out(In...)> {
-public:
- NoncopyableFunction() = default;
-
- template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>
- NoncopyableFunction(CallableType&& callable)
- : m_callableWrapper(std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable)))
- {
- }
-
- Out operator()(In... in) const
- {
- if (m_callableWrapper)
- return m_callableWrapper->call(std::forward<In>(in)...);
- return Out();
- }
-
- 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)
- {
- m_callableWrapper = std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable));
- return *this;
- }
-
- NoncopyableFunction& operator=(std::nullptr_t)
- {
- m_callableWrapper = nullptr;
- return *this;
- }
-
-private:
- class CallableWrapperBase {
- WTF_MAKE_FAST_ALLOCATED;
- public:
- virtual ~CallableWrapperBase() { }
-
- virtual Out call(In...) = 0;
- };
-
- template<typename CallableType>
- class CallableWrapper : public CallableWrapperBase {
- public:
- explicit CallableWrapper(CallableType&& callable)
- : m_callable(WTFMove(callable))
- {
- }
-
- CallableWrapper(const CallableWrapper&) = delete;
- CallableWrapper& operator=(const CallableWrapper&) = delete;
-
- Out call(In... in) final { return m_callable(std::forward<In>(in)...); }
-
- private:
- CallableType m_callable;
- };
-
- std::unique_ptr<CallableWrapperBase> m_callableWrapper;
-};
-
-} // namespace WTF
-
-using WTF::NoncopyableFunction;
Modified: trunk/Source/WTF/wtf/RunLoop.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/RunLoop.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/RunLoop.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -91,7 +91,7 @@
size_t functionsToHandle = 0;
{
- NoncopyableFunction<void ()> function;
+ Function<void ()> function;
{
MutexLocker locker(m_functionQueueLock);
functionsToHandle = m_functionQueue.size();
@@ -106,7 +106,7 @@
}
for (size_t functionsHandled = 1; functionsHandled < functionsToHandle; ++functionsHandled) {
- NoncopyableFunction<void ()> function;
+ Function<void ()> function;
{
MutexLocker locker(m_functionQueueLock);
@@ -123,7 +123,7 @@
}
}
-void RunLoop::dispatch(NoncopyableFunction<void ()>&& function)
+void RunLoop::dispatch(Function<void ()>&& function)
{
{
MutexLocker locker(m_functionQueueLock);
Modified: trunk/Source/WTF/wtf/RunLoop.h (201662 => 201663)
--- trunk/Source/WTF/wtf/RunLoop.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/RunLoop.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -59,7 +59,7 @@
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 @@
#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 @@
void performWork();
Mutex m_functionQueueLock;
- Deque<NoncopyableFunction<void ()>> m_functionQueue;
+ Deque<Function<void ()>> m_functionQueue;
#if USE(WINDOWS_EVENT_LOOP)
static bool registerRunLoopMessageWindowClass();
Modified: trunk/Source/WTF/wtf/WorkQueue.h (201662 => 201663)
--- trunk/Source/WTF/wtf/WorkQueue.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/WorkQueue.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -72,8 +72,8 @@
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)>&);
Modified: trunk/Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -28,10 +28,10 @@
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::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;
Modified: trunk/Source/WTF/wtf/efl/DispatchQueueWorkItemEfl.h (201662 => 201663)
--- trunk/Source/WTF/wtf/efl/DispatchQueueWorkItemEfl.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/efl/DispatchQueueWorkItemEfl.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
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 @@
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)
{
Modified: trunk/Source/WTF/wtf/efl/WorkQueueEfl.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/efl/WorkQueueEfl.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/efl/WorkQueueEfl.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -54,7 +54,7 @@
m_dispatchQueue->clearSocketEventHandler();
}
-void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatch(Function<void ()>&& function)
{
if (!m_dispatchQueue)
return;
@@ -62,7 +62,7 @@
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;
Modified: trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -32,12 +32,12 @@
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 @@
}
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 @@
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;
Modified: trunk/Source/WTF/wtf/generic/WorkQueueGeneric.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/generic/WorkQueueGeneric.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/generic/WorkQueueGeneric.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -81,7 +81,7 @@
}
}
-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::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)] {
Modified: trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -124,7 +124,7 @@
class DispatchAfterContext {
WTF_MAKE_FAST_ALLOCATED;
public:
- DispatchAfterContext(NoncopyableFunction<void ()>&& function)
+ DispatchAfterContext(Function<void ()>&& function)
: m_function(WTFMove(function))
{
}
@@ -135,10 +135,10 @@
}
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");
Modified: trunk/Source/WTF/wtf/win/WorkItemWin.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/win/WorkItemWin.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/win/WorkItemWin.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -32,13 +32,13 @@
namespace WTF {
-WorkItemWin::WorkItemWin(NoncopyableFunction<void ()>&& function, WorkQueue* queue)
+WorkItemWin::WorkItemWin(Function<void ()>&& function, WorkQueue* queue)
: m_function(WTFMove(function))
, m_queue(queue)
{
}
-RefPtr<WorkItemWin> WorkItemWin::create(NoncopyableFunction<void ()>&& function, WorkQueue* queue)
+RefPtr<WorkItemWin> WorkItemWin::create(Function<void ()>&& function, WorkQueue* queue)
{
return adoptRef(new WorkItemWin(WTFMove(function), queue));
}
@@ -47,7 +47,7 @@
{
}
-HandleWorkItem::HandleWorkItem(HANDLE handle, NoncopyableFunction<void ()>&& function, WorkQueue* queue)
+HandleWorkItem::HandleWorkItem(HANDLE handle, Function<void ()>&& function, WorkQueue* queue)
: WorkItemWin(WTFMove(function), queue)
, m_handle(handle)
, m_waitHandle(0)
@@ -55,7 +55,7 @@
ASSERT_ARG(handle, handle);
}
-RefPtr<HandleWorkItem> HandleWorkItem::createByAdoptingHandle(HANDLE handle, NoncopyableFunction<void ()>&& function, WorkQueue* queue)
+RefPtr<HandleWorkItem> HandleWorkItem::createByAdoptingHandle(HANDLE handle, Function<void ()>&& function, WorkQueue* queue)
{
return adoptRef(new HandleWorkItem(handle, WTFMove(function), queue));
}
Modified: trunk/Source/WTF/wtf/win/WorkItemWin.h (201662 => 201663)
--- trunk/Source/WTF/wtf/win/WorkItemWin.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/win/WorkItemWin.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -39,30 +39,30 @@
class WorkItemWin : public ThreadSafeRefCounted<WorkItemWin> {
public:
- static RefPtr<WorkItemWin> create(NoncopyableFunction<void ()>&&, WorkQueue*);
+ static RefPtr<WorkItemWin> create(Function<void ()>&&, WorkQueue*);
virtual ~WorkItemWin();
- NoncopyableFunction<void ()>& function() { return m_function; }
+ Function<void ()>& function() { return m_function; }
WorkQueue* queue() const { return m_queue.get(); }
protected:
- WorkItemWin(NoncopyableFunction<void ()>&&, WorkQueue*);
+ WorkItemWin(Function<void ()>&&, WorkQueue*);
private:
- NoncopyableFunction<void ()> m_function;
+ Function<void ()> m_function;
RefPtr<WorkQueue> m_queue;
};
class HandleWorkItem : public WorkItemWin {
public:
- static RefPtr<HandleWorkItem> createByAdoptingHandle(HANDLE, NoncopyableFunction<void ()>&&, WorkQueue*);
+ static RefPtr<HandleWorkItem> createByAdoptingHandle(HANDLE, Function<void ()>&&, WorkQueue*);
virtual ~HandleWorkItem();
void setWaitHandle(HANDLE waitHandle) { m_waitHandle = waitHandle; }
HANDLE waitHandle() const { return m_waitHandle; }
private:
- HandleWorkItem(HANDLE, NoncopyableFunction<void ()>&&, WorkQueue*);
+ HandleWorkItem(HANDLE, Function<void ()>&&, WorkQueue*);
HANDLE m_handle;
HANDLE m_waitHandle;
Modified: trunk/Source/WTF/wtf/win/WorkQueueWin.cpp (201662 => 201663)
--- trunk/Source/WTF/wtf/win/WorkQueueWin.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WTF/wtf/win/WorkQueueWin.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -129,7 +129,7 @@
::DeleteTimerQueueEx(m_timerQueue, 0);
}
-void WorkQueue::dispatch(NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatch(Function<void ()>&& function)
{
MutexLocker locker(m_workItemQueueLock);
ref();
@@ -149,7 +149,7 @@
static RefPtr<TimerContext> create() { return adoptRef(new TimerContext); }
WorkQueue* queue;
- NoncopyableFunction<void ()> function;
+ Function<void ()> function;
Mutex timerMutex;
HANDLE timer;
@@ -180,7 +180,7 @@
}
}
-void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, NoncopyableFunction<void ()>&& function)
+void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, Function<void ()>&& function)
{
ASSERT(m_timerQueue);
ref();
Modified: trunk/Source/WebCore/ChangeLog (201662 => 201663)
--- trunk/Source/WebCore/ChangeLog 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/ChangeLog 2016-06-03 22:24:06 UTC (rev 201663)
@@ -1,3 +1,58 @@
+2016-06-03 Anders Carlsson <ander...@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-03 Ada Chan <adac...@apple.com>
REGRESSION(r201474): Subtitles are not resizing in other fullscreen modes
Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (201662 => 201663)
--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -95,7 +95,7 @@
m_mediaEndpoint->generateDtlsInfo();
}
-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.
Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h (201662 => 201663)
--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -37,7 +37,7 @@
#include "NotImplemented.h"
#include "PeerConnectionBackend.h"
#include "RTCSessionDescription.h"
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -79,7 +79,7 @@
void clearNegotiationNeededState() override { notImplemented(); };
private:
- void runTask(NoncopyableFunction<void ()>&&);
+ void runTask(Function<void ()>&&);
void startRunningTasks();
void createOfferTask(RTCOfferOptions&, PeerConnection::SessionDescriptionPromise&);
@@ -93,7 +93,7 @@
PeerConnectionBackendClient* m_client;
std::unique_ptr<MediaEndpoint> m_mediaEndpoint;
- NoncopyableFunction<void ()> m_initialDeferredTask;
+ Function<void ()> m_initialDeferredTask;
std::unique_ptr<SDPProcessor> m_sdpProcessor;
Modified: trunk/Source/WebCore/Modules/webaudio/AudioDestinationNode.h (201662 => 201663)
--- trunk/Source/WebCore/Modules/webaudio/AudioDestinationNode.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/Modules/webaudio/AudioDestinationNode.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
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;
Modified: trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp (201662 => 201663)
--- trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -106,7 +106,7 @@
m_destination->start();
}
-void DefaultAudioDestinationNode::resume(NoncopyableFunction<void ()>&& function)
+void DefaultAudioDestinationNode::resume(Function<void ()>&& function)
{
ASSERT(isInitialized());
if (isInitialized())
@@ -115,7 +115,7 @@
scriptExecutionContext->postTask(WTFMove(function));
}
-void DefaultAudioDestinationNode::suspend(NoncopyableFunction<void ()>&& function)
+void DefaultAudioDestinationNode::suspend(Function<void ()>&& function)
{
ASSERT(isInitialized());
if (isInitialized())
@@ -124,7 +124,7 @@
scriptExecutionContext->postTask(WTFMove(function));
}
-void DefaultAudioDestinationNode::close(NoncopyableFunction<void()>&& function)
+void DefaultAudioDestinationNode::close(Function<void()>&& function)
{
ASSERT(isInitialized());
uninitialize();
Modified: trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h (201662 => 201663)
--- trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -50,9 +50,9 @@
// 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;
Modified: trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp (201662 => 201663)
--- trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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))
Modified: trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h (201662 => 201663)
--- trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -27,14 +27,14 @@
#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 @@
// 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
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (201662 => 201663)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -35,7 +35,7 @@
#include <runtime/ConsoleTypes.h>
#include <wtf/CrossThreadTask.h>
#include <wtf/HashSet.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
namespace JSC {
class ExecState;
@@ -133,20 +133,20 @@
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, Function<void (ScriptExecutionContext&)>>::value>::type>
Task(T task)
: m_task(WTFMove(task))
, m_isCleanupTask(false)
{
}
- Task(NoncopyableFunction<void ()>&& task)
+ Task(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, Function<void (ScriptExecutionContext&)>>::value>::type>
Task(CleanupTaskTag, T task)
: m_task(WTFMove(task))
, m_isCleanupTask(true)
@@ -163,7 +163,7 @@
bool isCleanupTask() const { return m_isCleanupTask; }
protected:
- NoncopyableFunction<void (ScriptExecutionContext&)> m_task;
+ Function<void (ScriptExecutionContext&)> m_task;
bool m_isCleanupTask;
};
Modified: trunk/Source/WebCore/fileapi/AsyncFileStream.cpp (201662 => 201663)
--- trunk/Source/WebCore/fileapi/AsyncFileStream.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/fileapi/AsyncFileStream.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -39,7 +39,7 @@
#include <wtf/MainThread.h>
#include <wtf/MessageQueue.h>
#include <wtf/NeverDestroyed.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
namespace WebCore {
@@ -64,12 +64,12 @@
#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 @@
});
});
- 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 @@
});
}
-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)] {
Modified: trunk/Source/WebCore/fileapi/AsyncFileStream.h (201662 => 201663)
--- trunk/Source/WebCore/fileapi/AsyncFileStream.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/fileapi/AsyncFileStream.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -34,7 +34,7 @@
#include <functional>
#include <wtf/Forward.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
namespace WebCore {
@@ -57,7 +57,7 @@
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;
Modified: trunk/Source/WebCore/page/FrameView.cpp (201662 => 201663)
--- trunk/Source/WebCore/page/FrameView.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/page/FrameView.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -3133,7 +3133,7 @@
updateEmbeddedObjectsTimerFired();
}
-void FrameView::queuePostLayoutCallback(NoncopyableFunction<void()>&& callback)
+void FrameView::queuePostLayoutCallback(Function<void()>&& callback)
{
m_postLayoutCallbackQueue.append(WTFMove(callback));
}
@@ -3146,7 +3146,7 @@
if (!m_postLayoutCallbackQueue.size())
return;
- Vector<NoncopyableFunction<void()>> queue = WTFMove(m_postLayoutCallbackQueue);
+ Vector<Function<void()>> queue = WTFMove(m_postLayoutCallbackQueue);
for (auto& task : queue)
task();
}
Modified: trunk/Source/WebCore/page/FrameView.h (201662 => 201663)
--- trunk/Source/WebCore/page/FrameView.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/page/FrameView.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -37,7 +37,7 @@
#include <wtf/Forward.h>
#include <wtf/HashSet.h>
#include <wtf/ListHashSet.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -111,7 +111,7 @@
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 @@
ScrollPinningBehavior m_scrollPinningBehavior;
IntRect* m_cachedWindowClipRect { nullptr };
- Vector<NoncopyableFunction<void()>> m_postLayoutCallbackQueue;
+ Vector<Function<void()>> m_postLayoutCallbackQueue;
};
inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingThread.cpp (201662 => 201663)
--- trunk/Source/WebCore/page/scrolling/ScrollingThread.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/page/scrolling/ScrollingThread.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -45,7 +45,7 @@
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 @@
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 @@
{
ASSERT(isCurrentThread());
- Vector<NoncopyableFunction<void ()>> functions;
+ Vector<Function<void ()>> functions;
{
std::lock_guard<Lock> lock(m_functionsMutex);
Modified: trunk/Source/WebCore/page/scrolling/ScrollingThread.h (201662 => 201663)
--- trunk/Source/WebCore/page/scrolling/ScrollingThread.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/page/scrolling/ScrollingThread.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -33,7 +33,7 @@
#include <wtf/Forward.h>
#include <wtf/Lock.h>
#include <wtf/Noncopyable.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/Threading.h>
#include <wtf/Vector.h>
@@ -48,11 +48,11 @@
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 @@
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.
Modified: trunk/Source/WebCore/platform/GenericTaskQueue.cpp (201662 => 201663)
--- trunk/Source/WebCore/platform/GenericTaskQueue.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/GenericTaskQueue.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -36,7 +36,7 @@
{
}
-void TaskDispatcher<Timer>::postTask(NoncopyableFunction<void()>&& function)
+void TaskDispatcher<Timer>::postTask(Function<void()>&& function)
{
m_pendingTasks.append(WTFMove(function));
pendingDispatchers().append(m_weakPtrFactory.createWeakPtr());
Modified: trunk/Source/WebCore/platform/GenericTaskQueue.h (201662 => 201663)
--- trunk/Source/WebCore/platform/GenericTaskQueue.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/GenericTaskQueue.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
{
}
- void postTask(NoncopyableFunction<void()>&& f)
+ void postTask(Function<void()>&& f)
{
m_context.postTask(WTFMove(f));
}
@@ -53,7 +53,7 @@
class TaskDispatcher<Timer> {
public:
TaskDispatcher();
- void postTask(NoncopyableFunction<void()>&&);
+ void postTask(Function<void()>&&);
private:
static Timer& sharedTimer();
@@ -63,7 +63,7 @@
void dispatchOneTask();
WeakPtrFactory<TaskDispatcher> m_weakPtrFactory;
- Deque<NoncopyableFunction<void()>> m_pendingTasks;
+ Deque<Function<void()>> m_pendingTasks;
};
template <typename T>
@@ -81,7 +81,7 @@
{
}
- typedef NoncopyableFunction<void()> TaskFunction;
+ typedef Function<void()> TaskFunction;
void enqueueTask(TaskFunction&& task)
{
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (201662 => 201663)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -31,7 +31,7 @@
#include "MediaPlayerPrivate.h"
#include "MediaStreamPrivate.h"
#include <wtf/MediaTime.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/Vector.h>
#include <wtf/WeakPtr.h>
@@ -143,7 +143,7 @@
void updateTracks();
void renderingModeChanged();
- void scheduleDeferredTask(NoncopyableFunction<void ()>&&);
+ void scheduleDeferredTask(Function<void ()>&&);
enum DisplayMode {
None,
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (201662 => 201663)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2016-06-03 22:24:06 UTC (rev 201663)
@@ -624,7 +624,7 @@
m_player->networkStateChanged();
}
-void MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask(NoncopyableFunction<void ()>&& function)
+void MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask(Function<void ()>&& function)
{
ASSERT(function);
callOnMainThread([weakThis = createWeakPtr(), function = WTFMove(function)] {
Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp (201662 => 201663)
--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -299,7 +299,7 @@
});
}
-void MediaStreamPrivate::scheduleDeferredTask(NoncopyableFunction<void ()>&& function)
+void MediaStreamPrivate::scheduleDeferredTask(Function<void ()>&& function)
{
ASSERT(function);
callOnMainThread([weakThis = createWeakPtr(), function = WTFMove(function)] {
Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h (201662 => 201663)
--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -41,7 +41,7 @@
#include "MediaStreamTrackPrivate.h"
#include <wtf/HashMap.h>
#include <wtf/MediaTime.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
@@ -112,7 +112,7 @@
void characteristicsChanged();
void updateActiveVideoTrack();
- void scheduleDeferredTask(NoncopyableFunction<void ()>&&);
+ void scheduleDeferredTask(Function<void ()>&&);
WeakPtrFactory<MediaStreamPrivate> m_weakPtrFactory;
Vector<Observer*> m_observers;
Modified: trunk/Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.h (201662 => 201663)
--- trunk/Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
void setVideoSampleBufferDelegate(AVCaptureVideoDataOutput*);
void setAudioSampleBufferDelegate(AVCaptureAudioDataOutput*);
- void scheduleDeferredTask(NoncopyableFunction<void ()>&&);
+ void scheduleDeferredTask(Function<void ()>&&);
private:
void setupSession();
Modified: trunk/Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.mm (201662 => 201663)
--- trunk/Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.mm 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.mm 2016-06-03 22:24:06 UTC (rev 201663)
@@ -240,7 +240,7 @@
[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)] {
Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (201662 => 201663)
--- trunk/Source/WebCore/style/StyleTreeResolver.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -521,13 +521,13 @@
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));
}
Modified: trunk/Source/WebCore/style/StyleTreeResolver.h (201662 => 201663)
--- trunk/Source/WebCore/style/StyleTreeResolver.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebCore/style/StyleTreeResolver.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -34,7 +34,7 @@
#include "StyleUpdate.h"
#include <functional>
#include <wtf/HashMap.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -110,7 +110,7 @@
std::unique_ptr<Update> m_update;
};
-void queuePostResolutionCallback(NoncopyableFunction<void ()>&&);
+void queuePostResolutionCallback(Function<void ()>&&);
bool postResolutionCallbacksAreSuspended();
bool isPlaceholderStyle(const RenderStyle&);
Modified: trunk/Source/WebKit/ChangeLog (201662 => 201663)
--- trunk/Source/WebKit/ChangeLog 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit/ChangeLog 2016-06-03 22:24:06 UTC (rev 201663)
@@ -1,3 +1,18 @@
+2016-06-03 Anders Carlsson <ander...@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-02 Youenn Fablet <youenn.fab...@crf.canon.fr>
Use more references in ResourceLoader related code
Modified: trunk/Source/WebKit/Storage/StorageSyncManager.cpp (201662 => 201663)
--- trunk/Source/WebKit/Storage/StorageSyncManager.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit/Storage/StorageSyncManager.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -63,7 +63,7 @@
return pathByAppendingComponent(m_path, databaseIdentifier + ".localstorage");
}
-void StorageSyncManager::dispatch(NoncopyableFunction<void ()>&& function)
+void StorageSyncManager::dispatch(Function<void ()>&& function)
{
ASSERT(isMainThread());
ASSERT(m_thread);
Modified: trunk/Source/WebKit/Storage/StorageSyncManager.h (201662 => 201663)
--- trunk/Source/WebKit/Storage/StorageSyncManager.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit/Storage/StorageSyncManager.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 @@
static Ref<StorageSyncManager> create(const String& path);
~StorageSyncManager();
- void dispatch(NoncopyableFunction<void ()>&&);
+ void dispatch(Function<void ()>&&);
void close();
private:
Modified: trunk/Source/WebKit/Storage/StorageThread.cpp (201662 => 201663)
--- trunk/Source/WebKit/Storage/StorageThread.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit/Storage/StorageThread.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -74,11 +74,11 @@
}
}
-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 @@
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);
Modified: trunk/Source/WebKit/Storage/StorageThread.h (201662 => 201663)
--- trunk/Source/WebKit/Storage/StorageThread.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit/Storage/StorageThread.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -26,10 +26,9 @@
#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 @@
bool start();
void terminate();
- void dispatch(NoncopyableFunction<void ()>&&);
+ void dispatch(Function<void ()>&&);
static void releaseFastMallocFreeMemoryInAllThreads();
@@ -59,7 +58,7 @@
void performTerminate();
ThreadIdentifier m_threadID;
- MessageQueue<NoncopyableFunction<void ()>> m_queue;
+ MessageQueue<Function<void ()>> m_queue;
};
} // namespace WebCore
Modified: trunk/Source/WebKit2/ChangeLog (201662 => 201663)
--- trunk/Source/WebKit2/ChangeLog 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/ChangeLog 2016-06-03 22:24:06 UTC (rev 201663)
@@ -1,3 +1,22 @@
+2016-06-03 Anders Carlsson <ander...@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-03 Chris Dumez <cdu...@apple.com>
Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (201662 => 201663)
--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -308,7 +308,7 @@
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 @@
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 @@
});
}
- NoncopyableFunction<void (WebsiteData)> m_completionHandler;
+ Function<void (WebsiteData)> m_completionHandler;
WebsiteData m_websiteData;
};
@@ -412,7 +412,7 @@
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()) {
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (201662 => 201663)
--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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)
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (201662 => 201663)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -521,7 +521,7 @@
remove(makeCacheKey(request));
}
-void Cache::traverse(NoncopyableFunction<void (const TraversalEntry*)>&& traverseHandler)
+void Cache::traverse(Function<void (const TraversalEntry*)>&& traverseHandler)
{
ASSERT(isEnabled());
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h (201662 => 201663)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -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 {
@@ -114,7 +114,7 @@
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&);
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp (201662 => 201663)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp 2016-06-03 22:24:06 UTC (rev 201663)
@@ -69,7 +69,7 @@
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));
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h (201662 => 201663)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h 2016-06-03 22:05:33 UTC (rev 201662)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h 2016-06-03 22:24:06 UTC (rev 201663)
@@ -35,7 +35,7 @@
#include <wtf/BloomFilter.h>
#include <wtf/Deque.h>
#include <wtf/HashSet.h>
-#include <wtf/NoncopyableFunction.h>
+#include <wtf/Function.h>
#include <wtf/Optional.h>
#include <wtf/WorkQueue.h>
#include <wtf/text/WTFString.h>
@@ -79,7 +79,7 @@
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&&);