[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 13:43:16 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2ae60f8e932970108aecabec803b98509e69a64a
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 24 00:21:17 2010 +0000

    WebKit2 API: Need way to know when a frame is removed from the hierarchy
    <rdar://problem/8414062>
    https://bugs.webkit.org/show_bug.cgi?id=46432
    
    Reviewed by Anders Carlsson.
    
    WebKit2:
    
    * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
    * UIProcess/API/C/WKPage.h:
    * UIProcess/WebLoaderClient.cpp:
    (WebKit::WebLoaderClient::didRemoveFrameFromHierarchy):
    * UIProcess/WebLoaderClient.h:
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::didReceiveMessage):
    (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
    * UIProcess/WebPageProxy.h:
    * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
    * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
    (WebKit::InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy):
    * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::detachedFromParent2):
    (WebKit::WebFrameLoaderClient::didTransferChildFrameToNewDocument):
    
    WebKitTools:
    
    * MiniBrowser/mac/BrowserWindowController.m:
    (didRemoveFrameFromHierarchy):
    (-[BrowserWindowController awakeFromNib]):
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::InjectedBundlePage::InjectedBundlePage):
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::initialize):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68220 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 71bf748..354efb9 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,28 @@
+2010-09-23  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        WebKit2 API: Need way to know when a frame is removed from the hierarchy
+        <rdar://problem/8414062>
+        https://bugs.webkit.org/show_bug.cgi?id=46432
+
+        * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/WebLoaderClient.cpp:
+        (WebKit::WebLoaderClient::didRemoveFrameFromHierarchy):
+        * UIProcess/WebLoaderClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didReceiveMessage):
+        (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
+        (WebKit::InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy):
+        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::detachedFromParent2):
+        (WebKit::WebFrameLoaderClient::didTransferChildFrameToNewDocument):
+
 2010-09-23  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h b/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
