| Differences between
and this patch
- a/Source/WebCore/ChangeLog +80 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-04-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr in Supplement
4
        https://bugs.webkit.org/show_bug.cgi?id=132165
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        According to convert from PassOwnPtr to std::unique_ptr, provideTo() callers also begin
9
        to use std::make_unique.
10
11
        * Modules/battery/BatteryController.cpp:
12
        (WebCore::provideBatteryTo):
13
        * Modules/battery/BatteryController.h:
14
        * Modules/battery/NavigatorBattery.cpp:
15
        (WebCore::NavigatorBattery::from):
16
        * Modules/gamepad/NavigatorGamepad.cpp:
17
        (WebCore::NavigatorGamepad::from):
18
        * Modules/geolocation/GeolocationController.cpp:
19
        (WebCore::provideGeolocationTo):
20
        * Modules/geolocation/GeolocationController.h:
21
        * Modules/geolocation/NavigatorGeolocation.cpp:
22
        (WebCore::NavigatorGeolocation::from):
23
        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
24
        (WebCore::DOMWindowIndexedDatabase::from):
25
        * Modules/indexeddb/PageGroupIndexedDatabase.cpp:
26
        (WebCore::PageGroupIndexedDatabase::from):
27
        * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
28
        (WebCore::WorkerGlobalScopeIndexedDatabase::from):
29
        * Modules/mediastream/UserMediaController.cpp:
30
        (WebCore::provideUserMediaTo):
31
        (WebCore::UserMediaController::create): Deleted.
32
        * Modules/mediastream/UserMediaController.h:
33
        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
34
        (WebCore::provideNavigatorContentUtilsTo):
35
        (WebCore::NavigatorContentUtils::create): Deleted.
36
        * Modules/navigatorcontentutils/NavigatorContentUtils.h:
37
        * Modules/notifications/DOMWindowNotifications.cpp:
38
        (WebCore::DOMWindowNotifications::from):
39
        * Modules/notifications/NotificationController.cpp:
40
        (WebCore::provideNotification):
41
        (WebCore::NotificationController::create): Deleted.
42
        * Modules/notifications/NotificationController.h:
43
        * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
44
        (WebCore::WorkerGlobalScopeNotifications::from):
45
        * Modules/proximity/DeviceProximityController.cpp:
46
        (WebCore::provideDeviceProximityTo):
47
        (WebCore::DeviceProximityController::create): Deleted.
48
        * Modules/proximity/DeviceProximityController.h:
49
        * Modules/quota/DOMWindowQuota.cpp:
50
        (WebCore::DOMWindowQuota::from):
51
        * Modules/quota/NavigatorStorageQuota.cpp:
52
        (WebCore::NavigatorStorageQuota::from):
53
        * Modules/quota/WorkerNavigatorStorageQuota.cpp:
54
        (WebCore::WorkerNavigatorStorageQuota::from):
55
        * Modules/speech/DOMWindowSpeechSynthesis.cpp:
56
        (WebCore::DOMWindowSpeechSynthesis::from):
57
        * Modules/speech/SpeechRecognitionController.cpp:
58
        (WebCore::provideSpeechRecognitionTo):
59
        * Modules/vibration/Vibration.cpp:
60
        (WebCore::provideVibrationTo):
61
        (WebCore::Vibration::create): Deleted.
62
        * Modules/vibration/Vibration.h:
63
        * dom/DeviceMotionController.cpp:
64
        (WebCore::provideDeviceMotionTo):
65
        (WebCore::DeviceMotionController::create): Deleted.
66
        * dom/DeviceMotionController.h:
67
        * dom/DeviceOrientationController.cpp:
68
        (WebCore::provideDeviceOrientationTo):
69
        (WebCore::DeviceOrientationController::create): Deleted.
70
        * dom/DeviceOrientationController.h:
71
        * page/SpeechInput.cpp:
72
        (WebCore::provideSpeechInputTo):
73
        (WebCore::SpeechInput::create): Deleted.
74
        * page/SpeechInput.h:
75
        * platform/Supplementable.h:
76
        (WebCore::Supplement::provideTo):
77
        (WebCore::Supplementable::provideSupplement):
78
        * testing/InternalSettings.cpp:
79
        (WebCore::InternalSettings::from):
80
1
2014-04-30  Simon Fraser  <simon.fraser@apple.com>
81
2014-04-30  Simon Fraser  <simon.fraser@apple.com>
2
82
3
        More iOS build fixing. MediaPlayerPrivateIOS is defunct and can be removed.
83
        More iOS build fixing. MediaPlayerPrivateIOS is defunct and can be removed.
- a/Source/WebCore/Modules/battery/BatteryController.cpp -6 / +1 lines
Lines 42-52 BatteryController::~BatteryController() a/Source/WebCore/Modules/battery/BatteryController.cpp_sec1
42
    m_client->batteryControllerDestroyed();
42
    m_client->batteryControllerDestroyed();
43
}
43
}
44
44
45
PassOwnPtr<BatteryController> BatteryController::create(BatteryClient* client)
46
{
47
    return adoptPtr(new BatteryController(client));
48
}
49
50
void BatteryController::addListener(BatteryManager* batteryManager)
45
void BatteryController::addListener(BatteryManager* batteryManager)
51
{
46
{
52
    m_listeners.append(batteryManager);
47
    m_listeners.append(batteryManager);
Lines 102-108 const char* BatteryController::supplementName() a/Source/WebCore/Modules/battery/BatteryController.cpp_sec2
102
97
103
void provideBatteryTo(Page* page, BatteryClient* client)
98
void provideBatteryTo(Page* page, BatteryClient* client)
104
{
99
{
105
    Supplement<Page>::provideTo(page, BatteryController::supplementName(), BatteryController::create(client));
100
    Supplement<Page>::provideTo(page, BatteryController::supplementName(), std::make_unique<BatteryController>(client));
106
}
101
}
107
102
108
}
103
}
- a/Source/WebCore/Modules/battery/BatteryController.h -4 / +1 lines
Lines 32-41 class BatteryClient; a/Source/WebCore/Modules/battery/BatteryController.h_sec1
32
32
33
class BatteryController : public Supplement<Page> {
33
class BatteryController : public Supplement<Page> {
34
public:
34
public:
35
    explicit BatteryController(BatteryClient*);
35
    ~BatteryController();
36
    ~BatteryController();
36
37
37
    static PassOwnPtr<BatteryController> create(BatteryClient*);
38
39
    void addListener(BatteryManager*);
38
    void addListener(BatteryManager*);
40
    void removeListener(BatteryManager*);
39
    void removeListener(BatteryManager*);
41
    void updateBatteryStatus(PassRefPtr<BatteryStatus>);
40
    void updateBatteryStatus(PassRefPtr<BatteryStatus>);
Lines 47-54 public: a/Source/WebCore/Modules/battery/BatteryController.h_sec2
47
private:
46
private:
48
    typedef Vector<BatteryManager*> ListenerVector;
47
    typedef Vector<BatteryManager*> ListenerVector;
49
48
50
    explicit BatteryController(BatteryClient*);
51
52
    BatteryClient* m_client;
49
    BatteryClient* m_client;
53
    ListenerVector m_listeners;
50
    ListenerVector m_listeners;
54
51
- a/Source/WebCore/Modules/battery/NavigatorBattery.cpp -2 / +3 lines
Lines 56-63 NavigatorBattery* NavigatorBattery::from(Navigator* navigator) a/Source/WebCore/Modules/battery/NavigatorBattery.cpp_sec1
56
{
56
{
57
    NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, supplementName()));
57
    NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, supplementName()));
