Title: [161253] trunk/Source/WebKit2
- Revision
- 161253
- Author
- [email protected]
- Date
- 2014-01-02 23:40:40 -0800 (Thu, 02 Jan 2014)
Log Message
[GTK] Switch from WTF::Function to std::function in WebProcessTest
https://bugs.webkit.org/show_bug.cgi?id=126397
Reviewed by Anders Carlsson.
Use std::function<> and std::bind() instead of WTF::Function and WTF::bind,
following the effort of using STL concepts where possible.
* UIProcess/API/gtk/tests/WebProcessTest.cpp:
(WebProcessTest::add):
* UIProcess/API/gtk/tests/WebProcessTest.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (161252 => 161253)
--- trunk/Source/WebKit2/ChangeLog 2014-01-03 05:21:57 UTC (rev 161252)
+++ trunk/Source/WebKit2/ChangeLog 2014-01-03 07:40:40 UTC (rev 161253)
@@ -1,3 +1,17 @@
+2014-01-02 Zan Dobersek <[email protected]>
+
+ [GTK] Switch from WTF::Function to std::function in WebProcessTest
+ https://bugs.webkit.org/show_bug.cgi?id=126397
+
+ Reviewed by Anders Carlsson.
+
+ Use std::function<> and std::bind() instead of WTF::Function and WTF::bind,
+ following the effort of using STL concepts where possible.
+
+ * UIProcess/API/gtk/tests/WebProcessTest.cpp:
+ (WebProcessTest::add):
+ * UIProcess/API/gtk/tests/WebProcessTest.h:
+
2014-01-02 Gavin Barraclough <[email protected]>
Propagate WindowServer modifications state to WebProcess
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.cpp (161252 => 161253)
--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.cpp 2014-01-03 05:21:57 UTC (rev 161252)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.cpp 2014-01-03 07:40:40 UTC (rev 161253)
@@ -23,16 +23,16 @@
#include <gio/gio.h>
#include <wtf/gobject/GOwnPtr.h>
-typedef HashMap<String, Function<PassOwnPtr<WebProcessTest>()>> TestsMap;
+typedef HashMap<String, std::function<PassOwnPtr<WebProcessTest> ()>> TestsMap;
static TestsMap& testsMap()
{
DEFINE_STATIC_LOCAL(TestsMap, s_testsMap, ());
return s_testsMap;
}
-void WebProcessTest::add(const String& testName, Function<PassOwnPtr<WebProcessTest>()> closure)
+void WebProcessTest::add(const String& testName, std::function<PassOwnPtr<WebProcessTest> ()> closure)
{
- testsMap().add(testName, closure);
+ testsMap().add(testName, std::forward<std::function<PassOwnPtr<WebProcessTest> ()>>(closure));
}
PassOwnPtr<WebProcessTest> WebProcessTest::create(const String& testName)
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.h (161252 => 161253)
--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.h 2014-01-03 05:21:57 UTC (rev 161252)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.h 2014-01-03 07:40:40 UTC (rev 161253)
@@ -18,7 +18,6 @@
*/
#include <webkit2/webkit-web-extension.h>
-#include <wtf/Functional.h>
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
@@ -30,10 +29,10 @@
virtual ~WebProcessTest() { }
virtual bool runTest(const char* testName, WebKitWebExtension*, GVariant* args) = 0;
- static void add(const String& testName, Function<PassOwnPtr<WebProcessTest>()>);
+ static void add(const String& testName, std::function<PassOwnPtr<WebProcessTest> ()>);
static PassOwnPtr<WebProcessTest> create(const String& testName);
};
#define REGISTER_TEST(ClassName, TestName) \
- WebProcessTest::add(String::fromUTF8(TestName), WTF::bind(&ClassName::create))
+ WebProcessTest::add(String::fromUTF8(TestName), ClassName::create)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes