| Differences between
and this patch
- a/Source/WebCore/ChangeLog +80 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-04-25  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-25  Andreas Kling  <akling@apple.com>
81
2014-04-25  Andreas Kling  <akling@apple.com>
2
82
3
        Remove two unused SVGDocument functions.
83
        Remove two unused SVGDocument functions.
- a/Source/WebCore/Modules/battery/BatteryController.cpp -1 / +1 lines
Lines 102-108 const char* BatteryController::supplementName() a/Source/WebCore/Modules/battery/BatteryController.cpp_sec1
102
102
103
void provideBatteryTo(Page* page, BatteryClient* client)
103
void provideBatteryTo(Page* page, BatteryClient* client)
104
{
104
{
105
    Supplement<Page>::provideTo(page, BatteryController::supplementName(), BatteryController::create(client));
105
    Supplement<Page>::provideTo(page, BatteryController::supplementName(), std::make_unique<BatteryController>(client));
106
}
106
}
107
107
108
}
108
}
- a/Source/WebCore/Modules/battery/BatteryController.h -3 / +2 lines
Lines 32-40 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
    // static PassOwnPtr<BatteryController> create(BatteryClient*);
38
39
39
    void addListener(BatteryManager*);
40
    void addListener(BatteryManager*);
40
    void removeListener(BatteryManager*);
41
    void removeListener(BatteryManager*);
Lines 47-54 public: a/Source/WebCore/Modules/battery/BatteryController.h_sec2
47
private:
48
private:
48
    typedef Vector<BatteryManager*> ListenerVector;
49
    typedef Vector<BatteryManager*> ListenerVector;
49
50
50
    explicit BatteryController(BatteryClient*);
51
52
    BatteryClient* m_client;
51
    BatteryClient* m_client;
53
    ListenerVector m_listeners;
52
    ListenerVector m_listeners;
54
53
- a/Source/WebCore/Modules/battery/NavigatorBattery.cpp -3 / +3 lines
Lines 54-63 const char* NavigatorBattery::supplementName() a/Source/WebCore/Modules/battery/NavigatorBattery.cpp_sec1
54
54
55
NavigatorBattery* NavigatorBattery::from(Navigator* navigator)
55
NavigatorBattery* NavigatorBattery::from(Navigator* navigator)
56
{
56
{
57
    NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, supplementName()));
57
    auto supplement = Supplement<Navigator>::from(navigator, supplementName());
58
    if (!supplement) {
58
    if (!supplement) {
59
        supplement = new NavigatorBattery();
59
        supplement = std::make_unique<NavigatorBattery>();
60
        provideTo(navigator, supplementName(), adoptPtr(supplement));
60
        provideTo(navigator, supplementName(), std::move(supplement));
61
    }
61
    }
62
    return supplement;
62
    return supplement;
63
}
63
}
- a/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp -3 / +3 lines
Lines 50-59 const char* NavigatorGamepad::supplementName() a/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp_sec1
50
50
51
NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator)
51
NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator)
52
{
52
{
53
    NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName()));
53
    auto supplement = Supplement<NavigatorGamepad>::from(navigator, supplementName());
54
    if (!supplement) {
54
    if (!supplement) {
55
        supplement = new NavigatorGamepad();
55
        supplement = std::make_unique<NavigatorGamepad>();
56
        provideTo(navigator, supplementName(), adoptPtr(supplement));
56
        provideTo(navigator, supplementName(), std::move(supplement));
57
    }
57
    }
58
    return supplement;
58
    return supplement;
59
}
59
}
- 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 -3 / +3 lines
Lines 49-58 const char* NavigatorGeolocation::supplementName() a/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp_sec1
49
49
50
NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator)
50
NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator)
51
{
51
{
52
    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
52
    auto supplement = Supplement<NavigatorGeolocation>::from(navigator, supplementName());
53
    if (!supplement) {
53
    if (!supplement) {
54
        supplement = new NavigatorGeolocation(navigator->frame());
54
        supplement = std::make_unique<NavigatorGeolocation>();
55
        provideTo(navigator, supplementName(), adoptPtr(supplement));
55
        provideTo(navigator, supplementName(), std::move(supplement));
56
    }
56
    }
57
    return supplement;
57
    return supplement;
58
}
58
}
- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp -3 / +3 lines
Lines 54-63 const char* DOMWindowIndexedDatabase::supplementName() a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp_sec1
54
54
55
DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
55
DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
56
{
56
{
57
    DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, supplementName()));