58
    if (!supplement) {
58
    if (!supplement) {
59
        supplement = new NavigatorBattery();
59
        auto newSupplement = std::make_unique<NavigatorBattery>();
60
        provideTo(navigator, supplementName(), adoptPtr(supplement));
60
        supplement = newSupplement.get();
61
        provideTo(navigator, supplementName(), std::move(newSupplement));
61
    }
62
    }
62
    return supplement;
63
    return supplement;
63
}
64
}
- a/Source/WebCore/Modules/battery/NavigatorBattery.h -1 / +1 lines
Lines 31-43 class Navigator; a/Source/WebCore/Modules/battery/NavigatorBattery.h_sec1
31
31
32
class NavigatorBattery : public Supplement<Navigator> {
32
class NavigatorBattery : public Supplement<Navigator> {
33
public:
33
public:
34
    NavigatorBattery();
34
    virtual ~NavigatorBattery();
35
    virtual ~NavigatorBattery();
35
36
36
    static NavigatorBattery* from(Navigator*);
37
    static NavigatorBattery* from(Navigator*);
37
    static BatteryManager* webkitBattery(Navigator*);
38
    static BatteryManager* webkitBattery(Navigator*);
38
39
39
 private:
40
 private:
40
    NavigatorBattery();
41
    static const char* supplementName();
41
    static const char* supplementName();
42
42
43
    RefPtr<BatteryManager> m_batteryManager;
43
    RefPtr<BatteryManager> m_batteryManager;
- a/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp -2 / +3 lines
Lines 52-59 NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator) a/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp_sec1
52
{
52
{
53
    NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName()));
53
    NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName()));
54
    if (!supplement) {
54
    if (!supplement) {
55
        supplement = new NavigatorGamepad();
55
        auto newSupplement = std::make_unique<NavigatorGamepad>();
56
        provideTo(navigator, supplementName(), adoptPtr(supplement));
56
        supplement = newSupplement.get();
57
        provideTo(navigator, supplementName(), std::move(newSupplement));
57
    }
58
    }
58
    return supplement;
59
    return supplement;
59
}
60
}
- a/Source/WebCore/Modules/gamepad/NavigatorGamepad.h -1 / +2 lines
Lines 37-43 class Navigator; a/Source/WebCore/Modules/gamepad/NavigatorGamepad.h_sec1
37
37
38
class NavigatorGamepad : public Supplement<Navigator> {
38
class NavigatorGamepad : public Supplement<Navigator> {
39
public:
39
public:
40
    NavigatorGamepad();
40
    virtual ~NavigatorGamepad();
41
    virtual ~NavigatorGamepad();
42
41
    static NavigatorGamepad* from(Navigator*);
43
    static NavigatorGamepad* from(Navigator*);
42
44
43
    static GamepadList* webkitGetGamepads(Navigator*);
45
    static GamepadList* webkitGetGamepads(Navigator*);
Lines 45-51 public: a/Source/WebCore/Modules/gamepad/NavigatorGamepad.h_sec2
45
    GamepadList* gamepads();
47
    GamepadList* gamepads();
46
48
47
private:
49
private:
48
    NavigatorGamepad();
49
    static const char* supplementName();
50
    static const char* supplementName();
50
51
51
    RefPtr<GamepadList> m_gamepads;
52
    RefPtr<GamepadList> m_gamepads;
- a/Source/WebCore/Modules/geolocation/GeolocationController.cpp -1 / +1 lines
Lines 132-138 const char* GeolocationController::supplementName() a/Source/WebCore/Modules/geolocation/GeolocationController.cpp_sec1
132
132
133
void provideGeolocationTo(Page* page, GeolocationClient* client)
133
void provideGeolocationTo(Page* page, GeolocationClient* client)
134
{
134
{
135
    Supplement<Page>::provideTo(page, GeolocationController::supplementName(), GeolocationController::create(client));
135
    Supplement<Page>::provideTo(page, GeolocationController::supplementName(), std::make_unique<GeolocationController>(client));
136
}
136
}
137
    
137
    
138
} // namespace WebCore
138
} // namespace WebCore
- a/Source/WebCore/Modules/geolocation/GeolocationController.h -2 / +1 lines
Lines 44-49 class Page; a/Source/WebCore/Modules/geolocation/GeolocationController.h_sec1
44
class GeolocationController : public Supplement<Page> {
44
class GeolocationController : public Supplement<Page> {
45
    WTF_MAKE_NONCOPYABLE(GeolocationController);
45
    WTF_MAKE_NONCOPYABLE(GeolocationController);
46
public:
46
public:
47
    explicit GeolocationController(GeolocationClient*);
47
    ~GeolocationController();
48
    ~GeolocationController();
48
49
49
    static PassOwnPtr<GeolocationController> create(GeolocationClient*);
50
    static PassOwnPtr<GeolocationController> create(GeolocationClient*);
Lines 65-72 public: a/Source/WebCore/Modules/geolocation/GeolocationController.h_sec2
65
    static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
66
    static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
66
67
67
private:
68
private:
68
    GeolocationController(GeolocationClient*);
69
70
    GeolocationClient* m_client;
69
    GeolocationClient* m_client;
71
70
72
    RefPtr<GeolocationPosition> m_lastPosition;
71
    RefPtr<GeolocationPosition> m_lastPosition;
- a/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp -2 / +3 lines
Lines 51-58 NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator) a/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp_sec1
51
{
51
{
52
    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
52
    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
53
    if (!supplement) {
53
    if (!supplement) {
54
        supplement = new NavigatorGeolocation(navigator->frame());
54
        auto newSupplement = std::make_unique<NavigatorGeolocation>(navigator->frame());
55
        provideTo(navigator, supplementName(), adoptPtr(supplement));
55
        supplement = newSupplement.get();
56
        provideTo(navigator, supplementName(), std::move(newSupplement));
56
    }
57
    }
57
    return supplement;
58
    return supplement;
58
}
59
}
- a/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h -1 / +1 lines
Lines 33-38 class Navigator; a/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h_sec1
33
33
34
class NavigatorGeolocation : public Supplement<Navigator>, public DOMWindowProperty {
34
class NavigatorGeolocation : public Supplement<Navigator>, public DOMWindowProperty {
35
public:
35
public:
36
    explicit NavigatorGeolocation(Frame*);
36
    virtual ~NavigatorGeolocation();
37
    virtual ~NavigatorGeolocation();
37
    static NavigatorGeolocation* from(Navigator*);
38
    static NavigatorGeolocation* from(Navigator*);
38
39
Lines 44-50 public: a/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h_sec2
44
#endif // PLATFORM(IOS)
45
#endif // PLATFORM(IOS)
45
46
46
private:
47
private:
47
    NavigatorGeolocation(Frame*);
48
    static const char* supplementName();
48
    static const char* supplementName();
49
49
50
    mutable RefPtr<Geolocation> m_geolocation;
50
    mutable RefPtr<Geolocation> m_geolocation;
- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp -2 / +3 lines
Lines 56-63 DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window) a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp_sec1
56
{
56
{
57
    DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, supplementName()));
57
    DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, supplementName()));
58
    if (!supplement) {
58
    if (!supplement) {
59
        supplement = new DOMWindowIndexedDatabase(window);
59
        auto newSupplement = std::make_unique<DOMWindowIndexedDatabase>(window);
60
        provideTo(window, supplementName(), adoptPtr(supplement));
60
        supplement = newSupplement.get();
61
        provideTo(window, supplementName(), std::move(newSupplement));
61
    }
62
    }
