Clean up ScriptExecutionContext::Task and subclasses
[WebKit-https.git] / Source / WebCore / dom / StringCallback.cpp
index c6285b1..5475360 100644 (file)
@@ -40,21 +40,16 @@ namespace {
 
 class DispatchCallbackTask : public ScriptExecutionContext::Task {
 public:
-    static PassOwnPtr<DispatchCallbackTask> create(PassRefPtr<StringCallback> callback, const String& data)
+    DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data)
+        : m_callback(callback)
+        , m_data(data)
     {
-        return adoptPtr(new DispatchCallbackTask(callback, data));
-    }
-
-    virtual void performTask(ScriptExecutionContext*)
-    {
-        m_callback->handleEvent(m_data);
     }
 
 private:
-    DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data)
-        : m_callback(callback)
-        , m_data(data)
+    virtual void performTask(ScriptExecutionContext*) OVERRIDE
     {
+        m_callback->handleEvent(m_data);
     }
 
     RefPtr<StringCallback> m_callback;
@@ -65,7 +60,7 @@ private:
 
 void StringCallback::scheduleCallback(ScriptExecutionContext* context, const String& data)
 {
-    context->postTask(DispatchCallbackTask::create(this, data));
+    context->postTask(std::make_unique<DispatchCallbackTask>(this, data));
 }
 
 } // namespace WebCore