Title: [131314] trunk/Source/WebKit/blackberry
Revision
131314
Author
toniki...@webkit.org
Date
2012-10-15 10:15:34 -0700 (Mon, 15 Oct 2012)

Log Message

[BlackBerry] Clean up BackingStoreClient (part II)
https://bugs.webkit.org/show_bug.cgi?id=99327

Reviewed by Yong Li.
Patch by Antonio Gomes <ago...@rim.com>

Remove more unneeded BackingStoreClient <-> WebPageClient integration
methods:
- BackingStoreClient* backingStoreClientForFrame(...)
- void addBackingStoreClientForFrame(...)
- void removeBackingStoreClientForFrame(...)

Change places calling WPPriv::backingStoreClientForFrame to directly
access WPPriv::backingStoreClient instead, since only the main frame will
have a BackingStoreClient instance associated with it, and it is owned by
the WKPriv.

Remove non-mainframe only references to BackingStoreClient completely,
since it is dead code now.

* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::backingStoreClient):
(BlackBerry::WebKit::WebPage::destroy):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::invalidateContentsForSlowScroll):
(WebCore::ChromeClientBlackBerry::scroll):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::transitionToCommittedForNewPage):
(WebCore::FrameLoaderClientBlackBerry::createFrame):
(WebCore::FrameLoaderClientBlackBerry::detachedFromParent2):
* WebKitSupport/BackingStoreClient.cpp:
(BlackBerry::WebKit::BackingStoreClient::create):
(BlackBerry::WebKit::BackingStoreClient::BackingStoreClient):
(BlackBerry::WebKit::BackingStoreClient::~BackingStoreClient):
* WebKitSupport/BackingStoreClient.h:
(BackingStoreClient):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::setBatchEditingActive):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp (131313 => 131314)


--- trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp	2012-10-15 17:15:34 UTC (rev 131314)
@@ -299,20 +299,8 @@
         ASSERT(canScrollInnerFrame(frame));
 
         view->setCanBlitOnScroll(false);
-
-        BackingStoreClient* backingStoreClient = m_webPage->backingStoreClientForFrame(view->frame());
-        if (backingStoreClient) {
-            backingStoreClient->setIsClientGeneratedScroll(true);
-            backingStoreClient->setIsScrollNotificationSuppressed(true);
-        }
-
         view->setScrollPosition(scrollPosition);
 
-        if (backingStoreClient) {
-            backingStoreClient->setIsClientGeneratedScroll(false);
-            backingStoreClient->setIsScrollNotificationSuppressed(false);
-        }
-
     } else {
 
         // RenderBox-based elements case (scrollable boxes (div's, p's, textarea's, etc)).

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (131313 => 131314)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-10-15 17:15:34 UTC (rev 131314)
@@ -2479,30 +2479,11 @@
     return IntSize(defaultLayoutWidth, defaultLayoutHeight);
 }
 
-BackingStoreClient* WebPagePrivate::backingStoreClientForFrame(const Frame* frame) const
+BackingStoreClient* WebPagePrivate::backingStoreClient() const
 {
-    ASSERT(frame);
-    BackingStoreClient* backingStoreClient = 0;
-    if (m_backingStoreClientForFrameMap.contains(frame))
-        backingStoreClient = m_backingStoreClientForFrameMap.get(frame);
-    return backingStoreClient;
+    return m_backingStoreClient;
 }
 