index 138c569..4bf4345 100644
--- a/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
+++ b/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
@@ -60,6 +60,7 @@ enum Kind {
     DidReceiveEvent,
     DidReceiveServerRedirectForProvisionalLoadForFrame,
     DidReceiveTitleForFrame,
+    DidRemoveFrameFromHierarchy,
     DidRunJavaScriptInMainFrame,
     DidSetFrame,
     DidStartProgress,
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index 03f7d07..042662f 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -75,6 +75,7 @@ typedef void (*WKPageDidFailLoadWithErrorForFrameCallback)(WKPageRef page, WKFra
 typedef void (*WKPageDidReceiveTitleForFrameCallback)(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
 typedef void (*WKPageDidFirstLayoutForFrame)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
 typedef void (*WKPageDidFirstVisuallyNonEmptyLayoutForFrame)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
+typedef void (*WKPageDidRemoveFrameFromHierarchyCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
 
 // Progress Client
 typedef void (*WKPageDidStartProgressCallback)(WKPageRef page, const void *clientInfo);
@@ -102,6 +103,7 @@ struct WKPageLoaderClient {
     WKPageDidReceiveTitleForFrameCallback                               didReceiveTitleForFrame;
     WKPageDidFirstLayoutForFrame                                        didFirstLayoutForFrame;
     WKPageDidFirstVisuallyNonEmptyLayoutForFrame                        didFirstVisuallyNonEmptyLayoutForFrame;
+    WKPageDidRemoveFrameFromHierarchyCallback                           didRemoveFrameFromHierarchy;
 
     // FIXME: Move to progress client.
     WKPageDidStartProgressCallback                                      didStartProgress;
diff --git a/WebKit2/UIProcess/WebLoaderClient.cpp b/WebKit2/UIProcess/WebLoaderClient.cpp
index a6c4d86..f4c5895 100644
--- a/WebKit2/UIProcess/WebLoaderClient.cpp
+++ b/WebKit2/UIProcess/WebLoaderClient.cpp
@@ -123,6 +123,14 @@ void WebLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy* page,
     m_pageLoaderClient.didFirstVisuallyNonEmptyLayoutForFrame(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
 }
 
+void WebLoaderClient::didRemoveFrameFromHierarchy(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
+{
+    if (!m_pageLoaderClient.didRemoveFrameFromHierarchy)
+        return;
+
+    m_pageLoaderClient.didRemoveFrameFromHierarchy(toRef(page), toRef(frame), toRef(userData), m_pageLoaderClient.clientInfo);
+}
+
 void WebLoaderClient::didStartProgress(WebPageProxy* page)
 {
     if (!m_pageLoaderClient.didStartProgress)
diff --git a/WebKit2/UIProcess/WebLoaderClient.h b/WebKit2/UIProcess/WebLoaderClient.h
index ed4afb0..2f5174e 100644
--- a/WebKit2/UIProcess/WebLoaderClient.h
+++ b/WebKit2/UIProcess/WebLoaderClient.h
@@ -50,6 +50,7 @@ public:
     void didReceiveTitleForFrame(WebPageProxy*, const String&, WebFrameProxy*, APIObject*);
     void didFirstLayoutForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
     void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
+    void didRemoveFrameFromHierarchy(WebPageProxy*, WebFrameProxy*, APIObject*);
 
     void didStartProgress(WebPageProxy*);
     void didChangeProgress(WebPageProxy*);
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index c827053..8c7fea0 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -685,6 +685,18 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
             didFirstVisuallyNonEmptyLayoutForFrame(process()->webFrame(frameID), userData.get());
             break;
         }
+        case WebPageProxyMessage::DidRemoveFrameFromHierarchy: {
+            uint64_t frameID;
+
+            RefPtr<APIObject> userData;
+            WebContextUserMessageDecoder messageDecoder(userData, pageNamespace()->context());
+
+            if (!arguments->decode(CoreIPC::Out(frameID, messageDecoder)))
+                return;
+
+            didRemoveFrameFromHierarchy(process()->webFrame(frameID), userData.get());
+            break;
+        }
         case WebPageProxyMessage::DidStartProgress:
             didStartProgress();
             break;
@@ -1061,6 +1073,11 @@ void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(WebFrameProxy* frame,
     m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData);
 }
 
+void WebPageProxy::didRemoveFrameFromHierarchy(WebFrameProxy* frame, APIObject* userData)
+{
+    m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData);
+}
+
 // PolicyClient
 
 void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy* frame, NavigationType navigationType, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, const String& url, uint64_t listenerID)
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 3256743..91635eb 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -222,6 +222,7 @@ private:
     void didReceiveTitleForFrame(WebFrameProxy*, const String&, APIObject*);
     void didFirstLayoutForFrame(WebFrameProxy*, APIObject*);
     void didFirstVisuallyNonEmptyLayoutForFrame(WebFrameProxy*, APIObject*);
+    void didRemoveFrameFromHierarchy(WebFrameProxy*, APIObject*);
     void didStartProgress();
     void didChangeProgress(double);
     void didFinishProgress();
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 1c9f647..f3aa83b 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -75,6 +75,7 @@ typedef void (*WKBundlePageDidFailLoadWithErrorForFrameCallback)(WKBundlePageRef
 typedef void (*WKBundlePageDidReceiveTitleForFrameCallback)(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
 typedef void (*WKBundlePageDidFirstLayoutForFrame)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
 typedef void (*WKBundlePageDidFirstVisuallyNonEmptyLayoutForFrame)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
+typedef void (*WKBundlePageDidRemoveFrameFromHierarchyCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
 // FIXME: There are no WKPage equivilent of these functions yet.
 typedef void (*WKBundlePageDidClearWindowObjectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo);
 typedef void (*WKBundlePageDidCancelClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
@@ -98,6 +99,7 @@ struct WKBundlePageLoaderClient {
     WKBundlePageDidReceiveTitleForFrameCallback                         didReceiveTitleForFrame;
     WKBundlePageDidFirstLayoutForFrame                                  didFirstLayoutForFrame;
     WKBundlePageDidFirstVisuallyNonEmptyLayoutForFrame                  didFirstVisuallyNonEmptyLayoutForFrame;
+    WKBundlePageDidRemoveFrameFromHierarchyCallback                     didRemoveFrameFromHierarchy;
 
     // FIXME: There are no WKPage equivilent of these functions yet.
     WKBundlePageDidClearWindowObjectForFrameCallback                    didClearWindowObjectForFrame;
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
index 118b638..a6e395d 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
@@ -147,6 +147,16 @@ void InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame(WebP
     userData = adoptRef(toWK(userDataToPass));
 }
 
+void InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy(WebPage* page , WebFrame* frame, RefPtr<APIObject>& userData)
+{
+    if (!m_client.didRemoveFrameFromHierarchy)
+        return;
+
+    WKTypeRef userDataToPass = 0;
+    m_client.didRemoveFrameFromHierarchy(toRef(page), toRef(frame), &userDataToPass, m_client.clientInfo);
+    userData = adoptRef(toWK(userDataToPass));
+}
+
 void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld* world)
 {
     if (!m_client.didClearWindowObjectForFrame)
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
index 2c73964..6f4887f 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
@@ -55,6 +55,7 @@ public:
     void didReceiveTitleForFrame(WebPage*, const String&, WebFrame*, RefPtr<APIObject>& userData);
     void didFirstLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
     void didFirstVisuallyNonEmptyLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
+    void didRemoveFrameFromHierarchy(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
 
     void didClearWindowObjectForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld*);
     void didCancelClientRedirectForFrame(WebPage*, WebFrame*);
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index ceedf47..eed05e7 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -115,7 +115,17 @@ void WebFrameLoaderClient::setCopiesOnScroll()
 
 void WebFrameLoaderClient::detachedFromParent2()
 {
-    notImplemented();
+    WebPage* webPage = m_frame->page();
+    if (!webPage)
+        return;
+
+    RefPtr<APIObject> userData;
+
+    // Notify the bundle client.
+    webPage->injectedBundleLoaderClient().didRemoveFrameFromHierarchy(webPage, m_frame, userData);
+
+    // Notify the UIProcess.
+    WebProcess::shared().connection()->send(WebPageProxyMessage::DidRemoveFrameFromHierarchy, webPage->pageID(), CoreIPC::In(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get())));
 }
 
 void WebFrameLoaderClient::detachedFromParent3()
@@ -955,7 +965,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
 void WebFrameLoaderClient::didTransferChildFrameToNewDocument()
 {
     notImplemented();
-}    
+}
 
 PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement* pluginElement, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
 {
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 3c2df5e..183e17b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-23  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        WebKit2 API: Need way to know when a frame is removed from the hierarchy
+        <rdar://problem/8414062>
+        https://bugs.webkit.org/show_bug.cgi?id=46432
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (didRemoveFrameFromHierarchy):
+        (-[BrowserWindowController awakeFromNib]):
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::InjectedBundlePage):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+
 2010-09-23  Tony Chang  <tony at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index 9398e56..32032c8 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -300,6 +300,11 @@ static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef fr
     LOG(@"didFirstVisuallyNonEmptyLayoutForFrame");
 }
 
+static void didRemoveFrameFromHierarchy(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+    LOG(@"didRemoveFrameFromHierarchy");
+}
+
 static void didStartProgress(WKPageRef page, const void *clientInfo)
 {
     [(BrowserWindowController *)clientInfo didStartProgress];
@@ -496,6 +501,7 @@ static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRe
         didReceiveTitleForFrame,
         didFirstLayoutForFrame,
         didFirstVisuallyNonEmptyLayoutForFrame,
+        didRemoveFrameFromHierarchy,
         didStartProgress,
         didChangeProgress,
         didFinishProgress,
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index dd92eca..581a9bc 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -169,6 +169,7 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
         didReceiveTitleForFrame,
         0,
         0,
+        0,
         didClearWindowForFrame,
         didCancelClientRedirectForFrame,
         willPerformClientRedirectForFrame,
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index a71b07d..d3e2bdd 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -186,6 +186,7 @@ void TestController::initialize(int argc, const char* argv[])
         0,
         0,
         0,
+        0,
         0
     };
     WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list