Title: [109369] trunk
Revision
109369
Author
[email protected]
Date
2012-03-01 10:57:14 -0800 (Thu, 01 Mar 2012)

Log Message

Move m_frame protector from FrameLoader::changeLocation to FrameLoader::urlSelected
https://bugs.webkit.org/show_bug.cgi?id=79882

Reviewed by Adam Barth.

Source/WebCore:

Test: fast/frames/url-selected-crash.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::changeLocation):
(WebCore::FrameLoader::urlSelected):

LayoutTests:

* fast/frames/url-selected-crash-expected.txt: Added.
* fast/frames/url-selected-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109368 => 109369)


--- trunk/LayoutTests/ChangeLog	2012-03-01 18:56:06 UTC (rev 109368)
+++ trunk/LayoutTests/ChangeLog	2012-03-01 18:57:14 UTC (rev 109369)
@@ -1,3 +1,13 @@
+2012-03-01  Tom Sepez  <[email protected]>
+
+        Move m_frame protector from FrameLoader::changeLocation to FrameLoader::urlSelected
+        https://bugs.webkit.org/show_bug.cgi?id=79882
+
+        Reviewed by Adam Barth.
+
+        * fast/frames/url-selected-crash-expected.txt: Added.
+        * fast/frames/url-selected-crash.html: Added.
+
 2012-03-01  Julien Chaffraix  <[email protected]>
 
         Lazily allocate overflow: hidden layers if we have overflowing content

Added: trunk/LayoutTests/fast/frames/url-selected-crash-expected.txt (0 => 109369)


--- trunk/LayoutTests/fast/frames/url-selected-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/frames/url-selected-crash-expected.txt	2012-03-01 18:57:14 UTC (rev 109369)
@@ -0,0 +1 @@
+

Added: trunk/LayoutTests/fast/frames/url-selected-crash.html (0 => 109369)


--- trunk/LayoutTests/fast/frames/url-selected-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/frames/url-selected-crash.html	2012-03-01 18:57:14 UTC (rev 109369)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<body>
+Test passes if it doesn't crash (may require libgmalloc and repeating) and this line gets erased.
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+var iterationsLeft = 2;
+function test()
+{
+    if (--iterationsLeft) {
+        frames[0].history.go(0);
+    } else {
+        document.body.textContent = frames[0].document.body.textContent;
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+</script>
+<iframe _onload_="test()"></iframe>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (109368 => 109369)


--- trunk/Source/WebCore/ChangeLog	2012-03-01 18:56:06 UTC (rev 109368)
+++ trunk/Source/WebCore/ChangeLog	2012-03-01 18:57:14 UTC (rev 109369)
@@ -1,3 +1,16 @@
+2012-03-01  Tom Sepez  <[email protected]>
+
+        Move m_frame protector from FrameLoader::changeLocation to FrameLoader::urlSelected
+        https://bugs.webkit.org/show_bug.cgi?id=79882
+
+        Reviewed by Adam Barth.
+
+        Test: fast/frames/url-selected-crash.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::changeLocation):
+        (WebCore::FrameLoader::urlSelected):
+
 2012-03-01  Julien Chaffraix  <[email protected]>
 
         Lazily allocate overflow: hidden layers if we have overflowing content

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (109368 => 109369)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2012-03-01 18:56:06 UTC (rev 109368)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2012-03-01 18:57:14 UTC (rev 109369)
@@ -251,7 +251,6 @@
 
 void FrameLoader::changeLocation(SecurityOrigin* securityOrigin, const KURL& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool refresh)
 {
-    RefPtr<Frame> protect(m_frame);
     urlSelected(FrameLoadRequest(securityOrigin, ResourceRequest(url, referrer, refresh ? ReloadIgnoringCacheData : UseProtocolCachePolicy), "_self"),
         0, lockHistory, lockBackForwardList, MaybeSendReferrer, ReplaceDocumentIfJavaScriptURL);
 }
@@ -268,6 +267,7 @@
 {
     ASSERT(!m_suppressOpenerInNewFrame);
 
+    RefPtr<Frame> protect(m_frame);
     FrameLoadRequest frameRequest(passedRequest);
 
     if (m_frame->script()->executeIfJavaScriptURL(frameRequest.resourceRequest().url(), shouldReplaceDocumentIfJavaScriptURL))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to