62
    return supplement;
63
    return supplement;
63
}
64
}
- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h -2 / +2 lines
Lines 38-44 class DOMWindow; a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h_sec1
38
38
39
class DOMWindowIndexedDatabase : public DOMWindowProperty, public Supplement<DOMWindow> {
39
class DOMWindowIndexedDatabase : public DOMWindowProperty, public Supplement<DOMWindow> {
40
public:
40
public:
41
    explicit DOMWindowIndexedDatabase(DOMWindow*);
41
    virtual ~DOMWindowIndexedDatabase();
42
    virtual ~DOMWindowIndexedDatabase();
43
42
    static DOMWindowIndexedDatabase* from(DOMWindow*);
44
    static DOMWindowIndexedDatabase* from(DOMWindow*);
43
45
44
    static IDBFactory* indexedDB(DOMWindow*);
46
    static IDBFactory* indexedDB(DOMWindow*);
Lines 50-57 public: a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h_sec2
50
    virtual void willDetachGlobalObjectFromFrame() override;
52
    virtual void willDetachGlobalObjectFromFrame() override;
51
53
52
private:
54
private:
53
    explicit DOMWindowIndexedDatabase(DOMWindow*);
54
55
    IDBFactory* indexedDB();
55
    IDBFactory* indexedDB();
56
    static const char* supplementName();
56
    static const char* supplementName();
57
57
- a/Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp -2 / +3 lines
Lines 52-59 PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group) a/Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp_sec1
52
{
52
{
53
    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, supplementName()));
53
    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, supplementName()));
54
    if (!supplement) {
54
    if (!supplement) {
55
        supplement = new PageGroupIndexedDatabase(group.groupSettings().indexedDBDatabasePath());
55
        auto newSupplement = std::make_unique<PageGroupIndexedDatabase>(group.groupSettings().indexedDBDatabasePath());
56
        provideTo(&group, supplementName(), adoptPtr(supplement));
56
        supplement = newSupplement.get();
57
        provideTo(&group, supplementName(), std::move(newSupplement));
57
    }
58
    }
58
    return supplement;
59
    return supplement;
59
}
60
}
- a/Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h -1 / +2 lines
Lines 38-50 class PageGroup; a/Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h_sec1
38
38
39
class PageGroupIndexedDatabase : public Supplement<PageGroup> {
39
class PageGroupIndexedDatabase : public Supplement<PageGroup> {
40
public:
40
public:
41
    explicit PageGroupIndexedDatabase(const String& databaseDirectoryIdentifier);
41
    virtual ~PageGroupIndexedDatabase();
42
    virtual ~PageGroupIndexedDatabase();
43
42
    static PageGroupIndexedDatabase* from(PageGroup&);
44
    static PageGroupIndexedDatabase* from(PageGroup&);
43
45
44
    IDBFactoryBackendInterface* factoryBackend();
46
    IDBFactoryBackendInterface* factoryBackend();
45
47
46
private:
48
private:
47
    explicit PageGroupIndexedDatabase(const String& databaseDirectoryIdentifier);
48
    static const char* supplementName();
49
    static const char* supplementName();
49
50
50
    String m_databaseDirectoryIdentifier;
51
    String m_databaseDirectoryIdentifier;
- a/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp -2 / +3 lines
Lines 61-68 WorkerGlobalScopeIndexedDatabase* WorkerGlobalScopeIndexedDatabase::from(ScriptE a/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp_sec1
61
        if (groupSettings)
61
        if (groupSettings)
62
            databaseDirectoryIdentifier = groupSettings->indexedDBDatabasePath();
62
            databaseDirectoryIdentifier = groupSettings->indexedDBDatabasePath();
63
63
64
        supplement = new WorkerGlobalScopeIndexedDatabase(databaseDirectoryIdentifier);
64
        auto newSupplement = std::make_unique<WorkerGlobalScopeIndexedDatabase>(databaseDirectoryIdentifier);
65
        provideTo(context, supplementName(), adoptPtr(supplement));
65
        supplement = newSupplement.get();
66
        provideTo(context, supplementName(), std::move(newSupplement));
66
    }
67
    }
67
    return supplement;
68
    return supplement;
68
}
69
}
- a/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h -2 / +1 lines
Lines 40-53 class ScriptExecutionContext; a/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h_sec1
40
40
41
class WorkerGlobalScopeIndexedDatabase : public Supplement<ScriptExecutionContext> {
41
class WorkerGlobalScopeIndexedDatabase : public Supplement<ScriptExecutionContext> {
42
public:
42
public:
43
    explicit WorkerGlobalScopeIndexedDatabase(const String& databaseDirectoryIdentifier);
43
    virtual ~WorkerGlobalScopeIndexedDatabase();
44
    virtual ~WorkerGlobalScopeIndexedDatabase();
44
    static WorkerGlobalScopeIndexedDatabase* from(ScriptExecutionContext*);
45
    static WorkerGlobalScopeIndexedDatabase* from(ScriptExecutionContext*);
45
46
46
    static IDBFactory* indexedDB(ScriptExecutionContext*);
47
    static IDBFactory* indexedDB(ScriptExecutionContext*);
47
48
48
private:
49
private:
49
    explicit WorkerGlobalScopeIndexedDatabase(const String& databaseDirectoryIdentifier);
50
51
    IDBFactory* indexedDB();
50
    IDBFactory* indexedDB();
52
    static const char* supplementName();
51
    static const char* supplementName();
53
52
- a/Source/WebCore/Modules/mediastream/UserMediaController.cpp -6 / +1 lines
Lines 44-58 UserMediaController::~UserMediaController() a/Source/WebCore/Modules/mediastream/UserMediaController.cpp_sec1
44
    m_client->pageDestroyed();
44
    m_client->pageDestroyed();
45
}
45
}
46
46
47
PassOwnPtr<UserMediaController> UserMediaController::create(UserMediaClient* client)
48
{
49
    return adoptPtr(new UserMediaController(client));
50
}
51
52
void provideUserMediaTo(Page* page, UserMediaClient* client)
47
void provideUserMediaTo(Page* page, UserMediaClient* client)
53
{
48
{
54
    if (!Supplement<Page>::from(page, UserMediaController::supplementName()))
49
    if (!Supplement<Page>::from(page, UserMediaController::supplementName()))
55
        UserMediaController::provideTo(page, UserMediaController::supplementName(), UserMediaController::create(client));
50
        UserMediaController::provideTo(page, UserMediaController::supplementName(), std::make_unique<UserMediaController>(client));
56
}
51
}
57
52
58
} // namespace WebCore
53
} // namespace WebCore
- a/Source/WebCore/Modules/mediastream/UserMediaController.h -4 / +1 lines
Lines 36-54 namespace WebCore { a/Source/WebCore/Modules/mediastream/UserMediaController.h_sec1
36
36
37
class UserMediaController : public Supplement<Page> {
37
class UserMediaController : public Supplement<Page> {
38
public:
38
public:
39
    explicit UserMediaController(UserMediaClient*);
39
    ~UserMediaController();
40
    ~UserMediaController();
40
41
41
    UserMediaClient* client() const { return m_client; }
42
    UserMediaClient* client() const { return m_client; }
42
    void requestPermission(PassRefPtr<UserMediaRequest>);
43
    void requestPermission(PassRefPtr<UserMediaRequest>);
43
    void cancelRequest(UserMediaRequest*);
44
    void cancelRequest(UserMediaRequest*);
44
45
45
    static PassOwnPtr<UserMediaController> create(UserMediaClient*);
46
    static const char* supplementName();
46
    static const char* supplementName();
47
    static UserMediaController* from(Page* page) { return static_cast<UserMediaController*>(Supplement<Page>::from(page, supplementName())); }
47
    static UserMediaController* from(Page* page) { return static_cast<UserMediaController*>(Supplement<Page>::from(page, supplementName())); }
48
48
49
protected:
50
    explicit UserMediaController(UserMediaClient*);
51
52
private:
49
private:
53
    UserMediaClient* m_client;
50
    UserMediaClient* m_client;
54
};
51
};
- a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp -6 / +1 lines
Lines 126-136 NavigatorContentUtils::~NavigatorContentUtils() a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp_sec1
126
{
126
{
127
}
127
}
128
128
129
PassOwnPtr<NavigatorContentUtils> NavigatorContentUtils::create(std::unique_ptr<NavigatorContentUtilsClient> client)
130
{
131
    return adoptPtr(new NavigatorContentUtils(std::move(client)));
132
}
133
134
void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const String& scheme, const String& url, const String& title, ExceptionCode& ec)
129
void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const String& scheme, const String& url, const String& title, ExceptionCode& ec)
135
{
130
{
136
    if (!navigator->frame())
131
    if (!navigator->frame())
Lines 209-215 const char* NavigatorContentUtils::supplementName() a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp_sec2
209
204
210
void provideNavigatorContentUtilsTo(Page* page, std::unique_ptr<NavigatorContentUtilsClient> client)
205
void provideNavigatorContentUtilsTo(Page* page, std::unique_ptr<NavigatorContentUtilsClient> client)
211
{
206
{
212
    NavigatorContentUtils::provideTo(page, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(std::move(client)));
207
    NavigatorContentUtils::provideTo(page, NavigatorContentUtils::supplementName(), std::make_unique<NavigatorContentUtils>(std::move(client)));
213
}
208
}
214
209
215
} // namespace WebCore
210
} // namespace WebCore
- a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h -6 / +4 lines
Lines 43-48 typedef int ExceptionCode; a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h_sec1
43
43
44
class NavigatorContentUtils final : public Supplement<Page> {
44
class NavigatorContentUtils final : public Supplement<Page> {
45
public:
45
public:
46
    explicit NavigatorContentUtils(std::unique_ptr<NavigatorContentUtilsClient> client)
47
        : m_client(std::move(client))
48
    { }
49
46
    virtual ~NavigatorContentUtils();
50
    virtual ~NavigatorContentUtils();
47
51
48
    static const char* supplementName();
52
    static const char* supplementName();
Lines 55-67 public: a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h_sec2
55
    static void unregisterProtocolHandler(Navigator*, const String& scheme, const String& url, ExceptionCode&);
59
    static void unregisterProtocolHandler(Navigator*, const String& scheme, const String& url, ExceptionCode&);
56
#endif
60
#endif
57
61
58
    static PassOwnPtr<NavigatorContentUtils> create(std::unique_ptr<NavigatorContentUtilsClient>);
59
60
private:
62
private:
61
    explicit NavigatorContentUtils(std::unique_ptr<NavigatorContentUtilsClient> client)
62
        : m_client(std::move(client))
63
    { }
64
65
    NavigatorContentUtilsClient* client() { return m_client.get(); }
63
    NavigatorContentUtilsClient* client() { return m_client.get(); }
66
64
67
    std::unique_ptr<NavigatorContentUtilsClient> m_client;
65
    std::unique_ptr<NavigatorContentUtilsClient> m_client;
- a/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp -2 / +3 lines
Lines 56-63 DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window) a/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp_sec1
56
{
56
{
57
    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName()));
57
    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName()));