57
    auto supplement = Supplement<DOMWindow>::from(window, supplementName());
58
    if (!supplement) {
58
    if (!supplement) {
59
        supplement = new DOMWindowIndexedDatabase(window);
59
        supplement = std::make_unique<DOMWindowIndexedDatabase>();
60
        provideTo(window, supplementName(), adoptPtr(supplement));
60
        provideTo(window, supplementName(), std::move(supplement));
61
    }
61
    }
62
    return supplement;
62
    return supplement;
63
}
63
}
- a/Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp -3 / +3 lines
Lines 50-59 const char* PageGroupIndexedDatabase::supplementName() a/Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp_sec1
50
50
51
PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)
51
PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)
52
{
52
{
53
    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, supplementName()));
53
    auto supplement = Supplement<PageGroup>::from(&group, supplementName());
54
    if (!supplement) {
54
    if (!supplement) {
55
        supplement = new PageGroupIndexedDatabase(group.groupSettings().indexedDBDatabasePath());
55
        supplement = std::make_unique<PageGroupIndexedDatabase>();
56
        provideTo(&group, supplementName(), adoptPtr(supplement));
56
        provideTo(&group, supplementName(), std::move(supplement));
57
    }
57
    }
58
    return supplement;
58
    return supplement;
59
}
59
}
- a/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp -3 / +3 lines
Lines 54-68 const char* WorkerGlobalScopeIndexedDatabase::supplementName() a/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp_sec1
54
54
55
WorkerGlobalScopeIndexedDatabase* WorkerGlobalScopeIndexedDatabase::from(ScriptExecutionContext* context)
55
WorkerGlobalScopeIndexedDatabase* WorkerGlobalScopeIndexedDatabase::from(ScriptExecutionContext* context)
56
{
56
{
57
    WorkerGlobalScopeIndexedDatabase* supplement = static_cast<WorkerGlobalScopeIndexedDatabase*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
57
    auto supplement = Supplement<ScriptExecutionContext>::from(context, supplementName());
58
    if (!supplement) {
58
    if (!supplement) {
59
        String databaseDirectoryIdentifier;
59
        String databaseDirectoryIdentifier;
60
        const GroupSettings* groupSettings = toWorkerGlobalScope(context)->groupSettings();
60
        const GroupSettings* groupSettings = toWorkerGlobalScope(context)->groupSettings();
61
        if (groupSettings)
61
        if (groupSettings)
62
            databaseDirectoryIdentifier = groupSettings->indexedDBDatabasePath();
62
            databaseDirectoryIdentifier = groupSettings->indexedDBDatabasePath();
63
63
64
        supplement = new WorkerGlobalScopeIndexedDatabase(databaseDirectoryIdentifier);
64
        supplement = std::make_unique<WorkerGlobalScopeIndexedDatabase>(databaseDirectoryIdentifier);
65
        provideTo(context, supplementName(), adoptPtr(supplement));
65
        provideTo(context, supplementName(), std::move(supplement));
66
    }
66
    }
67
    return supplement;
67
    return supplement;
68
}
68
}
- 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 -3 / +3 lines
Lines 54-63 const char* DOMWindowNotifications::supplementName() a/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp_sec1
54
54
55
DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
55
DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
56
{
56
{
57
    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName()));
57
    auto supplement = Supplement<DOMWindow>::from(window, supplementName());
58
    if (!supplement) {
58
    if (!supplement) {
59
        supplement = new DOMWindowNotifications(window);
59
        supplement = std::make_unique<DOMWindowNotifications>(window);
60
        Supplement<DOMWindow>::provideTo(window, supplementName(), adoptPtr(supplement));
60
        provideTo(window, supplementName(), std::move(supplement));
61
    }
61
    }
62
    return supplement;
62
    return supplement;
