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

ap at apple.com ap at apple.com
Thu Apr 8 01:06:18 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 334c049ba23d97e3a73c99ce51029efda123b2c3
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 14 19:03:39 2010 +0000

            Reviewed by Brady Eidson.
    
            https://bugs.webkit.org/show_bug.cgi?id=33652
            REGRESSION: Frames stop appearing after browsing for a while
    
            <rdar://problem/7308312> REGRESSION: iBench gets slower after several runs
    
            I do not know how not creating renderers for frames could make iBench slower, but it did.
    
            Test: fast/frames/cached-frame-counter.html
    
            * history/CachedFrame.cpp:
            (WebCore::CachedFrame::CachedFrame): A frame that's cached is moved away from Page,
            so decrement frame count here.
            (WebCore::CachedFrame::open): Increase frame count when a frame is restored.
    
            * history/CachedFrame.h: Remove unneeded forward declarations.
    
            * history/CachedPage.h: Ditto.
    
            * history/CachedPage.cpp: (WebCore::CachedPage::restore): Assert that page frame count is
            zero prior to restoring a page from b/f cache.
    
            * page/Page.cpp: (WebCore::Page::checkFrameCountConsistency): A debug-only method to
            check that frame count stored in Page matches the number of frames in frame tree.
    
            * page/Page.h:
            (WebCore::Page::decrementFrameCount): Assert that frame count is positive.
            (WebCore::Page::frameCount): Call checkFrameCountConsistency().
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53274 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4550263..72ccddc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-13  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33652
+        REGRESSION: Frames stop appearing after browsing for a while
+
+        * fast/frames/cached-frame-counter-expected.txt: Added.
+        * fast/frames/cached-frame-counter.html: Added.
+
 2010-01-14  Adam Roben  <aroben at apple.com>
 
         Fix a typo in editing/selection/inactive-selection.html
