[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at chromium.org darin at chromium.org
Thu Apr 8 00:29:25 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit cdf4923f03910414f3ffd33df4e8c6ffc18feab8
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 9 21:36:59 2009 +0000

    2009-12-09  Darin Fisher  <darin at chromium.org>
    
            Reviewed by Eric Seidel.
    
            https://bugs.webkit.org/show_bug.cgi?id=32324
            [Chromium] Suppress WebFrameClient callbacks from a detached frame.
    
            This change means that we no longer need the ClientHandle class.
            FrameLoaderClient::detachedFromParent3() is called on each frame
            in the frame tree from within frameDetached().
    
            Test: http/tests/loading/gmail-assert-on-load.html
    
            * src/FrameLoaderClientImpl.cpp:
            (WebKit::FrameLoaderClientImpl::detachedFromParent3):
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::create):
            (WebKit::WebFrameImpl::WebFrameImpl):
            (WebKit::WebFrameImpl::createChildFrame):
            * src/WebFrameImpl.h:
            (WebKit::WebFrameImpl::client):
            (WebKit::WebFrameImpl::dropClient):
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::close):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51917 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3202b34..70e96c1 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,28 @@
+2009-12-09  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32324
+        [Chromium] Suppress WebFrameClient callbacks from a detached frame.
+
+        This change means that we no longer need the ClientHandle class.
+        FrameLoaderClient::detachedFromParent3() is called on each frame
+        in the frame tree from within frameDetached().
+
+        Test: http/tests/loading/gmail-assert-on-load.html
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::create):
+        (WebKit::WebFrameImpl::WebFrameImpl):
+        (WebKit::WebFrameImpl::createChildFrame):
+        * src/WebFrameImpl.h:
+        (WebKit::WebFrameImpl::client):
+        (WebKit::WebFrameImpl::dropClient):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::close):
+
 2009-12-08  Stuart Morgan  <stuartmorgan at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 24b086f..2943bd7 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -216,6 +216,10 @@ void FrameLoaderClientImpl::detachedFromParent3()
     // go to a page and then navigate to a new page without getting any asserts
     // or crashes.
     m_webFrame->frame()->script()->proxy()->clearForClose();
+    
+    // Stop communicating with the WebFrameClient at this point since we are no
+    // longer associated with the Page.
+    m_webFrame->dropClient();
 }
 
 // This function is responsible for associating the |identifier| with a given
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 4506696..ab6769f 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1462,12 +1462,12 @@ int WebFrameImpl::m_liveObjectCount = 0;
 
 PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
 {
-    return adoptRef(new WebFrameImpl(ClientHandle::create(client)));
+    return adoptRef(new WebFrameImpl(client));
 }
 
-WebFrameImpl::WebFrameImpl(PassRefPtr<ClientHandle> clientHandle)
+WebFrameImpl::WebFrameImpl(WebFrameClient* client)
     : m_frameLoaderClient(this)
-    , m_clientHandle(clientHandle)
+    , m_client(client)
     , m_activeMatchFrame(0)
     , m_activeMatchIndex(-1)
     , m_locatingActiveRect(false)
@@ -1508,7 +1508,7 @@ void WebFrameImpl::initializeAsMainFrame(WebViewImpl* webViewImpl)
 PassRefPtr<Frame> WebFrameImpl::createChildFrame(
     const FrameLoadRequest& request, HTMLFrameOwnerElement* ownerElement)
 {
-    RefPtr<WebFrameImpl> webframe(adoptRef(new WebFrameImpl(m_clientHandle)));
+    RefPtr<WebFrameImpl> webframe(adoptRef(new WebFrameImpl(m_client)));
 
     // Add an extra ref on behalf of the Frame/FrameLoader, which references the
     // WebFrame via the FrameLoaderClient interface. See the comment at the top
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index 050675b..2cd332a 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -211,30 +211,14 @@ public:
     // be kept around as it is deleted when the page goes away.
     WebPasswordAutocompleteListener* getPasswordListener(WebCore::HTMLInputElement*);
 
-    WebFrameClient* client() const { return m_clientHandle->client(); }
-    void dropClient() { m_clientHandle->dropClient(); }
+    WebFrameClient* client() const { return m_client; }
+    void dropClient() { m_client = 0; }
 
 private:
     class DeferredScopeStringMatches;
     friend class DeferredScopeStringMatches;
     friend class FrameLoaderClientImpl;
 
-    // A weak reference to the WebFrameClient.  Each WebFrame in the hierarchy
-    // owns a reference to a ClientHandle.  When the main frame is destroyed, it
-    // clears the WebFrameClient.
-    class ClientHandle : public RefCounted<ClientHandle> {
-    public:
-        static PassRefPtr<ClientHandle> create(WebFrameClient* client)
-        {
-            return adoptRef(new ClientHandle(client));
-        }
-        WebFrameClient* client() { return m_client; }
-        void dropClient() { m_client = 0; }
-    private:
-        ClientHandle(WebFrameClient* client) : m_client(client) {}
-        WebFrameClient* m_client;
-    };
-
     // A bit mask specifying area of the frame to invalidate.
     enum AreaToInvalidate {
       InvalidateNothing,
@@ -243,7 +227,7 @@ private:
       InvalidateAll          // Both content area and the scrollbar.
     };
 
-    WebFrameImpl(PassRefPtr<ClientHandle>);
+    WebFrameImpl(WebFrameClient*);
 
     // Informs the WebFrame that the Frame is being closed, called by the
     // WebFrameLoaderClient
@@ -297,7 +281,7 @@ private:
 
     FrameLoaderClientImpl m_frameLoaderClient;
 
-    RefPtr<ClientHandle> m_clientHandle;
+    WebFrameClient* m_client;
 
     // This is a weak pointer to our corresponding WebCore frame.  A reference to
     // ourselves is held while frame_ is valid.  See our Closing method.
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 8ec8c0b..357cdca 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -787,11 +787,6 @@ void WebViewImpl::close()
     if (m_devToolsAgent.get())
         m_devToolsAgent.clear();
 
-    // We drop the client after the page has been destroyed to support the
-    // WebFrameClient::didDestroyScriptContext method.
-    if (mainFrameImpl)
-        mainFrameImpl->dropClient();
-
     // Reset the delegate to prevent notifications being sent as we're being
     // deleted.
     m_client = 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list