Title: [163448] trunk/Source/WebKit2
Revision
163448
Author
m...@apple.com
Date
2014-02-05 09:13:07 -0800 (Wed, 05 Feb 2014)

Log Message

[Cocoa] Notify WKWebProcessPlugInLoadDelegate when a frame is removed from the frame hierarchy
https://bugs.webkit.org/show_bug.cgi?id=128239

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: Declared new
delegate method.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didRemoveFrameFromHierarchy): Implemented this page loader client callback by calling the
load delegate.
(setUpPageLoaderClient): Set the above callback in the client structure.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163447 => 163448)


--- trunk/Source/WebKit2/ChangeLog	2014-02-05 16:13:07 UTC (rev 163447)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-05 17:13:07 UTC (rev 163448)
@@ -1,3 +1,17 @@
+2014-02-05  Dan Bernstein  <m...@apple.com>
+
+        [Cocoa] Notify WKWebProcessPlugInLoadDelegate when a frame is removed from the frame hierarchy
+        https://bugs.webkit.org/show_bug.cgi?id=128239
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: Declared new
+        delegate method.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        (didRemoveFrameFromHierarchy): Implemented this page loader client callback by calling the
+        load delegate.
+        (setUpPageLoaderClient): Set the above callback in the client structure.
+
 2014-02-05  Csaba Osztrogonác  <o...@webkit.org>
 
         Remove ENABLE(SVG) guards

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h (163447 => 163448)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h	2014-02-05 16:13:07 UTC (rev 163447)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h	2014-02-05 17:13:07 UTC (rev 163448)
@@ -41,6 +41,7 @@
 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFinishLoadForFrame:(WKWebProcessPlugInFrame *)frame;
 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didSameDocumentNavigationForFrame:(WKWebProcessPlugInFrame *)frame;
 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller globalObjectIsAvailableForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld;
+- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didRemoveFrameFromHierarchy:(WKWebProcessPlugInFrame *)frame;
 
 // Layout
 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didLayoutForFrame:(WKWebProcessPlugInFrame *)frame;

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (163447 => 163448)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm	2014-02-05 16:13:07 UTC (rev 163447)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm	2014-02-05 17:13:07 UTC (rev 163448)
@@ -88,6 +88,15 @@
         [loadDelegate webProcessPlugInBrowserContextController:pluginContextController globalObjectIsAvailableForFrame:wrapper(*toImpl(frame)) inScriptWorld:wrapper(*toImpl(scriptWorld))];
 }
 
+static void didRemoveFrameFromHierarchy(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void* clientInfo)
+{
+    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto loadDelegate = pluginContextController->_loadDelegate.get();
+
+    if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didRemoveFrameFromHierarchy:)])
+        [loadDelegate webProcessPlugInBrowserContextController:pluginContextController didRemoveFrameFromHierarchy:wrapper(*toImpl(frame))];
+}
+
 static void didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
 {
     WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
@@ -156,6 +165,7 @@
     client.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
     client.didFinishLoadForFrame = didFinishLoadForFrame;
     client.globalObjectIsAvailableForFrame = globalObjectIsAvailableForFrame;
+    client.didRemoveFrameFromHierarchy = didRemoveFrameFromHierarchy;
 
     client.didLayoutForFrame = didLayoutForFrame;
     client.didLayout = didLayout;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to