Title: [206396] trunk/Source
Revision
206396
Author
[email protected]
Date
2016-09-26 14:55:34 -0700 (Mon, 26 Sep 2016)

Log Message

Mark Ping{Handle, Load} as final
https://bugs.webkit.org/show_bug.cgi?id=162576

Reviewed by Alex Christensen.

Source/WebCore:

We should not support subclassing of a ping handle or overriding its ResourceHandleClient
callbacks because there are security/privacy implications with a ping request. We should
not encourage subclassing without careful consideration.

* platform/network/PingHandle.h:

Source/WebKit2:

We should not support subclassing of a ping handle or overriding its NetworkDataTaskClient
callbacks because there are security/privacy implications with a ping request. We should
not encourage subclassing without careful consideration.

* NetworkProcess/PingLoad.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206395 => 206396)


--- trunk/Source/WebCore/ChangeLog	2016-09-26 21:51:25 UTC (rev 206395)
+++ trunk/Source/WebCore/ChangeLog	2016-09-26 21:55:34 UTC (rev 206396)
@@ -1,5 +1,18 @@
 2016-09-26  Daniel Bates  <[email protected]>
 
+        Mark Ping{Handle, Load} as final
+        https://bugs.webkit.org/show_bug.cgi?id=162576
+
+        Reviewed by Alex Christensen.
+
+        We should not support subclassing of a ping handle or overriding its ResourceHandleClient
+        callbacks because there are security/privacy implications with a ping request. We should
+        not encourage subclassing without careful consideration.
+
+        * platform/network/PingHandle.h:
+
+2016-09-26  Daniel Bates  <[email protected]>
+
         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
         https://bugs.webkit.org/show_bug.cgi?id=162365
 

Modified: trunk/Source/WebCore/platform/network/PingHandle.h (206395 => 206396)


--- trunk/Source/WebCore/platform/network/PingHandle.h	2016-09-26 21:51:25 UTC (rev 206395)
+++ trunk/Source/WebCore/platform/network/PingHandle.h	2016-09-26 21:55:34 UTC (rev 206396)
@@ -35,7 +35,7 @@
 // The object just needs to live long enough to ensure the message was actually sent.
 // As soon as any callback is received from the ResourceHandle, this class will cancel the load and delete itself.
 