58
    if (!supplement) {
58
    if (!supplement) {
59
        supplement = new DOMWindowNotifications(window);
59
        auto newSupplement = std::make_unique<DOMWindowNotifications>(window);
60
        Supplement<DOMWindow>::provideTo(window, supplementName(), adoptPtr(supplement));
60
        supplement = newSupplement.get();
61
        provideTo(window, supplementName(), std::move(newSupplement));
61
    }
62
    }
62
    return supplement;
63
    return supplement;
63
}
64
}
- a/Source/WebCore/Modules/notifications/DOMWindowNotifications.h -2 / +1 lines
Lines 40-45 class NotificationCenter; a/Source/WebCore/Modules/notifications/DOMWindowNotifications.h_sec1
40
40
41
class DOMWindowNotifications : public Supplement<DOMWindow>, public DOMWindowProperty {
41
class DOMWindowNotifications : public Supplement<DOMWindow>, public DOMWindowProperty {
42
public:
42
public:
43
    explicit DOMWindowNotifications(DOMWindow*);
43
    virtual ~DOMWindowNotifications();
44
    virtual ~DOMWindowNotifications();
44
45
45
    static NotificationCenter* webkitNotifications(DOMWindow*);
46
    static NotificationCenter* webkitNotifications(DOMWindow*);
Lines 52-59 public: a/Source/WebCore/Modules/notifications/DOMWindowNotifications.h_sec2
52
    virtual void willDetachGlobalObjectFromFrame() override;
53
    virtual void willDetachGlobalObjectFromFrame() override;
53
54
54
private:
55
private:
55
    explicit DOMWindowNotifications(DOMWindow*);
56
57
    NotificationCenter* webkitNotifications();
56
    NotificationCenter* webkitNotifications();
58
    static const char* supplementName();
57
    static const char* supplementName();
59
58
- a/Source/WebCore/Modules/notifications/NotificationController.cpp -6 / +1 lines
Lines 44-54 NotificationController::~NotificationController() a/Source/WebCore/Modules/notifications/NotificationController.cpp_sec1
44
        m_client->notificationControllerDestroyed();
44
        m_client->notificationControllerDestroyed();
45
}
45
}
46
46
47
PassOwnPtr<NotificationController> NotificationController::create(NotificationClient* client)
48
{
49
    return adoptPtr(new NotificationController(client));
50
}
51
52
NotificationClient* NotificationController::clientFrom(Page* page)
47
NotificationClient* NotificationController::clientFrom(Page* page)
53
{
48
{
54
    if (NotificationController* controller = NotificationController::from(page))
49
    if (NotificationController* controller = NotificationController::from(page))
Lines 63-69 const char* NotificationController::supplementName() a/Source/WebCore/Modules/notifications/NotificationController.cpp_sec2
63
58
64
void provideNotification(Page* page, NotificationClient* client)
59
void provideNotification(Page* page, NotificationClient* client)
65
{
60
{
66
    NotificationController::provideTo(page, NotificationController::supplementName(), NotificationController::create(client));
61
    NotificationController::provideTo(page, NotificationController::supplementName(), std::make_unique<NotificationController>(client));
67
}
62
}
68
63
69
} // namespace WebCore
64
} // namespace WebCore
- a/Source/WebCore/Modules/notifications/NotificationController.h -3 / +1 lines
Lines 39-47 class NotificationClient; a/Source/WebCore/Modules/notifications/NotificationController.h_sec1
39
class NotificationController : public Supplement<Page> {
39
class NotificationController : public Supplement<Page> {
40
    WTF_MAKE_NONCOPYABLE(NotificationController);
40
    WTF_MAKE_NONCOPYABLE(NotificationController);
41
public:
41
public:
42
    explicit NotificationController(NotificationClient*);
42
    ~NotificationController();
43
    ~NotificationController();
43
44
44
    static PassOwnPtr<NotificationController> create(NotificationClient*);
45
    static const char* supplementName();
45
    static const char* supplementName();
46
    static NotificationController* from(Page* page) { return static_cast<NotificationController*>(Supplement<Page>::from(page, supplementName())); }
46
    static NotificationController* from(Page* page) { return static_cast<NotificationController*>(Supplement<Page>::from(page, supplementName())); }
47
    static NotificationClient* clientFrom(Page*);
47
    static NotificationClient* clientFrom(Page*);
Lines 49-56 public: a/Source/WebCore/Modules/notifications/NotificationController.h_sec2
49
    NotificationClient* client() { return m_client; }
49
    NotificationClient* client() { return m_client; }
50
    
50
    
51
private:
51
private:
52
    explicit NotificationController(NotificationClient*);
53
54
    NotificationClient* m_client;
52
    NotificationClient* m_client;
55
};
53
};
56
54
- a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp -2 / +3 lines
Lines 54-61 WorkerGlobalScopeNotifications* WorkerGlobalScopeNotifications::from(WorkerGloba a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp_sec1
54
{
54
{
55
    WorkerGlobalScopeNotifications* supplement = static_cast<WorkerGlobalScopeNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
55
    WorkerGlobalScopeNotifications* supplement = static_cast<WorkerGlobalScopeNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
56
    if (!supplement) {
56
    if (!supplement) {
57
        supplement = new WorkerGlobalScopeNotifications(context);
57
        auto newSupplement = std::make_unique<WorkerGlobalScopeNotifications>(context);
58
        Supplement<ScriptExecutionContext>::provideTo(context, supplementName(), adoptPtr(supplement));
58
        supplement = newSupplement.get();
59
        provideTo(context, supplementName(), std::move(newSupplement));
59
    }
60
    }
60
    return supplement;
61
    return supplement;
61
}
62
}
- a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h -2 / +1 lines
Lines 39-52 class WorkerGlobalScope; a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h_sec1
39
39
40
class WorkerGlobalScopeNotifications : public Supplement<ScriptExecutionContext> {
40
class WorkerGlobalScopeNotifications : public Supplement<ScriptExecutionContext> {
41
public:
41
public:
42
    explicit WorkerGlobalScopeNotifications(WorkerGlobalScope*);
42
    virtual ~WorkerGlobalScopeNotifications();
43
    virtual ~WorkerGlobalScopeNotifications();
43
44
44
    static NotificationCenter* webkitNotifications(WorkerGlobalScope*);
45
    static NotificationCenter* webkitNotifications(WorkerGlobalScope*);
45
    static WorkerGlobalScopeNotifications* from(WorkerGlobalScope*);
46
    static WorkerGlobalScopeNotifications* from(WorkerGlobalScope*);
46
47
47
private:
48
private:
48
    explicit WorkerGlobalScopeNotifications(WorkerGlobalScope*);
49
50
    NotificationCenter* webkitNotifications();
49
    NotificationCenter* webkitNotifications();
51
    static const char* supplementName();
50
    static const char* supplementName();
52
51
- a/Source/WebCore/Modules/proximity/DeviceProximityController.cpp -6 / +1 lines
Lines 40-50 DeviceProximityController::DeviceProximityController(DeviceProximityClient* clie a/Source/WebCore/Modules/proximity/DeviceProximityController.cpp_sec1
40
    ASSERT(m_client);
40
    ASSERT(m_client);
41
}
41
}
42
42
43
PassOwnPtr<DeviceProximityController> DeviceProximityController::create(DeviceProximityClient* client)
44
{
45
    return adoptPtr(new DeviceProximityController(client));
46
}
47
48
void DeviceProximityController::didChangeDeviceProximity(const double value, const double min, const double max)
43
void DeviceProximityController::didChangeDeviceProximity(const double value, const double min, const double max)
49
{
44
{
50
    ASSERT(value >= min && value <= max);
45
    ASSERT(value >= min && value <= max);
Lines 86-92 bool DeviceProximityController::isActiveAt(Page* page) a/Source/WebCore/Modules/proximity/DeviceProximityController.cpp_sec2
86
81
87
void provideDeviceProximityTo(Page* page, DeviceProximityClient* client)
82
void provideDeviceProximityTo(Page* page, DeviceProximityClient* client)
88
{
83
{
89
    DeviceProximityController::provideTo(page, DeviceProximityController::supplementName(), DeviceProximityController::create(client));
84
    DeviceProximityController::provideTo(page, DeviceProximityController::supplementName(), std::make_unique<DeviceProximityController>(client));
90
}
85
}
91
86
92
} // namespace WebCore
87
} // namespace WebCore
- a/Source/WebCore/Modules/proximity/DeviceProximityController.h -5 / +1 lines
Lines 36-45 class DeviceProximityClient; a/Source/WebCore/Modules/proximity/DeviceProximityController.h_sec1
36
36
37
class DeviceProximityController : public DeviceController {
37
class DeviceProximityController : public DeviceController {
38
public:
38
public:
39
    explicit DeviceProximityController(DeviceProximityClient*);
39
    ~DeviceProximityController() { }
40
    ~DeviceProximityController() { }
40
41
41
    static PassOwnPtr<DeviceProximityController> create(DeviceProximityClient*);
42
43
    void didChangeDeviceProximity(const double value, const double min, const double max);
42
    void didChangeDeviceProximity(const double value, const double min, const double max);
44
    DeviceProximityClient* deviceProximityClient();
43
    DeviceProximityClient* deviceProximityClient();
45
44
Lines 49-57 public: a/Source/WebCore/Modules/proximity/DeviceProximityController.h_sec2
49
    static const char* supplementName();
48
    static const char* supplementName();
50
    static DeviceProximityController* from(Page*);
49
    static DeviceProximityController* from(Page*);
51
    static bool isActiveAt(Page*);
50
    static bool isActiveAt(Page*);
52
53
private:
54
    explicit DeviceProximityController(DeviceProximityClient*);
55
};
51
};
56
52
57
} // namespace WebCore
53
} // namespace WebCore
- a/Source/WebCore/Modules/quota/DOMWindowQuota.cpp -2 / +3 lines
Lines 60-67 DOMWindowQuota* DOMWindowQuota::from(DOMWindow* window) a/Source/WebCore/Modules/quota/DOMWindowQuota.cpp_sec1
60
{
60
{
61
    DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<DOMWindow>::from(window, supplementName()));
61
    DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<DOMWindow>::from(window, supplementName()));
