Changeset 161253 in webkit


Ignore:
Timestamp:
Jan 2, 2014 11:40:40 PM (10 years ago)
Author:
zandobersek@gmail.com
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:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r161246 r161253  
     12014-01-02  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Switch from WTF::Function to std::function in WebProcessTest
     4        https://bugs.webkit.org/show_bug.cgi?id=126397
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Use std::function<> and std::bind() instead of WTF::Function and WTF::bind,
     9        following the effort of using STL concepts where possible.
     10
     11        * UIProcess/API/gtk/tests/WebProcessTest.cpp:
     12        (WebProcessTest::add):
     13        * UIProcess/API/gtk/tests/WebProcessTest.h:
     14
    1152014-01-02  Gavin Barraclough  <barraclough@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.cpp

    r153327 r161253  
    2424#include <wtf/gobject/GOwnPtr.h>
    2525
    26 typedef HashMap<String, Function<PassOwnPtr<WebProcessTest>()>> TestsMap;
     26typedef HashMap<String, std::function<PassOwnPtr<WebProcessTest> ()>> TestsMap;
    2727static TestsMap& testsMap()
    2828{
     
    3131}
    3232
    33 void WebProcessTest::add(const String& testName, Function<PassOwnPtr<WebProcessTest>()> closure)
     33void WebProcessTest::add(const String& testName, std::function<PassOwnPtr<WebProcessTest> ()> closure)
    3434{
    35     testsMap().add(testName, closure);
     35    testsMap().add(testName, std::forward<std::function<PassOwnPtr<WebProcessTest> ()>>(closure));
    3636}
    3737
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebProcessTest.h

    r153327 r161253  
    1919
    2020#include <webkit2/webkit-web-extension.h>
    21 #include <wtf/Functional.h>
    2221#include <wtf/HashMap.h>
    2322#include <wtf/PassOwnPtr.h>
     
    3130    virtual bool runTest(const char* testName, WebKitWebExtension*, GVariant* args) = 0;
    3231
    33     static void add(const String& testName, Function<PassOwnPtr<WebProcessTest>()>);
     32    static void add(const String& testName, std::function<PassOwnPtr<WebProcessTest> ()>);
    3433    static PassOwnPtr<WebProcessTest> create(const String& testName);
    3534};
    3635
    3736#define REGISTER_TEST(ClassName, TestName) \
    38     WebProcessTest::add(String::fromUTF8(TestName), WTF::bind(&ClassName::create))
     37    WebProcessTest::add(String::fromUTF8(TestName), ClassName::create)
    3938
Note: See TracChangeset for help on using the changeset viewer.