Changeset 131314 in webkit


Ignore:
Timestamp:
Oct 15, 2012 10:15:34 AM (12 years ago)
Author:
tonikitoo@webkit.org
Message:

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

Reviewed by Yong Li.
Patch by Antonio Gomes <agomes@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):

Location:
trunk/Source/WebKit/blackberry
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp

    r129916 r131314  
    300300
    301301        view->setCanBlitOnScroll(false);
    302 
    303         BackingStoreClient* backingStoreClient = m_webPage->backingStoreClientForFrame(view->frame());
    304         if (backingStoreClient) {
    305             backingStoreClient->setIsClientGeneratedScroll(true);
    306             backingStoreClient->setIsScrollNotificationSuppressed(true);
    307         }
    308 
    309302        view->setScrollPosition(scrollPosition);
    310 
    311         if (backingStoreClient) {
    312             backingStoreClient->setIsClientGeneratedScroll(false);
    313             backingStoreClient->setIsScrollNotificationSuppressed(false);
    314         }
    315303
    316304    } else {
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r131257 r131314  
    24802480}
    24812481
    2482 BackingStoreClient* WebPagePrivate::backingStoreClientForFrame(const Frame* frame) const
    2483 {
    2484     ASSERT(frame);
    2485     BackingStoreClient* backingStoreClient = 0;
    2486     if (m_backingStoreClientForFrameMap.contains(frame))
    2487         backingStoreClient = m_backingStoreClientForFrameMap.get(frame);
    2488     return backingStoreClient;
    2489 }
    2490 
    2491 void WebPagePrivate::addBackingStoreClientForFrame(const Frame* frame, BackingStoreClient* client)
    2492 {
    2493     ASSERT(frame);
    2494     ASSERT(client);
    2495     m_backingStoreClientForFrameMap.add(frame, client);
    2496 }
    2497 
    2498 void WebPagePrivate::removeBackingStoreClientForFrame(const Frame* frame)
    2499 {
    2500     ASSERT(frame);
    2501     if (m_backingStoreClientForFrameMap.contains(frame))
    2502         m_backingStoreClientForFrameMap.remove(frame);
    2503 }
    2504 
     2482BackingStoreClient* WebPagePrivate::backingStoreClient() const
     2483{
     2484    return m_backingStoreClient;
     2485}
    25052486
    25062487void WebPagePrivate::clearDocumentData(const Document* documentGoingAway)
     
    31263107    FrameLoader* loader = d->m_mainFrame->loader();
    31273108
    3128     // Remove main frame's backing store client from the map
    3129     // to prevent FrameLoaderClientBlackyBerry::detachFromParent2(),
    3130     // which is called by loader->detachFromParent(), deleting it.
    3131     // We will delete it in ~WebPagePrivate().
    3132     // Reason: loader->detachFromParent() may ping back to backing store
    3133     // indirectly through ChromeClientBlackBerry::invalidateContentsAndWindow().
    3134     // see RIM PR #93256.
    3135     d->removeBackingStoreClientForFrame(d->m_mainFrame);
    3136 
    31373109    // Set m_mainFrame to 0 to avoid calls back in to the backingstore during webpage deletion.
    31383110    d->m_mainFrame = 0;
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r131257 r131314  
    433433    bool dispatchMouseEventToFullScreenPlugin(WebCore::PluginView*, const Platform::MouseEvent&);
    434434
    435     BackingStoreClient* backingStoreClientForFrame(const WebCore::Frame*) const;
    436     void addBackingStoreClientForFrame(const WebCore::Frame*, BackingStoreClient*);
    437     void removeBackingStoreClientForFrame(const WebCore::Frame*);
     435    BackingStoreClient* backingStoreClient() const;
    438436
    439437    void setParentPopup(WebCore::PagePopupBlackBerry* webPopup);
  • trunk/Source/WebKit/blackberry/ChangeLog

    r131305 r131314  
     12012-10-15  Antonio Gomes  <agomes@rim.com>
     2
     3        [BlackBerry] Clean up BackingStoreClient (part II)
     4        https://bugs.webkit.org/show_bug.cgi?id=99327
     5
     6        Reviewed by Yong Li.
     7
     8        Remove more unneeded BackingStoreClient <-> WebPageClient integration
     9        methods:
     10        - BackingStoreClient* backingStoreClientForFrame(...)
     11        - void addBackingStoreClientForFrame(...)
     12        - void removeBackingStoreClientForFrame(...)
     13
     14        Change places calling WPPriv::backingStoreClientForFrame to directly
     15        access WPPriv::backingStoreClient instead, since only the main frame will
     16        have a BackingStoreClient instance associated with it, and it is owned by
     17        the WKPriv.
     18
     19        Remove non-mainframe only references to BackingStoreClient completely,
     20        since it is dead code now.
     21
     22        * Api/InRegionScroller.cpp:
     23        (BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition):
     24        * Api/WebPage.cpp:
     25        (BlackBerry::WebKit::WebPagePrivate::backingStoreClient):
     26        (BlackBerry::WebKit::WebPage::destroy):
     27        * Api/WebPage_p.h:
     28        (WebPagePrivate):
     29        * WebCoreSupport/ChromeClientBlackBerry.cpp:
     30        (WebCore::ChromeClientBlackBerry::invalidateContentsForSlowScroll):
     31        (WebCore::ChromeClientBlackBerry::scroll):
     32        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
     33        (WebCore::FrameLoaderClientBlackBerry::transitionToCommittedForNewPage):
     34        (WebCore::FrameLoaderClientBlackBerry::createFrame):
     35        (WebCore::FrameLoaderClientBlackBerry::detachedFromParent2):
     36        * WebKitSupport/BackingStoreClient.cpp:
     37        (BlackBerry::WebKit::BackingStoreClient::create):
     38        (BlackBerry::WebKit::BackingStoreClient::BackingStoreClient):
     39        (BlackBerry::WebKit::BackingStoreClient::~BackingStoreClient):
     40        * WebKitSupport/BackingStoreClient.h:
     41        (BackingStoreClient):
     42        * WebKitSupport/InputHandler.cpp:
     43        (BlackBerry::WebKit::InputHandler::setBatchEditingActive):
     44
    1452012-10-15  Antonio Gomes  <agomes@rim.com>
    246
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp

    r130400 r131314  
    586586        invalidateContentsAndRootView(updateRect, true /*immediate*/);
    587587    else {
    588         BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_webPagePrivate->m_mainFrame);
    589         ASSERT(backingStoreClientForFrame);
    590         backingStoreClientForFrame->checkOriginOfCurrentScrollOperation();
     588        BackingStoreClient* backingStoreClient = m_webPagePrivate->backingStoreClient();
     589        ASSERT(backingStoreClient);
     590        backingStoreClient->checkOriginOfCurrentScrollOperation();
    591591
    592592        m_webPagePrivate->m_backingStore->d->slowScroll(delta, updateRect, immediate);
     
    602602        return;
    603603
    604     BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_webPagePrivate->m_mainFrame);
    605     ASSERT(backingStoreClientForFrame);
    606     backingStoreClientForFrame->checkOriginOfCurrentScrollOperation();
     604    BackingStoreClient* backingStoreClient = m_webPagePrivate->backingStoreClient();
     605    ASSERT(backingStoreClient);
     606    backingStoreClient->checkOriginOfCurrentScrollOperation();
    607607
    608608    m_webPagePrivate->m_backingStore->d->scroll(delta, scrollViewRect, clipRect);
  • trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp

    r129924 r131314  
    436436    // so we suspend and resume screen update to make sure we do not get a invalid FrameView
    437437    // state.
    438     BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_frame);
    439     if (backingStoreClientForFrame)
    440         backingStoreClientForFrame->backingStore()->d->suspendScreenAndBackingStoreUpdates();
     438    if (isMainFrame() && m_webPagePrivate->backingStoreClient())
     439        m_webPagePrivate->backingStoreClient()->backingStore()->d->suspendScreenAndBackingStoreUpdates();
    441440
    442441    // We are navigating away from this document, so clean up any footprint we might have.
     
    457456                        true);                                 /* lock the mode */
    458457
    459     if (backingStoreClientForFrame)
    460         backingStoreClientForFrame->backingStore()->d->resumeScreenAndBackingStoreUpdates(BackingStore::None);
     458    if (isMainFrame() && m_webPagePrivate->backingStoreClient())
     459        m_webPagePrivate->backingStoreClient()->backingStore()->d->resumeScreenAndBackingStoreUpdates(BackingStore::None);
     460
    461461    m_frame->view()->updateCanHaveScrollbars();
    462462
     
    788788        return 0;
    789789
    790     BackingStoreClient::create(childFrame.get(), m_frame, m_webPagePrivate->m_webPage);
    791 
    792790    m_frame->loader()->loadURLIntoChildFrame(url, referrer, childFrame.get());
    793791
     
    957955void FrameLoaderClientBlackBerry::detachedFromParent2()
    958956{
    959     BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_frame);
    960     if (backingStoreClientForFrame) {
    961         delete backingStoreClientForFrame;
    962         backingStoreClientForFrame = 0;
    963     }
    964 
    965957    if (m_frame->document())
    966958        m_webPagePrivate->clearDocumentData(m_frame->document());
  • trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp

    r131305 r131314  
    5252BackingStoreClient* BackingStoreClient::create(Frame* frame, Frame* parentFrame, WebPage* parentPage)
    5353{
    54     ASSERT(parentPage);
    55     ASSERT(frame->view());
    56 
    57     // FIXME: We do not support inner frames for now.
    58     if (parentFrame)
    59         return 0;
    60 
    61     BackingStoreClient* parentBackingStoreClient
    62         = parentFrame
    63         ? parentPage->d->backingStoreClientForFrame(parentFrame)
    64         : 0;
    65 
    66     // If this frame has a parent with no backingstore then just stop since
    67     // our frame heirarchy is done.
    68     if (parentFrame && !parentBackingStoreClient)
    69         return 0;
    70 
    71     BackingStoreClient* it = new BackingStoreClient(frame, parentFrame, parentPage);
    72     ASSERT(it);
    73 
    74     // Frame -> BackingStoreClient mapping is controlled by the Page.
    75     parentPage->d->addBackingStoreClientForFrame(frame, it);
    76 
    77     // Add the backing store client to the child list of its parent.
    78     if (parentBackingStoreClient)
    79         parentBackingStoreClient->addChild(it);
    80 
     54    ASSERT(!parentFrame);
     55    BackingStoreClient* it = new BackingStoreClient(frame, parentPage);
    8156    return it;
    8257}
    8358
    84 BackingStoreClient::BackingStoreClient(Frame* frame, Frame* parentFrame, WebPage* parentPage)
     59BackingStoreClient::BackingStoreClient(Frame* frame, WebPage* parentPage)
    8560    : m_frame(frame)
    8661    , m_webPage(parentPage)
    8762    , m_backingStore(0)
    88     , m_parent(0)
    8963    , m_isClientGeneratedScroll(false)
    9064    , m_isScrollNotificationSuppressed(false)
    9165{
    92     UNUSED_PARAM(parentFrame);
    9366    m_backingStore = new BackingStore(m_webPage, this);
    9467}
     
    9669BackingStoreClient::~BackingStoreClient()
    9770{
    98     m_webPage->d->removeBackingStoreClientForFrame(m_frame);
    99 
    10071    delete m_backingStore;
    10172    m_backingStore = 0;
    10273    m_frame = 0;
    103 }
    104 
    105 void BackingStoreClient::addChild(BackingStoreClient* child)
    106 {
    107     ASSERT(child);
    108     child->m_parent = this;
    109 }
    110 
    111 WTF::Vector <BackingStoreClient*> BackingStoreClient::children() const
    112 {
    113     WTF::Vector<BackingStoreClient*> children;
    114     for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
    115         BlackBerry::WebKit::BackingStoreClient* client =
    116             m_webPage->d->backingStoreClientForFrame(child);
    117 
    118         if (client)
    119             children.append(client);
    120     }
    121 
    122     return children;
    12374}
    12475
  • trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.h

    r120463 r131314  
    4545    WebCore::Frame* frame() const { return m_frame; }
    4646    bool isMainFrame() const { return m_frame == m_webPage->d->m_mainFrame; }
    47 
    48     void addChild(BackingStoreClient* child);
    49     WTF::Vector <BackingStoreClient*> children() const;
    50     BackingStoreClient* parent() const { return m_parent; }
    5147
    5248    WebCore::IntPoint absoluteLocation() const;
     
    105101
    106102private:
    107     BackingStoreClient(WebCore::Frame*, WebCore::Frame* parentFrame, WebPage* parentPage);
     103    BackingStoreClient(WebCore::Frame*, WebPage* parentPage);
    108104
    109105    WebCore::Frame* m_frame;
    110106    WebPage* m_webPage;
    111107    BackingStore* m_backingStore;
    112     BackingStoreClient* m_parent;
    113108    bool m_isClientGeneratedScroll;
    114109    bool m_isScrollNotificationSuppressed;
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r130990 r131314  
    17461746    // FIXME switch this to m_currentFocusElement->document()->frame() when we have separate
    17471747    // backingstore for each frame.
    1748     BackingStoreClient* backingStoreClientForFrame = m_webPage->backingStoreClientForFrame(m_webPage->mainFrame());
    1749     ASSERT(backingStoreClientForFrame);
     1748    BackingStoreClient* backingStoreClient = m_webPage->backingStoreClient();
     1749    ASSERT(backingStoreClient);
    17501750
    17511751    // Enable / Disable the backingstore to prevent visual updates.
    17521752    if (!active)
    1753         backingStoreClientForFrame->backingStore()->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
     1753        backingStoreClient->backingStore()->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
    17541754    else
    1755         backingStoreClientForFrame->backingStore()->suspendScreenAndBackingStoreUpdates();
     1755        backingStoreClient->backingStore()->suspendScreenAndBackingStoreUpdates();
    17561756
    17571757    return true;
Note: See TracChangeset for help on using the changeset viewer.