62
    if (!supplement) {
62
    if (!supplement) {
63
        supplement = new DOMWindowQuota(window);
63
        auto newSupplement = std::make_unique<DOMWindowQuota>(window);
64
        provideTo(window, supplementName(), adoptPtr(supplement));
64
        supplement = newSupplement.get();
65
        provideTo(window, supplementName(), std::move(newSupplement));
65
    }
66
    }
66
    return supplement;
67
    return supplement;
67
}
68
}
- a/Source/WebCore/Modules/quota/DOMWindowQuota.h -1 / +1 lines
Lines 43-55 class StorageInfo; a/Source/WebCore/Modules/quota/DOMWindowQuota.h_sec1
43
43
44
class DOMWindowQuota : public Supplement<DOMWindow>, public DOMWindowProperty {
44
class DOMWindowQuota : public Supplement<DOMWindow>, public DOMWindowProperty {
45
public:
45
public:
46
    explicit DOMWindowQuota(DOMWindow*);
46
    virtual ~DOMWindowQuota();
47
    virtual ~DOMWindowQuota();
47
    static DOMWindowQuota* from(DOMWindow*);
48
    static DOMWindowQuota* from(DOMWindow*);
48
    static StorageInfo* webkitStorageInfo(DOMWindow*);
49
    static StorageInfo* webkitStorageInfo(DOMWindow*);
49
    StorageInfo* webkitStorageInfo() const;
50
    StorageInfo* webkitStorageInfo() const;
50
51
51
private:
52
private:
52
    explicit DOMWindowQuota(DOMWindow*);
53
    static const char* supplementName();
53
    static const char* supplementName();
54
54
55
    mutable RefPtr<StorageInfo> m_storageInfo;
55
    mutable RefPtr<StorageInfo> m_storageInfo;
- a/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp -2 / +3 lines
Lines 57-64 NavigatorStorageQuota* NavigatorStorageQuota::from(Navigator* navigator) a/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp_sec1
57
{
57
{
58
    NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Supplement<Navigator>::from(navigator, supplementName()));
58
    NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Supplement<Navigator>::from(navigator, supplementName()));
59
    if (!supplement) {
59
    if (!supplement) {
60
        supplement = new NavigatorStorageQuota(navigator->frame());
60
        auto newSupplement = std::make_unique<NavigatorStorageQuota>(window);
61
        provideTo(navigator, supplementName(), adoptPtr(supplement));
61
        supplement = newSupplement.get();
62
        provideTo(navigator, supplementName(), std::move(newSupplement));
62
    }
63
    }
63
    return supplement;
64
    return supplement;
64
}
65
}
- a/Source/WebCore/Modules/quota/NavigatorStorageQuota.h -1 / +1 lines
Lines 44-49 class Navigator; a/Source/WebCore/Modules/quota/NavigatorStorageQuota.h_sec1
44
44
45
class NavigatorStorageQuota : public Supplement<Navigator>, public DOMWindowProperty {
45
class NavigatorStorageQuota : public Supplement<Navigator>, public DOMWindowProperty {
46
public:
46
public:
47
    explicit NavigatorStorageQuota(Frame*);
47
    virtual ~NavigatorStorageQuota();
48
    virtual ~NavigatorStorageQuota();
48
    static NavigatorStorageQuota* from(Navigator*);
49
    static NavigatorStorageQuota* from(Navigator*);
49
50
Lines 53-59 public: a/Source/WebCore/Modules/quota/NavigatorStorageQuota.h_sec2
53
    StorageQuota* webkitPersistentStorage() const;
54
    StorageQuota* webkitPersistentStorage() const;
54
55
55
private:
56
private:
56
    explicit NavigatorStorageQuota(Frame*);
57
    static const char* supplementName();
57
    static const char* supplementName();
58
58
59
    mutable RefPtr<StorageQuota> m_temporaryStorage;
59
    mutable RefPtr<StorageQuota> m_temporaryStorage;
- a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp -2 / +3 lines
Lines 55-62 WorkerNavigatorStorageQuota* WorkerNavigatorStorageQuota::from(WorkerNavigator* a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp_sec1
55
{
55
{
56
    WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorageQuota*>(Supplement<WorkerNavigator>::from(navigator, supplementName()));
56
    WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorageQuota*>(Supplement<WorkerNavigator>::from(navigator, supplementName()));
57
    if (!supplement) {
57
    if (!supplement) {
58
        supplement = new WorkerNavigatorStorageQuota();
58
        auto newSupplement = std::make_unique<WorkerNavigatorStorageQuota>(window);
59
        provideTo(navigator, supplementName(), adoptPtr(supplement));
59
        supplement = newSupplement.get();
60
        provideTo(navigator, supplementName(), std::move(newSupplement));
60
    }
61
    }
61
    return supplement;
62
    return supplement;
62
}
63
}
- a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h -1 / +1 lines
Lines 44-49 class WorkerNavigator; a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h_sec1
44
44
45
class WorkerNavigatorStorageQuota : public Supplement<WorkerNavigator> {
45
class WorkerNavigatorStorageQuota : public Supplement<WorkerNavigator> {
46
public:
46
public:
47
    explicit WorkerNavigatorStorageQuota();
47
    virtual ~WorkerNavigatorStorageQuota();
48
    virtual ~WorkerNavigatorStorageQuota();
48
    static WorkerNavigatorStorageQuota* from(WorkerNavigator*);
49
    static WorkerNavigatorStorageQuota* from(WorkerNavigator*);
49
50
Lines 53-59 public: a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h_sec2
53
    StorageQuota* webkitPersistentStorage() const;
54
    StorageQuota* webkitPersistentStorage() const;
54
55
55
private:
56
private:
56
    explicit WorkerNavigatorStorageQuota();
57
    static const char* supplementName();
57
    static const char* supplementName();
58
58
59
    mutable RefPtr<StorageQuota> m_temporaryStorage;
59
    mutable RefPtr<StorageQuota> m_temporaryStorage;
- a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp -2 / +3 lines
Lines 57-64 DOMWindowSpeechSynthesis* DOMWindowSpeechSynthesis::from(DOMWindow* window) a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp_sec1
57
{
57
{
58
    DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(Supplement<DOMWindow>::from(window, supplementName()));
58
    DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(Supplement<DOMWindow>::from(window, supplementName()));
59
    if (!supplement) {
59
    if (!supplement) {
60
        supplement = new DOMWindowSpeechSynthesis(window);
60
        auto newSupplement = std::make_unique<DOMWindowSpeechSynthesis>(window);
61
        provideTo(window, supplementName(), adoptPtr(supplement));
61
        supplement = newSupplement.get();
62
        provideTo(window, supplementName(), std::move(newSupplement));
62
    }
63
    }
63
    return supplement;
64
    return supplement;
64
}
65
}
- a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.h -2 / +1 lines
Lines 38-51 class DOMWindow; a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.h_sec1
38
38
39
class DOMWindowSpeechSynthesis : public Supplement<DOMWindow>, public DOMWindowProperty {
39
class DOMWindowSpeechSynthesis : public Supplement<DOMWindow>, public DOMWindowProperty {
40
public:
40
public:
41
    explicit DOMWindowSpeechSynthesis(DOMWindow*);
41
    virtual ~DOMWindowSpeechSynthesis();
42
    virtual ~DOMWindowSpeechSynthesis();
42
    
43
    
43
    static SpeechSynthesis* speechSynthesis(DOMWindow*);
44
    static SpeechSynthesis* speechSynthesis(DOMWindow*);
44
    static DOMWindowSpeechSynthesis* from(DOMWindow*);
45
    static DOMWindowSpeechSynthesis* from(DOMWindow*);
45
    
46
    
46
private:
47
private:
47
    explicit DOMWindowSpeechSynthesis(DOMWindow*);
48
    
49
    SpeechSynthesis* speechSynthesis();
48
    SpeechSynthesis* speechSynthesis();
50
    static const char* supplementName();
49
    static const char* supplementName();
51
    
50
    
- a/Source/WebCore/Modules/speech/SpeechRecognitionController.cpp -1 / +1 lines
Lines 47-53 SpeechRecognitionController::~SpeechRecognitionController() a/Source/WebCore/Modules/speech/SpeechRecognitionController.cpp_sec1
47
47
48
void provideSpeechRecognitionTo(Page* page, SpeechRecognitionClient* client)
48
void provideSpeechRecognitionTo(Page* page, SpeechRecognitionClient* client)
49
{
49
{
50
    SpeechRecognitionController::provideTo(page, SpeechRecognitionController::supplementName(), SpeechRecognitionController::create(client));
50
    SpeechRecognitionController::provideTo(page, SpeechRecognitionController::supplementName(), std::make_unique<SpeechRecognitionController>(client));
51
}
51
}
52
52
53
} // namespace WebCore
53
} // namespace WebCore
- a/Source/WebCore/Modules/vibration/Vibration.cpp -6 / +1 lines
Lines 43-53 Vibration::~Vibration() a/Source/WebCore/Modules/vibration/Vibration.cpp_sec1
43
    m_vibrationClient->vibrationDestroyed();
43
    m_vibrationClient->vibrationDestroyed();
44
}
44
}
45
45
46
PassOwnPtr<Vibration> Vibration::create(VibrationClient* client)
47
{
48
    return adoptPtr(new Vibration(client));
49
}
50
51
bool Vibration::vibrate(const VibrationPattern& pattern)
46
bool Vibration::vibrate(const VibrationPattern& pattern)
52
{
47
{
53
    VibrationPattern& sanitized = const_cast<VibrationPattern&>(pattern);
48
    VibrationPattern& sanitized = const_cast<VibrationPattern&>(pattern);
Lines 128-134 const char* Vibration::supplementName() a/Source/WebCore/Modules/vibration/Vibration.cpp_sec2
128
123
129
void provideVibrationTo(Page* page, VibrationClient* client)
124
void provideVibrationTo(Page* page, VibrationClient* client)
130
{
125
{
131
    Vibration::provideTo(page, Vibration::supplementName(), Vibration::create(client));
126
    Vibration::provideTo(page, Vibration::supplementName(), std::make_unique<Vibration>(client));
132
}
127
}
133
128
134
} // namespace WebCore
129
} // namespace WebCore
- a/Source/WebCore/Modules/vibration/Vibration.h -2 lines
Lines 37-44 public: a/Source/WebCore/Modules/vibration/Vibration.h_sec1
37
    explicit Vibration(VibrationClient*);
37
    explicit Vibration(VibrationClient*);
38
    ~Vibration();
38
    ~Vibration();
39
39
40
    static PassOwnPtr<Vibration> create(VibrationClient*);
41
42
    bool vibrate(const VibrationPattern&);
40
    bool vibrate(const VibrationPattern&);
43
    // FIXME: When a visibilitychange event is dispatched while vibrating, the vibration should be canceled.
41
    // FIXME: When a visibilitychange event is dispatched while vibrating, the vibration should be canceled.
44
    void cancelVibration();
42
    void cancelVibration();
- a/Source/WebCore/dom/DeviceMotionController.cpp -6 / +1 lines
Lines 41-51 DeviceMotionController::DeviceMotionController(DeviceMotionClient* client) a/Source/WebCore/dom/DeviceMotionController.cpp_sec1
41
    deviceMotionClient()->setController(this);
41
    deviceMotionClient()->setController(this);
42
}
42
}
43
43
44
PassOwnPtr<DeviceMotionController> DeviceMotionController::create(DeviceMotionClient* client)
45
{
46
    return adoptPtr(new DeviceMotionController(client));
47
}
48
49
#if PLATFORM(IOS)
44
#if PLATFORM(IOS)
50
// FIXME: We should look to reconcile the iOS and OpenSource differences with this class
45
// FIXME: We should look to reconcile the iOS and OpenSource differences with this class
51
// so that we can either remove these methods or remove the PLATFORM(IOS)-guard.
46
// so that we can either remove these methods or remove the PLATFORM(IOS)-guard.
Lines 101-107 bool DeviceMotionController::isActiveAt(Page* page) a/Source/WebCore/dom/DeviceMotionController.cpp_sec2
101
96
102
void provideDeviceMotionTo(Page* page, DeviceMotionClient* client)
97
void provideDeviceMotionTo(Page* page, DeviceMotionClient* client)
103
{
98
{
104
    DeviceMotionController::provideTo(page, DeviceMotionController::supplementName(), DeviceMotionController::create(client));
99
    DeviceMotionController::provideTo(page, DeviceMotionController::supplementName(), std::make_unique<DeviceMotionController>(client));
105
}
100
}
106
101
107
} // namespace WebCore
102
} // namespace WebCore
- a/Source/WebCore/dom/DeviceMotionController.h -5 / +1 lines
Lines 38-47 class DeviceMotionData; a/Source/WebCore/dom/DeviceMotionController.h_sec1
38
class DeviceMotionController : public DeviceController {
38
class DeviceMotionController : public DeviceController {
39
    WTF_MAKE_NONCOPYABLE(DeviceMotionController);
39
    WTF_MAKE_NONCOPYABLE(DeviceMotionController);
40
public:
40
public:
41
    explicit DeviceMotionController(DeviceMotionClient*);
41
    ~DeviceMotionController() { };
42
    ~DeviceMotionController() { };
42
43
43
    static PassOwnPtr<DeviceMotionController> create(DeviceMotionClient*);
44
45
#if PLATFORM(IOS)
44
#if PLATFORM(IOS)
46
    // FIXME: We should look to reconcile the iOS and OpenSource differences with this class
45
    // FIXME: We should look to reconcile the iOS and OpenSource differences with this class
47
    // so that we can either remove these methods or remove the PLATFORM(IOS)-guard.
46
    // so that we can either remove these methods or remove the PLATFORM(IOS)-guard.
Lines 58-66 public: a/Source/WebCore/dom/DeviceMotionController.h_sec2
58
    static const char* supplementName();
57
    static const char* supplementName();
59
    static DeviceMotionController* from(Page*);
58
    static DeviceMotionController* from(Page*);
60
    static bool isActiveAt(Page*);
59
    static bool isActiveAt(Page*);
61
62
private:
63
    explicit DeviceMotionController(DeviceMotionClient*);
64
};
60
};
65
61
66
} // namespace WebCore
62
} // namespace WebCore
- a/Source/WebCore/dom/DeviceOrientationController.cpp -6 / +1 lines
Lines 49-59 DeviceOrientationController::DeviceOrientationController(DeviceOrientationClient a/Source/WebCore/dom/DeviceOrientationController.cpp_sec1
49
#endif
49
#endif
50
}
50
}
51
51
52
PassOwnPtr<DeviceOrientationController> DeviceOrientationController::create(DeviceOrientationClient* client)
53
{
54
    return adoptPtr(new DeviceOrientationController(client));
55
}
56
57
void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientationData* orientation)
52
void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientationData* orientation)
58
{
53
{
59
    dispatchDeviceEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation));
