[WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWi...
[WebKit-https.git] / Source / WebCore / Modules / notifications / Notification.cpp
index cc6aae2..0ebaff8 100644 (file)
 #include "NotificationController.h"
 #include "NotificationPermissionCallback.h"
 #include "WindowFocusAllowedIndicator.h"
+#include <wtf/IsoMallocInlines.h>
 
 namespace WebCore {
 
+WTF_MAKE_ISO_ALLOCATED_IMPL(Notification);
+
 Ref<Notification> Notification::create(Document& context, const String& title, const Options& options)
 {
     auto notification = adoptRef(*new Notification(context, title, options));
@@ -53,14 +56,14 @@ Ref<Notification> Notification::create(Document& context, const String& title, c
 }
 
 Notification::Notification(Document& document, const String& title, const Options& options)
-    : ActiveDOMObject(&document)
+    : ActiveDOMObject(document)
     , m_title(title)
     , m_direction(options.dir)
     , m_lang(options.lang)
     , m_body(options.body)
     , m_tag(options.tag)
     , m_state(Idle)
-    , m_taskTimer(std::make_unique<Timer>([this] () { show(); }))
+    , m_taskTimer(makeUnique<Timer>([this] () { show(); }))
 {
     if (!options.icon.isEmpty()) {
         auto iconURL = document.completeURL(options.icon);