-void WebPagePrivate::addBackingStoreClientForFrame(const Frame* frame, BackingStoreClient* client)
-{
-    ASSERT(frame);
-    ASSERT(client);
-    m_backingStoreClientForFrameMap.add(frame, client);
-}
-
-void WebPagePrivate::removeBackingStoreClientForFrame(const Frame* frame)
-{
-    ASSERT(frame);
-    if (m_backingStoreClientForFrameMap.contains(frame))
-        m_backingStoreClientForFrameMap.remove(frame);
-}
-
-
 void WebPagePrivate::clearDocumentData(const Document* documentGoingAway)
 {
     ASSERT(documentGoingAway);
@@ -3125,15 +3106,6 @@
 
     FrameLoader* loader = d->m_mainFrame->loader();
 
-    // Remove main frame's backing store client from the map
-    // to prevent FrameLoaderClientBlackyBerry::detachFromParent2(),
-    // which is called by loader->detachFromParent(), deleting it.
-    // We will delete it in ~WebPagePrivate().
-    // Reason: loader->detachFromParent() may ping back to backing store
-    // indirectly through ChromeClientBlackBerry::invalidateContentsAndWindow().
-    // see RIM PR #93256.
-    d->removeBackingStoreClientForFrame(d->m_mainFrame);
-
     // Set m_mainFrame to 0 to avoid calls back in to the backingstore during webpage deletion.
     d->m_mainFrame = 0;
     if (loader)

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (131313 => 131314)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-10-15 17:15:34 UTC (rev 131314)
@@ -432,9 +432,7 @@
     bool dispatchTouchPointAsMouseEventToFullScreenPlugin(WebCore::PluginView*, const Platform::TouchPoint&);
     bool dispatchMouseEventToFullScreenPlugin(WebCore::PluginView*, const Platform::MouseEvent&);
 
-    BackingStoreClient* backingStoreClientForFrame(const WebCore::Frame*) const;
-    void addBackingStoreClientForFrame(const WebCore::Frame*, BackingStoreClient*);
-    void removeBackingStoreClientForFrame(const WebCore::Frame*);
+    BackingStoreClient* backingStoreClient() const;
 
     void setParentPopup(WebCore::PagePopupBlackBerry* webPopup);
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (131313 => 131314)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-10-15 17:15:34 UTC (rev 131314)
@@ -1,5 +1,49 @@
 2012-10-15  Antonio Gomes  <ago...@rim.com>
 
+        [BlackBerry] Clean up BackingStoreClient (part II)
+        https://bugs.webkit.org/show_bug.cgi?id=99327
+
+        Reviewed by Yong Li.
+
+        Remove more unneeded BackingStoreClient <-> WebPageClient integration
+        methods:
+        - BackingStoreClient* backingStoreClientForFrame(...)
+        - void addBackingStoreClientForFrame(...)
+        - void removeBackingStoreClientForFrame(...)
+
+        Change places calling WPPriv::backingStoreClientForFrame to directly
+        access WPPriv::backingStoreClient instead, since only the main frame will
+        have a BackingStoreClient instance associated with it, and it is owned by
+        the WKPriv.
+
+        Remove non-mainframe only references to BackingStoreClient completely,
+        since it is dead code now.
+
+        * Api/InRegionScroller.cpp:
+        (BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition):
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::backingStoreClient):
+        (BlackBerry::WebKit::WebPage::destroy):
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        (WebCore::ChromeClientBlackBerry::invalidateContentsForSlowScroll):
+        (WebCore::ChromeClientBlackBerry::scroll):
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::transitionToCommittedForNewPage):
+        (WebCore::FrameLoaderClientBlackBerry::createFrame):
+        (WebCore::FrameLoaderClientBlackBerry::detachedFromParent2):
+        * WebKitSupport/BackingStoreClient.cpp:
+        (BlackBerry::WebKit::BackingStoreClient::create):
+        (BlackBerry::WebKit::BackingStoreClient::BackingStoreClient):
+        (BlackBerry::WebKit::BackingStoreClient::~BackingStoreClient):
+        * WebKitSupport/BackingStoreClient.h:
+        (BackingStoreClient):
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::setBatchEditingActive):
+
+2012-10-15  Antonio Gomes  <ago...@rim.com>
+
         [BlackBerry] Clean up BackingStoreClient (part I)
         https://bugs.webkit.org/show_bug.cgi?id=99327
 

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (131313 => 131314)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-10-15 17:15:34 UTC (rev 131314)
@@ -585,9 +585,9 @@
     if (scrollView != m_webPagePrivate->m_mainFrame->view())
         invalidateContentsAndRootView(updateRect, true /*immediate*/);
     else {
-        BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_webPagePrivate->m_mainFrame);
-        ASSERT(backingStoreClientForFrame);
-        backingStoreClientForFrame->checkOriginOfCurrentScrollOperation();
+        BackingStoreClient* backingStoreClient = m_webPagePrivate->backingStoreClient();
+        ASSERT(backingStoreClient);
+        backingStoreClient->checkOriginOfCurrentScrollOperation();
 
         m_webPagePrivate->m_backingStore->d->slowScroll(delta, updateRect, immediate);
     }