54
    dispatchDeviceEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation));
Lines 109-115 bool DeviceOrientationController::isActiveAt(Page* page) a/Source/WebCore/dom/DeviceOrientationController.cpp_sec2
109
104
110
void provideDeviceOrientationTo(Page* page, DeviceOrientationClient* client)
105
void provideDeviceOrientationTo(Page* page, DeviceOrientationClient* client)
111
{
106
{
112
    DeviceOrientationController::provideTo(page, DeviceOrientationController::supplementName(), DeviceOrientationController::create(client));
107
    DeviceOrientationController::provideTo(page, DeviceOrientationController::supplementName(), std::make_unique<DeviceOrientationController>(client));
113
}
108
}
114
109
115
} // namespace WebCore
110
} // namespace WebCore
- a/Source/WebCore/dom/DeviceOrientationController.h -5 / +1 lines
Lines 40-49 class Page; a/Source/WebCore/dom/DeviceOrientationController.h_sec1
40
class DeviceOrientationController : public DeviceController {
40
class DeviceOrientationController : public DeviceController {
41
    WTF_MAKE_NONCOPYABLE(DeviceOrientationController);
41
    WTF_MAKE_NONCOPYABLE(DeviceOrientationController);
42
public:
42
public:
43
    explicit DeviceOrientationController(DeviceOrientationClient*);
43
    ~DeviceOrientationController() { };
44
    ~DeviceOrientationController() { };
44
45
45
    static PassOwnPtr<DeviceOrientationController> create(DeviceOrientationClient*);
46
47
    void didChangeDeviceOrientation(DeviceOrientationData*);
46
    void didChangeDeviceOrientation(DeviceOrientationData*);
48
    DeviceOrientationClient* deviceOrientationClient();
47
    DeviceOrientationClient* deviceOrientationClient();
49
48
Lines 60-68 public: a/Source/WebCore/dom/DeviceOrientationController.h_sec2
60
    static const char* supplementName();
59
    static const char* supplementName();
61
    static DeviceOrientationController* from(Page*);
60
    static DeviceOrientationController* from(Page*);
62
    static bool isActiveAt(Page*);
61
    static bool isActiveAt(Page*);
63
64
private:
65
    DeviceOrientationController(DeviceOrientationClient*);
66
};
62
};
67
63
68
} // namespace WebCore
64
} // namespace WebCore
- a/Source/WebCore/page/SpeechInput.cpp -6 / +1 lines
Lines 52-62 SpeechInput::~SpeechInput() a/Source/WebCore/page/SpeechInput.cpp_sec1
52
    m_client->setListener(0);
