Remove the Timer parameters from timer callbacks
[WebKit-https.git] / Source / WebCore / page / EventSource.h
index 97e7c10..fac7332 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "ActiveDOMObject.h"
 #include "EventTarget.h"
-#include "KURL.h"
+#include "URL.h"
 #include "ThreadableLoaderClient.h"
 #include "Timer.h"
 #include <wtf/RefPtr.h>
@@ -48,11 +48,10 @@ class ResourceResponse;
 class TextResourceDecoder;
 class ThreadableLoader;
 
-// FIXME: This class should be marked FINAL once <http://webkit.org/b/121747> is fixed.
-class EventSource : public RefCounted<EventSource>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject {
+class EventSource final : public RefCounted<EventSource>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<EventSource> create(ScriptExecutionContext*, const String& url, const Dictionary&, ExceptionCode&);
+    static PassRefPtr<EventSource> create(ScriptExecutionContext&, const String& url, const Dictionary&, ExceptionCode&);
     virtual ~EventSource();
 
     static const unsigned long long defaultReconnectDelay;
@@ -76,41 +75,41 @@ public:
     using RefCounted<EventSource>::ref;
     using RefCounted<EventSource>::deref;
 
-    virtual EventTargetInterface eventTargetInterface() const OVERRIDE FINAL { return EventSourceEventTargetInterfaceType; }
-    virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE FINAL { return ActiveDOMObject::scriptExecutionContext(); }
+    virtual EventTargetInterface eventTargetInterface() const override { return EventSourceEventTargetInterfaceType; }
+    virtual ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
 
 private:
-    EventSource(ScriptExecutionContext*, const KURL&, const Dictionary&);
+    EventSource(ScriptExecutionContext&, const URL&, const Dictionary&);
 
-    virtual void refEventTarget() OVERRIDE FINAL { ref(); }
-    virtual void derefEventTarget() OVERRIDE FINAL { deref(); }
+    virtual void refEventTarget() override { ref(); }
+    virtual void derefEventTarget() override { deref(); }
 
-    virtual void didReceiveResponse(unsigned long, const ResourceResponse&);
-    virtual void didReceiveData(const char*, int);
-    virtual void didFinishLoading(unsigned long, double);
-    virtual void didFail(const ResourceError&);
-    virtual void didFailAccessControlCheck(const ResourceError&);
-    virtual void didFailRedirectCheck();
+    virtual void didReceiveResponse(unsigned long, const ResourceResponse&) override;
+    virtual void didReceiveData(const char*, int) override;
+    virtual void didFinishLoading(unsigned long, double) override;
+    virtual void didFail(const ResourceError&) override;
+    virtual void didFailAccessControlCheck(const ResourceError&) override;
+    virtual void didFailRedirectCheck() override;
 
-    virtual void stop() OVERRIDE;
+    virtual void stop() override;
 
     void connect();
     void networkRequestEnded();
     void scheduleInitialConnect();
     void scheduleReconnect();
-    void connectTimerFired(Timer<EventSource>*);
+    void connectTimerFired();
     void abortConnectionAttempt();
     void parseEventStream();
     void parseEventStreamLine(unsigned pos, int fieldLength, int lineLength);
     PassRefPtr<MessageEvent> createMessageEvent();
 
-    KURL m_url;
+    URL m_url;
     bool m_withCredentials;
     State m_state;
 
     RefPtr<TextResourceDecoder> m_decoder;
     RefPtr<ThreadableLoader> m_loader;
-    Timer<EventSource> m_connectTimer;
+    Timer m_connectTimer;
     Vector<UChar> m_receiveBuf;
     bool m_discardTrailingNewline;
     bool m_requestInFlight;