Remove WebFramePolicyListenerProxy::invalidate
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2018 17:25:25 +0000 (17:25 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2018 17:25:25 +0000 (17:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187833

Reviewed by Dean Jackson.

When we're invalidating the listener, calling ignore instead will at worst cause
an ignored message to be sent.  The load will be cancelled either way.
Removing the invalidate method gets it closer to being a lambda.

* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::invalidate): Deleted.
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::webProcessWillShutDown):
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234153 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp
Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h
Source/WebKit/UIProcess/WebFrameProxy.cpp

index 40035e7..47f0a70 100644 (file)
@@ -1,3 +1,21 @@
+2018-07-24  Alex Christensen  <achristensen@webkit.org>
+
+        Remove WebFramePolicyListenerProxy::invalidate
+        https://bugs.webkit.org/show_bug.cgi?id=187833
+
+        Reviewed by Dean Jackson.
+
+        When we're invalidating the listener, calling ignore instead will at worst cause
+        an ignored message to be sent.  The load will be cancelled either way.
+        Removing the invalidate method gets it closer to being a lambda.
+
+        * UIProcess/WebFramePolicyListenerProxy.cpp:
+        (WebKit::WebFramePolicyListenerProxy::invalidate): Deleted.
+        * UIProcess/WebFramePolicyListenerProxy.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::webProcessWillShutDown):
+        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
+
 2018-07-24  Chris Dumez  <cdumez@apple.com>
 
         WebFullScreenManagerProxy does not need to be ref counted
index 14cc5ad..ef50472 100644 (file)
@@ -57,11 +57,6 @@ void WebFramePolicyListenerProxy::changeWebsiteDataStore(WebsiteDataStore& websi
     m_frame->changeWebsiteDataStore(websiteDataStore);
 }
 
-void WebFramePolicyListenerProxy::invalidate()
-{
-    m_frame = nullptr;
-}
-
 bool WebFramePolicyListenerProxy::isMainFrame() const
 {
     if (!m_frame)
index 2130186..6153c26 100644 (file)
@@ -68,7 +68,6 @@ public:
     uint64_t listenerID() const { return m_listenerID; }
     
     void setNavigation(Ref<API::Navigation>&&);
-    void invalidate();
     
     void changeWebsiteDataStore(WebsiteDataStore&);
     bool isMainFrame() const;
index 4712c6b..4a778c4 100644 (file)
@@ -65,7 +65,7 @@ void WebFrameProxy::webProcessWillShutDown()
     m_page = nullptr;
 
     if (m_activeListener) {
-        m_activeListener->invalidate();
+        m_activeListener->ignore();
         m_activeListener = nullptr;
     }
 }
@@ -191,7 +191,7 @@ void WebFrameProxy::receivedPolicyDecision(PolicyAction action, uint64_t listene
 WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(uint64_t listenerID, PolicyListenerType policyListenerType)
 {
     if (m_activeListener)
-        m_activeListener->invalidate();
+        m_activeListener->ignore();
     m_activeListener = WebFramePolicyListenerProxy::create(this, listenerID, policyListenerType);
     return *static_cast<WebFramePolicyListenerProxy*>(m_activeListener.get());
 }