Title: [136516] trunk/Source
Revision
136516
Author
[email protected]
Date
2012-12-04 09:39:26 -0800 (Tue, 04 Dec 2012)

Log Message

Add FrameLoaderClient::didDisownOpener
https://bugs.webkit.org/show_bug.cgi?id=103789

Reviewed by Darin Fisher.

Source/WebCore:

Adds a didDisownOwner notification when a frame's opener is cleared,
so that FrameLoaderClients can react.

No new tests.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setOpener): Calls didDisownOpener if opener is cleared.
* loader/FrameLoaderClient.h:
(FrameLoaderClient):
(WebCore::FrameLoaderClient::didDisownOpener):

Source/WebKit/chromium:

Forwards the didDisownOpener notification to the WebFrameClient.

* public/WebFrameClient.h:
(WebFrameClient):
(WebKit::WebFrameClient::didDisownOpener):
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::didDisownOpener):
(WebKit):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136515 => 136516)


--- trunk/Source/WebCore/ChangeLog	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebCore/ChangeLog	2012-12-04 17:39:26 UTC (rev 136516)
@@ -1,3 +1,21 @@
+2012-12-04  Charlie Reis  <[email protected]>
+
+        Add FrameLoaderClient::didDisownOpener
+        https://bugs.webkit.org/show_bug.cgi?id=103789
+
+        Reviewed by Darin Fisher.
+
+        Adds a didDisownOwner notification when a frame's opener is cleared,
+        so that FrameLoaderClients can react.
+
+        No new tests.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::setOpener): Calls didDisownOpener if opener is cleared.
+        * loader/FrameLoaderClient.h:
+        (FrameLoaderClient):
+        (WebCore::FrameLoaderClient::didDisownOpener):
+
 2012-12-04  Robert Hogan  <[email protected]>
 
         Redrawing issue with inserting new inline element between existing inline elements

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (136515 => 136516)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2012-12-04 17:39:26 UTC (rev 136516)
@@ -948,6 +948,9 @@
 
 void FrameLoader::setOpener(Frame* opener)
 {
+    if (m_opener && !opener)
+        m_client->didDisownOpener();
+
     if (m_opener)
         m_opener->loader()->m_openedFrames.remove(m_frame);
     if (opener)

Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (136515 => 136516)


--- trunk/Source/WebCore/loader/FrameLoaderClient.h	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h	2012-12-04 17:39:26 UTC (rev 136516)
@@ -212,6 +212,11 @@
         virtual bool shouldStopLoadingForHistoryItem(HistoryItem*) const = 0;
         virtual void updateGlobalHistoryItemForPage() { }
 
+        // This frame has set its opener to null, disowning it for the lifetime of the frame.
+        // See http://html.spec.whatwg.org/#dom-opener.
+        // FIXME: JSC should allow disowning opener. - <https://bugs.webkit.org/show_bug.cgi?id=103913>.
+        virtual void didDisownOpener() { }
+
         // This frame has displayed inactive content (such as an image) from an
         // insecure source.  Inactive content cannot spread to other frames.
         virtual void didDisplayInsecureContent() = 0;

Modified: trunk/Source/WebKit/chromium/ChangeLog (136515 => 136516)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-12-04 17:39:26 UTC (rev 136516)
@@ -1,3 +1,21 @@
+2012-12-04  Charlie Reis  <[email protected]>
+
+        Add FrameLoaderClient::didDisownOpener
+        https://bugs.webkit.org/show_bug.cgi?id=103789
+
+        Reviewed by Darin Fisher.
+
+        Forwards the didDisownOpener notification to the WebFrameClient.
+
+        * public/WebFrameClient.h:
+        (WebFrameClient):
+        (WebKit::WebFrameClient::didDisownOpener):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::didDisownOpener):
+        (WebKit):
+        * src/FrameLoaderClientImpl.h:
+        (FrameLoaderClientImpl):
+
 2012-12-04  Stephen Chenney  <[email protected]>
 
         [chromium] Turn on the new Skia mask blur algorithm.

Modified: trunk/Source/WebKit/chromium/public/WebFrameClient.h (136515 => 136516)


--- trunk/Source/WebKit/chromium/public/WebFrameClient.h	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebKit/chromium/public/WebFrameClient.h	2012-12-04 17:39:26 UTC (rev 136516)
@@ -109,6 +109,10 @@
     // is created and initialized.
     virtual void didCreateFrame(WebFrame* parent, WebFrame* child) { }
 
+    // This frame set its opener to null, disowning it.
+    // See http://html.spec.whatwg.org/#dom-opener.
+    virtual void didDisownOpener(WebFrame*) { }
+
     // This frame has been detached from the view, but has not been closed yet.
     virtual void frameDetached(WebFrame*) { }
 

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (136515 => 136516)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-12-04 17:39:26 UTC (rev 136516)
@@ -1216,6 +1216,12 @@
     return !url.protocolIs(backForwardNavigationScheme);
 }
 
+void FrameLoaderClientImpl::didDisownOpener()
+{
+    if (m_webFrame->client())
+        m_webFrame->client()->didDisownOpener(m_webFrame);
+}
+
 void FrameLoaderClientImpl::didDisplayInsecureContent()
 {
     if (m_webFrame->client())

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h (136515 => 136516)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h	2012-12-04 17:39:03 UTC (rev 136515)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h	2012-12-04 17:39:26 UTC (rev 136516)
@@ -138,6 +138,7 @@
     virtual void updateGlobalHistoryRedirectLinks();
     virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
     virtual bool shouldStopLoadingForHistoryItem(WebCore::HistoryItem*) const;
+    virtual void didDisownOpener();
     virtual void didDisplayInsecureContent();
     virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::KURL& insecureURL);
     virtual void didDetectXSS(const WebCore::KURL&, bool didBlockEntirePage);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to