-class PingHandle : private ResourceHandleClient {
+class PingHandle final : private ResourceHandleClient {
     WTF_MAKE_NONCOPYABLE(PingHandle); WTF_MAKE_FAST_ALLOCATED;
 public:
     enum class UsesAsyncCallbacks {
@@ -56,12 +56,12 @@
     }
 
 private:
-    void didReceiveResponse(ResourceHandle*, ResourceResponse&&) override { delete this; }
-    void didReceiveBuffer(ResourceHandle*, Ref<SharedBuffer>&&, int) override { delete this; };
-    void didFinishLoading(ResourceHandle*, double) override { delete this; }
-    void didFail(ResourceHandle*, const ResourceError&) override { delete this; }
-    bool shouldUseCredentialStorage(ResourceHandle*)  override { return m_shouldUseCredentialStorage; }
-    bool usesAsyncCallbacks() override { return m_usesAsyncCallbacks == UsesAsyncCallbacks::Yes; }
+    void didReceiveResponse(ResourceHandle*, ResourceResponse&&) final { delete this; }
+    void didReceiveBuffer(ResourceHandle*, Ref<SharedBuffer>&&, int) final { delete this; };
+    void didFinishLoading(ResourceHandle*, double) final { delete this; }
+    void didFail(ResourceHandle*, const ResourceError&) final { delete this; }
+    bool shouldUseCredentialStorage(ResourceHandle*) final { return m_shouldUseCredentialStorage; }
+    bool usesAsyncCallbacks() final { return m_usesAsyncCallbacks == UsesAsyncCallbacks::Yes; }
     void timeoutTimerFired() { delete this; }
 
     virtual ~PingHandle()

Modified: trunk/Source/WebKit2/ChangeLog (206395 => 206396)


--- trunk/Source/WebKit2/ChangeLog	2016-09-26 21:51:25 UTC (rev 206395)
+++ trunk/Source/WebKit2/ChangeLog	2016-09-26 21:55:34 UTC (rev 206396)
@@ -1,5 +1,18 @@
 2016-09-26  Daniel Bates  <[email protected]>
 
+        Mark Ping{Handle, Load} as final
+        https://bugs.webkit.org/show_bug.cgi?id=162576
+
+        Reviewed by Alex Christensen.
+
+        We should not support subclassing of a ping handle or overriding its NetworkDataTaskClient
+        callbacks because there are security/privacy implications with a ping request. We should
+        not encourage subclassing without careful consideration.
+
+        * NetworkProcess/PingLoad.h:
+
+2016-09-26  Daniel Bates  <[email protected]>
+
         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
         https://bugs.webkit.org/show_bug.cgi?id=162365
 

Modified: trunk/Source/WebKit2/NetworkProcess/PingLoad.h (206395 => 206396)


--- trunk/Source/WebKit2/NetworkProcess/PingLoad.h	2016-09-26 21:51:25 UTC (rev 206395)
+++ trunk/Source/WebKit2/NetworkProcess/PingLoad.h	2016-09-26 21:55:34 UTC (rev 206396)
@@ -31,7 +31,7 @@
 
 namespace WebKit {
 
-class PingLoad : public NetworkDataTaskClient {
+class PingLoad final : public NetworkDataTaskClient {
 public:
     PingLoad(const NetworkResourceLoadParameters& parameters)
         : m_timeoutTimer(*this, &PingLoad::timeoutTimerFired)
@@ -48,27 +48,27 @@
     }
     
 private:
-    void willPerformHTTPRedirection(WebCore::ResourceResponse&&, WebCore::ResourceRequest&&, RedirectCompletionHandler&& completionHandler) override
+    void willPerformHTTPRedirection(WebCore::ResourceResponse&&, WebCore::ResourceRequest&&, RedirectCompletionHandler&& completionHandler) final
     {
         completionHandler({ });
         delete this;
     }
-    void didReceiveChallenge(const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&& completionHandler) override
+    void didReceiveChallenge(const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&& completionHandler) final
     {
         completionHandler(AuthenticationChallengeDisposition::Cancel, { });
         delete this;
     }
-    void didReceiveResponseNetworkSession(WebCore::ResourceResponse&&, ResponseCompletionHandler&& completionHandler) override
+    void didReceiveResponseNetworkSession(WebCore::ResourceResponse&&, ResponseCompletionHandler&& completionHandler) final
     {
         completionHandler(WebCore::PolicyAction::PolicyIgnore);
         delete this;
     }
-    void didReceiveData(Ref<WebCore::SharedBuffer>&&)  override { ASSERT_NOT_REACHED(); }
-    void didCompleteWithError(const WebCore::ResourceError&) override { delete this; }
-    void didBecomeDownload() override { ASSERT_NOT_REACHED(); }
-    void didSendData(uint64_t totalBytesSent, uint64_t totalBytesExpectedToSend) override { }
-    void wasBlocked() override { delete this; }
-    void cannotShowURL() override { delete this; }
+    void didReceiveData(Ref<WebCore::SharedBuffer>&&) final { ASSERT_NOT_REACHED(); }
+    void didCompleteWithError(const WebCore::ResourceError&) final { delete this; }
+    void didBecomeDownload() final { ASSERT_NOT_REACHED(); }
+    void didSendData(uint64_t totalBytesSent, uint64_t totalBytesExpectedToSend) final { }
+    void wasBlocked() final { delete this; }
+    void cannotShowURL() final { delete this; }
 
     void timeoutTimerFired() { delete this; }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to