52
    m_client->setListener(0);
53
}
53
}
54
54
55
PassOwnPtr<SpeechInput> SpeechInput::create(SpeechInputClient* client)
56
{
57
    return adoptPtr(new SpeechInput(client));
58
}
59
60
int SpeechInput::registerListener(SpeechInputListener* listener)
55
int SpeechInput::registerListener(SpeechInputListener* listener)
61
{
56
{
62
#if defined(DEBUG)
57
#if defined(DEBUG)
Lines 124-130 const char* SpeechInput::supplementName() a/Source/WebCore/page/SpeechInput.cpp_sec2
124
119
125
void provideSpeechInputTo(Page* page, SpeechInputClient* client)
120
void provideSpeechInputTo(Page* page, SpeechInputClient* client)
126
{
121
{
127
    SpeechInput::provideTo(page, SpeechInput::supplementName(), SpeechInput::create(client));
122
    SpeechInput::provideTo(page, SpeechInput::supplementName(), std::make_unique<SpeechInput>(client));
128
}
123
}
129
124
130
} // namespace WebCore
125
} // namespace WebCore
- a/Source/WebCore/page/SpeechInput.h -3 / +1 lines
Lines 52-60 class SpeechInput : public SpeechInputListener, a/Source/WebCore/page/SpeechInput.h_sec1
52
                    public Supplement<Page> {
52
                    public Supplement<Page> {
53
    WTF_MAKE_NONCOPYABLE(SpeechInput);
53
    WTF_MAKE_NONCOPYABLE(SpeechInput);
54
public:
54
public:
55
    explicit SpeechInput(SpeechInputClient*);
55
    virtual ~SpeechInput();
56
    virtual ~SpeechInput();
56
57
57
    static PassOwnPtr<SpeechInput> create(SpeechInputClient*);
58
    static const char* supplementName();
58
    static const char* supplementName();
59
    static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(Supplement<Page>::from(page, supplementName())); }
59
    static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(Supplement<Page>::from(page, supplementName())); }