@@ -601,9 +601,9 @@
     if (!m_webPagePrivate->m_mainFrame->view())
         return;
 
-    BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_webPagePrivate->m_mainFrame);
-    ASSERT(backingStoreClientForFrame);
-    backingStoreClientForFrame->checkOriginOfCurrentScrollOperation();
+    BackingStoreClient* backingStoreClient = m_webPagePrivate->backingStoreClient();
+    ASSERT(backingStoreClient);
+    backingStoreClient->checkOriginOfCurrentScrollOperation();
 
     m_webPagePrivate->m_backingStore->d->scroll(delta, scrollViewRect, clipRect);
 }

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (131313 => 131314)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-10-15 17:15:34 UTC (rev 131314)
@@ -435,9 +435,8 @@
     // in the backing store from another thread (see BackingStorePrivate::blitVisibleContents method),
     // so we suspend and resume screen update to make sure we do not get a invalid FrameView
     // state.
-    BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_frame);
-    if (backingStoreClientForFrame)
-        backingStoreClientForFrame->backingStore()->d->suspendScreenAndBackingStoreUpdates();
+    if (isMainFrame() && m_webPagePrivate->backingStoreClient())
+        m_webPagePrivate->backingStoreClient()->backingStore()->d->suspendScreenAndBackingStoreUpdates();
 
     // We are navigating away from this document, so clean up any footprint we might have.
     if (m_frame->document())
@@ -456,8 +455,9 @@
                         ScrollbarAlwaysOff,                    /* ver mode */
                         true);                                 /* lock the mode */
 
