- a/Source/WebCore/ChangeLog +13 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-12-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        [GTK] Remove GamepadDeviceGtk::create()
4
        https://bugs.webkit.org/show_bug.cgi?id=139637
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        std::make_unique<> can replace GamepadDeviceGtk::create() factory function.
9
10
        * platform/gtk/GamepadsGtk.cpp: Add "explicit" to GamepadsGtk constructor.
11
        (WebCore::GamepadsGtk::registerDevice):
12
        (WebCore::GamepadDeviceGtk::create): Deleted.
13
1
2014-12-14  Andreas Kling  <akling@apple.com>
14
2014-12-14  Andreas Kling  <akling@apple.com>
2
15
3
        Event construction helpers should return Ref instead of PassRefPtr.
16
        Event construction helpers should return Ref instead of PassRefPtr.
- a/Source/WebCore/platform/gtk/GamepadsGtk.cpp -8 / +3 lines
Lines 44-58 namespace WebCore { a/Source/WebCore/platform/gtk/GamepadsGtk.cpp_sec1
44
44
45
class GamepadDeviceGtk : public GamepadDeviceLinux {
45
class GamepadDeviceGtk : public GamepadDeviceLinux {
46
public:
46
public:
47
    static PassOwnPtr<GamepadDeviceGtk> create(String deviceFile)
47
    explicit GamepadDeviceGtk(String deviceFile);
48
    {
49
        return adoptPtr(new GamepadDeviceGtk(deviceFile));
50
    }
51
    ~GamepadDeviceGtk();
48
    ~GamepadDeviceGtk();
52
49
53
private:
50
private:
54
    GamepadDeviceGtk(String deviceFile);
55
56
    static gboolean readCallback(GObject* pollableStream, gpointer data);
51
    static gboolean readCallback(GObject* pollableStream, gpointer data);
57
    GRefPtr<GInputStream> m_inputStream;
52
    GRefPtr<GInputStream> m_inputStream;
58
    GRefPtr<GSource> m_source;
53
    GRefPtr<GSource> m_source;
Lines 98-104 gboolean GamepadDeviceGtk::readCallback(GObject* pollableStream, gpointer data) a/Source/WebCore/platform/gtk/GamepadsGtk.cpp_sec2
98
93
99
class GamepadsGtk {
94
class GamepadsGtk {
100
public:
95
public:
101
    GamepadsGtk(unsigned length);
96
    explicit GamepadsGtk(unsigned length);
102
97
103
    void registerDevice(String deviceFile);
98
    void registerDevice(String deviceFile);
104
    void unregisterDevice(String deviceFile);
99
    void unregisterDevice(String deviceFile);
Lines 145-151 void GamepadsGtk::registerDevice(String deviceFile) a/Source/WebCore/platform/gtk/GamepadsGtk.cpp_sec3
145
140
146
    for (unsigned index = 0; index < m_slots.size(); index++) {
141
    for (unsigned index = 0; index < m_slots.size(); index++) {
147
        if (!m_slots[index]) {
142
        if (!m_slots[index]) {
148
            m_slots[index] = GamepadDeviceGtk::create(deviceFile);
143
            m_slots[index] = std::make_unique<GamepadDeviceGtk>(deviceFile);
149
            m_deviceMap.add(deviceFile, m_slots[index].get());
144
            m_deviceMap.add(deviceFile, m_slots[index].get());
150
            break;
145
            break;
151
        }
146
        }

Return to Bug 139637