60
60
Lines 77-84 public: a/Source/WebCore/page/SpeechInput.h_sec2
77
    virtual void setRecognitionResult(int, const SpeechInputResultArray&);
77
    virtual void setRecognitionResult(int, const SpeechInputResultArray&);
78
78
79
private:
79
private:
80
    explicit SpeechInput(SpeechInputClient*);
81
82
    SpeechInputClient* m_client;
80
    SpeechInputClient* m_client;
83
    HashMap<int, SpeechInputListener*> m_listeners;
81
    HashMap<int, SpeechInputListener*> m_listeners;
84
    int m_nextListenerId;
82
    int m_nextListenerId;
- a/Source/WebCore/platform/Supplementable.h -5 / +5 lines
Lines 84-92 public: a/Source/WebCore/platform/Supplementable.h_sec1
84
    virtual bool isRefCountedWrapper() const { return false; }
84
    virtual bool isRefCountedWrapper() const { return false; }
85
#endif
85
#endif
86
86
87
    static void provideTo(Supplementable<T>* host, const char* key, PassOwnPtr<Supplement<T>> supplement)
87
    static void provideTo(Supplementable<T>* host, const char* key, std::unique_ptr<Supplement<T>> supplement)
88
    {
88
    {
89
        host->provideSupplement(key, supplement);
89
        host->provideSupplement(key, std::move(supplement));
90
    }
90
    }
91
91
92
    static Supplement<T>* from(Supplementable<T>* host, const char* key)
92
    static Supplement<T>* from(Supplementable<T>* host, const char* key)
Lines 98-108 public: a/Source/WebCore/platform/Supplementable.h_sec2
98
template<typename T>
98
template<typename T>
99
class Supplementable {
99
class Supplementable {
100
public:
100
public:
101
    void provideSupplement(const char* key, PassOwnPtr<Supplement<T>> supplement)
101
    void provideSupplement(const char* key, std::unique_ptr<Supplement<T>> supplement)
102
    {
102
    {
103
        ASSERT(canAccessThreadLocalDataForThread(m_threadId));
103
        ASSERT(canAccessThreadLocalDataForThread(m_threadId));
104
        ASSERT(!m_supplements.get(key));
104
        ASSERT(!m_supplements.get(key));
105
        m_supplements.set(key, supplement);
105
        m_supplements.set(key, std::move(supplement));
106
    }
106
    }
107
107
108
    void removeSupplement(const char* key)
108
    void removeSupplement(const char* key)
Lines 123-129 protected: a/Source/WebCore/platform/Supplementable.h_sec3
123
#endif
123
#endif
124
124
125
private:
125
private:
126
    typedef HashMap<const char*, OwnPtr<Supplement<T>>, PtrHash<const char*>> SupplementMap;
126
    typedef HashMap<const char*, std::unique_ptr<Supplement<T>>, PtrHash<const char*>> SupplementMap;
127
    SupplementMap m_supplements;
127
    SupplementMap m_supplements;
128
#if !ASSERT_DISABLED
128
#if !ASSERT_DISABLED
129
    ThreadIdentifier m_threadId;
129
    ThreadIdentifier m_threadId;
- a/Source/WebCore/testing/InternalSettings.cpp -1 / +1 lines
Lines 176-182 const char* InternalSettings::supplementName() a/Source/WebCore/testing/InternalSettings.cpp_sec1
176
InternalSettings* InternalSettings::from(Page* page)
176
InternalSettings* InternalSettings::from(Page* page)
177
{
177
{
178
    if (!Supplement<Page>::from(page, supplementName()))
178
    if (!Supplement<Page>::from(page, supplementName()))
179
        Supplement<Page>::provideTo(page, supplementName(), adoptPtr(new InternalSettingsWrapper(page)));
179
        Supplement<Page>::provideTo(page, supplementName(), std::make_unique<InternalSettingsWrapper>(page));
180
    return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
180
    return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
181
}
181
}
182
182

Return to Bug 132165