-    if (backingStoreClientForFrame)
-        backingStoreClientForFrame->backingStore()->d->resumeScreenAndBackingStoreUpdates(BackingStore::None);
+    if (isMainFrame() && m_webPagePrivate->backingStoreClient())
+        m_webPagePrivate->backingStoreClient()->backingStore()->d->resumeScreenAndBackingStoreUpdates(BackingStore::None);
+
     m_frame->view()->updateCanHaveScrollbars();
 
     if (isMainFrame()) {
@@ -787,8 +787,6 @@
     if (!childFrame->tree()->parent())
         return 0;
 
-    BackingStoreClient::create(childFrame.get(), m_frame, m_webPagePrivate->m_webPage);
-
     m_frame->loader()->loadURLIntoChildFrame(url, referrer, childFrame.get());
 
     if (!childFrame->tree()->parent())
@@ -956,12 +954,6 @@
 
 void FrameLoaderClientBlackBerry::detachedFromParent2()
 {
-    BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_frame);
-    if (backingStoreClientForFrame) {
-        delete backingStoreClientForFrame;
-        backingStoreClientForFrame = 0;
-    }
-
     if (m_frame->document())
         m_webPagePrivate->clearDocumentData(m_frame->document());
 

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp (131313 => 131314)


--- trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp	2012-10-15 17:15:34 UTC (rev 131314)
@@ -51,77 +51,28 @@
 
 BackingStoreClient* BackingStoreClient::create(Frame* frame, Frame* parentFrame, WebPage* parentPage)
 {
-    ASSERT(parentPage);
-    ASSERT(frame->view());
-
-    // FIXME: We do not support inner frames for now.
-    if (parentFrame)
-        return 0;
-
-    BackingStoreClient* parentBackingStoreClient
-        = parentFrame
-        ? parentPage->d->backingStoreClientForFrame(parentFrame)
-        : 0;
-
-    // If this frame has a parent with no backingstore then just stop since
-    // our frame heirarchy is done.
-    if (parentFrame && !parentBackingStoreClient)
-        return 0;
-
-    BackingStoreClient* it = new BackingStoreClient(frame, parentFrame, parentPage);
-    ASSERT(it);
-
-    // Frame -> BackingStoreClient mapping is controlled by the Page.
-    parentPage->d->addBackingStoreClientForFrame(frame, it);
-
-    // Add the backing store client to the child list of its parent.
-    if (parentBackingStoreClient)
-        parentBackingStoreClient->addChild(it);
-
+    ASSERT(!parentFrame);
+    BackingStoreClient* it = new BackingStoreClient(frame, parentPage);
     return it;
 }
 
-BackingStoreClient::BackingStoreClient(Frame* frame, Frame* parentFrame, WebPage* parentPage)
+BackingStoreClient::BackingStoreClient(Frame* frame, WebPage* parentPage)
     : m_frame(frame)
     , m_webPage(parentPage)
     , m_backingStore(0)
-    , m_parent(0)
     , m_isClientGeneratedScroll(false)
     , m_isScrollNotificationSuppressed(false)
 {
-    UNUSED_PARAM(parentFrame);
     m_backingStore = new BackingStore(m_webPage, this);
 }
 
 BackingStoreClient::~BackingStoreClient()
 {
-    m_webPage->d->removeBackingStoreClientForFrame(m_frame);
-
     delete m_backingStore;
     m_backingStore = 0;
     m_frame = 0;
 }
 
-void BackingStoreClient::addChild(BackingStoreClient* child)
-{
-    ASSERT(child);
-    child->m_parent = this;
-}
-
-WTF::Vector <BackingStoreClient*> BackingStoreClient::children() const
-{
-    WTF::Vector<BackingStoreClient*> children;
-    for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
-        BlackBerry::WebKit::BackingStoreClient* client =
-            m_webPage->d->backingStoreClientForFrame(child);
-
-        if (client)
-            children.append(client);
-    }
-
-    return children;
-}
-
 IntRect BackingStoreClient::absoluteRect() const
 {
     IntRect rect = IntRect(IntPoint::zero(), viewportSize());

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.h (131313 => 131314)


--- trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.h	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.h	2012-10-15 17:15:34 UTC (rev 131314)
@@ -45,10 +45,6 @@
     WebCore::Frame* frame() const { return m_frame; }
     bool isMainFrame() const { return m_frame == m_webPage->d->m_mainFrame; }
 
-    void addChild(BackingStoreClient* child);
-    WTF::Vector <BackingStoreClient*> children() const;
-    BackingStoreClient* parent() const { return m_parent; }
-
     WebCore::IntPoint absoluteLocation() const;
     WebCore::IntPoint transformedAbsoluteLocation() const;
     WebCore::IntRect absoluteRect() const;
@@ -104,12 +100,11 @@
     void checkOriginOfCurrentScrollOperation();
 
 private:
-    BackingStoreClient(WebCore::Frame*, WebCore::Frame* parentFrame, WebPage* parentPage);
+    BackingStoreClient(WebCore::Frame*, WebPage* parentPage);
 
     WebCore::Frame* m_frame;
     WebPage* m_webPage;
     BackingStore* m_backingStore;
-    BackingStoreClient* m_parent;
     bool m_isClientGeneratedScroll;
     bool m_isScrollNotificationSuppressed;
 };

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (131313 => 131314)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-10-15 17:09:25 UTC (rev 131313)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-10-15 17:15:34 UTC (rev 131314)
@@ -1745,14 +1745,14 @@
 
     // FIXME switch this to m_currentFocusElement->document()->frame() when we have separate
     // backingstore for each frame.
-    BackingStoreClient* backingStoreClientForFrame = m_webPage->backingStoreClientForFrame(m_webPage->mainFrame());
-    ASSERT(backingStoreClientForFrame);
+    BackingStoreClient* backingStoreClient = m_webPage->backingStoreClient();
+    ASSERT(backingStoreClient);
 
     // Enable / Disable the backingstore to prevent visual updates.
     if (!active)
-        backingStoreClientForFrame->backingStore()->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
+        backingStoreClient->backingStore()->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
     else
-        backingStoreClientForFrame->backingStore()->suspendScreenAndBackingStoreUpdates();
+        backingStoreClient->backingStore()->suspendScreenAndBackingStoreUpdates();
 
     return true;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to