diff --git a/LayoutTests/fast/frames/cached-frame-counter-expected.txt b/LayoutTests/fast/frames/cached-frame-counter-expected.txt
new file mode 100644
index 0000000..8665f45
--- /dev/null
+++ b/LayoutTests/fast/frames/cached-frame-counter-expected.txt
@@ -0,0 +1,3 @@
+Test that frame count limit is reset on navigations.
+
+PASS
diff --git a/LayoutTests/fast/frames/cached-frame-counter.html b/LayoutTests/fast/frames/cached-frame-counter.html
new file mode 100644
index 0000000..616c8c4
--- /dev/null
+++ b/LayoutTests/fast/frames/cached-frame-counter.html
@@ -0,0 +1,143 @@
+<body onload="setTimeout('test()', 500)">
+<p>Test that frame count limit is reset on navigations.</p>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+function test()
+{
+    var loop = parseFloat(document.location.search.substring(1));
+    if (!loop)
+        loop = 0;
+
+    try {
+        window.frames[100].document.documentElement.innerHTML;
+    } catch (ex) {
+        document.write("FAIL: " + ex + "<p>");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+        return;
+    }
+
+    if (loop < 2) {
+        ++loop;
+        document.location.search = "?" + loop;
+        return;
+    }
+
+    document.body.appendChild(document.createTextNode((/World/.test(window.frames[100].document.documentElement.innerHTML) ? "PASS" : "FAIL")));
+
+    var ifr;
+    while (ifr = document.getElementsByTagName("iframe")[0])
+        document.body.removeChild(ifr);
+
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+</script>
+
+<!-- 101 iframe -->
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="about:blank"></iframe>
+<iframe src="javascript:'<p>Hello, World!</p>'"></iframe>
+</body>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 39f72d4..8fd8fdd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,35 @@
+2010-01-13  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33652
+        REGRESSION: Frames stop appearing after browsing for a while
+
+        <rdar://problem/7308312> REGRESSION: iBench gets slower after several runs
+
+        I do not know how not creating renderers for frames could make iBench slower, but it did.
+
+        Test: fast/frames/cached-frame-counter.html
+
+        * history/CachedFrame.cpp:
+        (WebCore::CachedFrame::CachedFrame): A frame that's cached is moved away from Page,
+        so decrement frame count here.
+        (WebCore::CachedFrame::open): Increase frame count when a frame is restored.
+
+        * history/CachedFrame.h: Remove unneeded forward declarations.
+
+        * history/CachedPage.h: Ditto.
+
+        * history/CachedPage.cpp: (WebCore::CachedPage::restore): Assert that page frame count is
+        zero prior to restoring a page from b/f cache.
+        
+        * page/Page.cpp: (WebCore::Page::checkFrameCountConsistency): A debug-only method to
+        check that frame count stored in Page matches the number of frames in frame tree.
+
+        * page/Page.h:
+        (WebCore::Page::decrementFrameCount): Assert that frame count is positive.
+        (WebCore::Page::frameCount): Call checkFrameCountConsistency().
+
 2010-01-14  Steve Falkenburg  <sfalken at apple.com>
 
         Windows build fixes.
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index 50cf189..e889990 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -136,6 +136,9 @@ CachedFrame::CachedFrame(Frame* frame)
     for (unsigned i = 0; i < m_childFrames.size(); ++i)
         frame->tree()->removeChild(m_childFrames[i]->view()->frame());
 
+    if (!m_isMainFrame)
+        frame->page()->decrementFrameCount();
+
 #ifndef NDEBUG
     if (m_isMainFrame)
         LOG(PageCache, "Finished creating CachedFrame for main frame url '%s' and DocumentLoader %p\n", m_url.string().utf8().data(), m_documentLoader.get());
@@ -148,6 +151,9 @@ void CachedFrame::open()
 {
     ASSERT(m_view);
     m_view->frame()->loader()->open(*this);
+
+    if (!m_isMainFrame)
+        m_view->frame()->page()->incrementFrameCount();
 }
 
 void CachedFrame::clear()
diff --git a/WebCore/history/CachedFrame.h b/WebCore/history/CachedFrame.h
index 883c12a..ca772a4 100644
--- a/WebCore/history/CachedFrame.h
+++ b/WebCore/history/CachedFrame.h
@@ -31,15 +31,13 @@
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
-    
-    class CachedFrame;
-    class CachedFramePlatformData;
-    class DOMWindow;
-    class Document;
-    class DocumentLoader;
-    class Frame;
-    class FrameView;
-    class Node;
+
+class CachedFrame;
+class CachedFramePlatformData;
+class Document;
+class DocumentLoader;
+class FrameView;
+class Node;
 
 typedef Vector<RefPtr<CachedFrame> > CachedFrameVector;
 
diff --git a/WebCore/history/CachedPage.cpp b/WebCore/history/CachedPage.cpp
index 20c5fd7..acbfd31 100644
--- a/WebCore/history/CachedPage.cpp
+++ b/WebCore/history/CachedPage.cpp
@@ -69,6 +69,7 @@ void CachedPage::restore(Page* page)
 {
     ASSERT(m_cachedMainFrame);
     ASSERT(page && page->mainFrame() && page->mainFrame() == m_cachedMainFrame->view()->frame());
+    ASSERT(!page->frameCount());
 
     m_cachedMainFrame->open();
     
diff --git a/WebCore/history/CachedPage.h b/WebCore/history/CachedPage.h
index c68c753..4741c79 100644
--- a/WebCore/history/CachedPage.h
+++ b/WebCore/history/CachedPage.h
@@ -30,14 +30,9 @@
 
 namespace WebCore {
     
-    class CachedFramePlatformData;
-    class DOMWindow;
-    class Document;
-    class DocumentLoader;
-    class FrameView;
-    class KURL;
-    class Node;
-    class Page;
+class Document;
+class DocumentLoader;
+class Page;
 
 class CachedPage : public RefCounted<CachedPage> {
 public:
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index b0f2859..1edc164 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -775,4 +775,16 @@ void Page::didStopPlugin(HaltablePlugin* obj)
         m_pluginHalter->didStopPlugin(obj);
 }
 
+#if !ASSERT_DISABLED
+void Page::checkFrameCountConsistency() const
+{
+    ASSERT(m_frameCount >= 0);
+
+    int frameCount = 0;
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+        ++frameCount;
+
+    ASSERT(m_frameCount + 1 == frameCount);
+}
+#endif
 } // namespace WebCore
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index ad611d1..1417c87 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -132,8 +132,8 @@ namespace WebCore {
         PageGroup* groupPtr() { return m_group; } // can return 0
 
         void incrementFrameCount() { ++m_frameCount; }
-        void decrementFrameCount() { --m_frameCount; }
-        int frameCount() const { return m_frameCount; }
+        void decrementFrameCount() { ASSERT(m_frameCount); --m_frameCount; }
+        int frameCount() const { checkFrameCountConsistency(); return m_frameCount; }
 
         Chrome* chrome() const { return m_chrome.get(); }
         SelectionController* dragCaretController() const { return m_dragCaretController.get(); }
@@ -244,6 +244,12 @@ namespace WebCore {
     private:
         void initGroup();
 
+#if ASSERT_DISABLED
+        void checkFrameCountConsistency() const { }
+#else
+        void checkFrameCountConsistency() const;
+#endif
+
         OwnPtr<Chrome> m_chrome;
         OwnPtr<SelectionController> m_dragCaretController;
 #if ENABLE(DRAG_SUPPORT)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list