Clean up ScriptExecutionContext::Task and subclasses
[WebKit-https.git] / Source / WebCore / loader / appcache / ApplicationCacheGroup.cpp
index 7357b45..482264b 100644 (file)
@@ -1119,11 +1119,15 @@ void ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback()
 
 class CallCacheListenerTask : public ScriptExecutionContext::Task {
 public:
-    static PassOwnPtr<CallCacheListenerTask> create(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID, int progressTotal, int progressDone)
+    CallCacheListenerTask(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID, int progressTotal, int progressDone)
+        : m_documentLoader(loader)
+        , m_eventID(eventID)
+        , m_progressTotal(progressTotal)
+        , m_progressDone(progressDone)
     {
-        return adoptPtr(new CallCacheListenerTask(loader, eventID, progressTotal, progressDone));
     }
 
+private:
     virtual void performTask(ScriptExecutionContext* context) OVERRIDE
     {
         
@@ -1137,15 +1141,6 @@ public:
         m_documentLoader->applicationCacheHost()->notifyDOMApplicationCache(m_eventID, m_progressTotal, m_progressDone);
     }
 
-private:
-    CallCacheListenerTask(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID, int progressTotal, int progressDone)
-        : m_documentLoader(loader)
-        , m_eventID(eventID)
-        , m_progressTotal(progressTotal)
-        , m_progressDone(progressDone)
-    {
-    }
-
     RefPtr<DocumentLoader> m_documentLoader;
     ApplicationCacheHost::EventID m_eventID;
     int m_progressTotal;
@@ -1167,7 +1162,7 @@ void ApplicationCacheGroup::postListenerTask(ApplicationCacheHost::EventID event
     
     ASSERT(frame->loader().documentLoader() == loader);
 
-    frame->document()->postTask(CallCacheListenerTask::create(loader, eventID, progressTotal, progressDone));
+    frame->document()->postTask(std::make_unique<CallCacheListenerTask>(loader, eventID, progressTotal, progressDone));
 }
 
 void ApplicationCacheGroup::setUpdateStatus(UpdateStatus status)