63
}
63
}
- 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 -3 / +3 lines
Lines 52-61 const char* WorkerGlobalScopeNotifications::supplementName() a/Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp_sec1
52
52
53
WorkerGlobalScopeNotifications* WorkerGlobalScopeNotifications::from(WorkerGlobalScope* context)
53
WorkerGlobalScopeNotifications* WorkerGlobalScopeNotifications::from(WorkerGlobalScope* context)
54
{
54
{
55
    WorkerGlobalScopeNotifications* supplement = static_cast<WorkerGlobalScopeNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
55
    auto supplement = Supplement<ScriptExecutionContext>::from(context, supplementName());
56
    if (!supplement) {
56
    if (!supplement) {
57
        supplement = new WorkerGlobalScopeNotifications(context);
57
        supplement = std::make_unique<WorkerGlobalScopeNotifications>(context);
58
        Supplement<ScriptExecutionContext>::provideTo(context, supplementName(), adoptPtr(supplement));
58
        provideTo(context, supplementName(), std::move(supplement));
59
    }
59
    }
60
    return supplement;
60
    return supplement;
61
}
61
}
- 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 -3 / +3 lines
Lines 58-67 const char* DOMWindowQuota::supplementName() a/Source/WebCore/Modules/quota/DOMWindowQuota.cpp_sec1
58
// static
58
// static
59
DOMWindowQuota* DOMWindowQuota::from(DOMWindow* window)
59
DOMWindowQuota* DOMWindowQuota::from(DOMWindow* window)
60
{
60
{
61
    DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<DOMWindow>::from(window, supplementName()));
61
    auto supplement = Supplement<DOMWindow>::from(window, supplementName());
62
    if (!supplement) {
62
    if (!supplement) {
63
        supplement = new DOMWindowQuota(window);
63
        supplement = std::make_unique<DOMWindowQuota>(window);
64
        provideTo(window, supplementName(), adoptPtr(supplement));
64
        provideTo(window, supplementName(), std::move(supplement));
65
    }
65
    }
66
    return supplement;
66
    return supplement;
67
}
67
}
- a/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp -3 / +3 lines
Lines 55-64 const char* NavigatorStorageQuota::supplementName() a/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp_sec1
55
55
56
NavigatorStorageQuota* NavigatorStorageQuota::from(Navigator* navigator)
56
NavigatorStorageQuota* NavigatorStorageQuota::from(Navigator* navigator)
57
{
57
{
58
    NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Supplement<Navigator>::from(navigator, supplementName()));
58
    auto supplement = Supplement<DOMWindow>::from(navigator, supplementName());
59
    if (!supplement) {
59
    if (!supplement) {
60
        supplement = new NavigatorStorageQuota(navigator->frame());
60
        supplement = std::make_unique<NavigatorStorageQuota>(window);
61
        provideTo(navigator, supplementName(), adoptPtr(supplement));
61
        provideTo(navigator, supplementName(), std::move(supplement));
62
    }
62
    }
63
    return supplement;
63
    return supplement;
64
}
64
}
- a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp -3 / +3 lines
Lines 53-62 const char* WorkerNavigatorStorageQuota::supplementName() a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp_sec1
53
53
54
WorkerNavigatorStorageQuota* WorkerNavigatorStorageQuota::from(WorkerNavigator* navigator)
54
WorkerNavigatorStorageQuota* WorkerNavigatorStorageQuota::from(WorkerNavigator* navigator)
55
{
55
{
56
    WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorageQuota*>(Supplement<WorkerNavigator>::from(navigator, supplementName()));
56
    auto supplement = Supplement<DOMWindow>::from(navigator, supplementName());
57
    if (!supplement) {
57
    if (!supplement) {
58
        supplement = new WorkerNavigatorStorageQuota();
58
        supplement = std::make_unique<WorkerNavigatorStorageQuota>(window);
59
        provideTo(navigator, supplementName(), adoptPtr(supplement));
59
        provideTo(navigator, supplementName(), std::move(supplement));
60
    }
60
    }
61
    return supplement;
61
    return supplement;
62
}
62
}
- a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp -3 / +3 lines
Lines 55-64 const char* DOMWindowSpeechSynthesis::supplementName() a/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp_sec1
55
// static
55
// static
56
DOMWindowSpeechSynthesis* DOMWindowSpeechSynthesis::from(DOMWindow* window)
56
DOMWindowSpeechSynthesis* DOMWindowSpeechSynthesis::from(DOMWindow* window)
57
{
57
{
58
    DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(Supplement<DOMWindow>::from(window, supplementName()));
58
    auto supplement = Supplement<DOMWindow>::from(window, supplementName());
59
    if (!supplement) {
59
    if (!supplement) {
60
        supplement = new DOMWindowSpeechSynthesis(window);
60
        supplement = std::make_unique<DOMWindowSpeechSynthesis>(window);
61
        provideTo(window, supplementName(), adoptPtr(supplement));
61
        provideTo(window, supplementName(), std::move(supplement));
62
    }
62
    }
63
    return supplement;
63
    return supplement;
64
}
64
}
- 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 -3 / +3 lines
Lines 84-90 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, supplement);
90
    }
90
    }
Lines 98-104 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));
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