Title: [158123] trunk/Source
Revision
158123
Author
[email protected]
Date
2013-10-28 13:10:56 -0700 (Mon, 28 Oct 2013)

Log Message

RunLoop::dispatch should take an std::function
https://bugs.webkit.org/show_bug.cgi?id=123407

Reviewed by Andreas Kling.

Source/WebCore:

* WebCore.exp.in:
* platform/RunLoop.cpp:
(WebCore::RunLoop::performWork):
(WebCore::RunLoop::dispatch):
* platform/RunLoop.h:

Source/WTF:

* wtf/FunctionDispatcher.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (158122 => 158123)


--- trunk/Source/WTF/ChangeLog	2013-10-28 20:01:16 UTC (rev 158122)
+++ trunk/Source/WTF/ChangeLog	2013-10-28 20:10:56 UTC (rev 158123)
@@ -1,3 +1,12 @@
+2013-10-28  Anders Carlsson  <[email protected]>
+
+        RunLoop::dispatch should take an std::function
+        https://bugs.webkit.org/show_bug.cgi?id=123407
+
+        Reviewed by Andreas Kling.
+
+        * wtf/FunctionDispatcher.h:
+
 2013-10-28  Andreas Kling  <[email protected]>
 
         RenderElement::m_style should be a Ref.

Modified: trunk/Source/WTF/wtf/FunctionDispatcher.h (158122 => 158123)


--- trunk/Source/WTF/wtf/FunctionDispatcher.h	2013-10-28 20:01:16 UTC (rev 158122)
+++ trunk/Source/WTF/wtf/FunctionDispatcher.h	2013-10-28 20:10:56 UTC (rev 158123)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <wtf/Forward.h>
+#include <functional>
 #include <wtf/ThreadSafeRefCounted.h>
 
 namespace WTF {
@@ -35,7 +35,7 @@
 public:
     WTF_EXPORT_PRIVATE virtual ~FunctionDispatcher();
 
-    virtual void dispatch(const Function<void ()>&) = 0;
+    virtual void dispatch(std::function<void ()>) = 0;
 
 protected:
     WTF_EXPORT_PRIVATE FunctionDispatcher();

Modified: trunk/Source/WebCore/ChangeLog (158122 => 158123)


--- trunk/Source/WebCore/ChangeLog	2013-10-28 20:01:16 UTC (rev 158122)
+++ trunk/Source/WebCore/ChangeLog	2013-10-28 20:10:56 UTC (rev 158123)
@@ -1,3 +1,16 @@
+2013-10-28  Anders Carlsson  <[email protected]>
+
+        RunLoop::dispatch should take an std::function
+        https://bugs.webkit.org/show_bug.cgi?id=123407
+
+        Reviewed by Andreas Kling.
+
+        * WebCore.exp.in:
+        * platform/RunLoop.cpp:
+        (WebCore::RunLoop::performWork):
+        (WebCore::RunLoop::dispatch):
+        * platform/RunLoop.h:
+
 2013-10-28  Tim Horton  <[email protected]>
 
         Make TileController manipulate PlatformCALayers instead of CALayers

Modified: trunk/Source/WebCore/WebCore.exp.in (158122 => 158123)


--- trunk/Source/WebCore/WebCore.exp.in	2013-10-28 20:01:16 UTC (rev 158122)
+++ trunk/Source/WebCore/WebCore.exp.in	2013-10-28 20:10:56 UTC (rev 158123)
@@ -1105,7 +1105,6 @@
 __ZN7WebCore7RunLoop6isMainEv
 __ZN7WebCore7RunLoop6wakeUpEv
 __ZN7WebCore7RunLoop7currentEv
-__ZN7WebCore7RunLoop8dispatchERKN3WTF8FunctionIFvvEEE
 __ZN7WebCore7RunLoop9TimerBase4stopEv
 __ZN7WebCore7RunLoop9TimerBase5startEdb
 __ZN7WebCore7RunLoop9TimerBaseC2EPS0_

Modified: trunk/Source/WebCore/platform/RunLoop.cpp (158122 => 158123)


--- trunk/Source/WebCore/platform/RunLoop.cpp	2013-10-28 20:01:16 UTC (rev 158122)
+++ trunk/Source/WebCore/platform/RunLoop.cpp	2013-10-28 20:10:56 UTC (rev 158123)
@@ -88,7 +88,7 @@
     // By only handling up to the number of functions that were in the queue when performWork() is called
     // we guarantee to occasionally return from the run loop so other event sources will be allowed to spin.
 
-    Function<void()> function;
+    std::function<void()> function;
     size_t functionsToHandle = 0;
 
     {
@@ -120,10 +120,10 @@
     }
 }
 
-void RunLoop::dispatch(const Function<void()>& function)
+void RunLoop::dispatch(std::function<void ()> function)
 {
     MutexLocker locker(m_functionQueueLock);
-    m_functionQueue.append(function);
+    m_functionQueue.append(std::move(function));
 
     wakeUp();
 }

Modified: trunk/Source/WebCore/platform/RunLoop.h (158122 => 158123)


--- trunk/Source/WebCore/platform/RunLoop.h	2013-10-28 20:01:16 UTC (rev 158122)
+++ trunk/Source/WebCore/platform/RunLoop.h	2013-10-28 20:10:56 UTC (rev 158123)
@@ -57,7 +57,7 @@
     static bool isMain();
     ~RunLoop();
 
-    virtual void dispatch(const Function<void()>&) OVERRIDE;
+    virtual void dispatch(std::function<void ()>) OVERRIDE;
 
     static void run();
     void stop();
@@ -133,7 +133,7 @@
     void performWork();
 
     Mutex m_functionQueueLock;
-    Deque<Function<void()>> m_functionQueue;
+    Deque<std::function<void ()>> m_functionQueue;
 
 #if PLATFORM(WIN)
     static bool registerRunLoopMessageWindowClass();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to