Changeset 79867 in webkit


Ignore:
Timestamp:
Feb 28, 2011 8:35:32 AM (13 years ago)
Author:
Adam Roben
Message:

Decouple state changes from sending of UpdateState messages in DrawingAreaProxyImpl

The new DrawingAreaProxyImpl::stateDidChange function should be called whenever
DrawingAreaProxyImpl's state changes in a way that will require allocating a new backing
store. (Currently, this is just when the size changes.) This function will sometimes (but
not always, as when we're waiting for a DidUpdateState message) send an UpdateState message
to the web process. This means it's now possible for the state IDs sent in consecutive
UpdateState messages to increase by more than one, but that's OK.

This should cause no change in behavior.

Fixes <http://webkit.org/b/55382> DrawingAreaProxyImpl's state ID should be updated whenever
its state changes, not just when we send an UpdateState message

Reviewed by Anders Carlsson.

  • UIProcess/DrawingAreaProxyImpl.cpp:

(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Updated for rename.
(WebKit::DrawingAreaProxyImpl::sizeDidChange): Changed to call stateDidChange.
(WebKit::DrawingAreaProxyImpl::didUpdateState): Updated for rename, and changed to call
sendUpdateState whenever our state has changed for any reason since the last UpdateState
message was sent.
(WebKit::DrawingAreaProxyImpl::stateDidChange): Added. Increments m_nextStateID and calls
through to sendUpdateState.
(WebKit::DrawingAreaProxyImpl::sendUpdateState): Updated for rename, moved incrementing of
the state ID we send to the web process from here to stateDidChange, and added an assertion.

  • UIProcess/DrawingAreaProxyImpl.h: Renamed m_requestedStateID to m_nextStateID, and updated

the comment explaining its meaning.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r79863 r79867  
     12011-02-28  Adam Roben  <aroben@apple.com>
     2
     3        Decouple state changes from sending of UpdateState messages in DrawingAreaProxyImpl
     4
     5        The new DrawingAreaProxyImpl::stateDidChange function should be called whenever
     6        DrawingAreaProxyImpl's state changes in a way that will require allocating a new backing
     7        store. (Currently, this is just when the size changes.) This function will sometimes (but
     8        not always, as when we're waiting for a DidUpdateState message) send an UpdateState message
     9        to the web process. This means it's now possible for the state IDs sent in consecutive
     10        UpdateState messages to increase by more than one, but that's OK.
     11
     12        This should cause no change in behavior.
     13
     14        Fixes <http://webkit.org/b/55382> DrawingAreaProxyImpl's state ID should be updated whenever
     15        its state changes, not just when we send an UpdateState message
     16
     17        Reviewed by Anders Carlsson.
     18
     19        * UIProcess/DrawingAreaProxyImpl.cpp:
     20        (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Updated for rename.
     21        (WebKit::DrawingAreaProxyImpl::sizeDidChange): Changed to call stateDidChange.
     22        (WebKit::DrawingAreaProxyImpl::didUpdateState): Updated for rename, and changed to call
     23        sendUpdateState whenever our state has changed for any reason since the last UpdateState
     24        message was sent.
     25        (WebKit::DrawingAreaProxyImpl::stateDidChange): Added. Increments m_nextStateID and calls
     26        through to sendUpdateState.
     27        (WebKit::DrawingAreaProxyImpl::sendUpdateState): Updated for rename, moved incrementing of
     28        the state ID we send to the web process from here to stateDidChange, and added an assertion.
     29
     30        * UIProcess/DrawingAreaProxyImpl.h: Renamed m_requestedStateID to m_nextStateID, and updated
     31        the comment explaining its meaning.
     32
    1332011-02-28  Adam Roben  <aroben@apple.com>
    234
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp

    r79803 r79867  
    5151    : DrawingAreaProxy(DrawingAreaTypeImpl, webPageProxy)
    5252    , m_currentStateID(0)
    53     , m_requestedStateID(0)
     53    , m_nextStateID(0)
    5454    , m_isWaitingForDidUpdateState(false)
    5555{
     
    104104void DrawingAreaProxyImpl::sizeDidChange()
    105105{
    106     sendUpdateState();
     106    stateDidChange();
    107107}
    108108
     
    137137void DrawingAreaProxyImpl::didUpdateState(uint64_t stateID, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext)
    138138{
    139     ASSERT_ARG(stateID, stateID <= m_requestedStateID);
     139    ASSERT_ARG(stateID, stateID <= m_nextStateID);
    140140    ASSERT_ARG(stateID, stateID > m_currentStateID);
    141141    m_currentStateID = stateID;
     
    144144    m_isWaitingForDidUpdateState = false;
    145145
    146     if (m_size != updateInfo.viewSize)
     146    if (m_nextStateID != m_currentStateID)
    147147        sendUpdateState();
    148148
     
    215215}
    216216
     217void DrawingAreaProxyImpl::stateDidChange()
     218{
     219    ++m_nextStateID;
     220    sendUpdateState();
     221}
     222
    217223void DrawingAreaProxyImpl::sendUpdateState()
    218224{
     225    ASSERT(m_currentStateID < m_nextStateID);
     226
    219227    if (!m_webPageProxy->isValid())
    220228        return;
     
    224232
    225233    m_isWaitingForDidUpdateState = true;
    226     m_webPageProxy->process()->send(Messages::DrawingArea::UpdateState(++m_requestedStateID, m_size, m_scrollOffset), m_webPageProxy->pageID());
     234    m_webPageProxy->process()->send(Messages::DrawingArea::UpdateState(m_nextStateID, m_size, m_scrollOffset), m_webPageProxy->pageID());
    227235    m_scrollOffset = IntSize();
    228236
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h

    r79803 r79867  
    6262
    6363    void incorporateUpdate(const UpdateInfo&);
     64
     65    void stateDidChange();
    6466    void sendUpdateState();
    6567    void waitForAndDispatchDidUpdateState();
     
    7577    uint64_t m_currentStateID;
    7678
    77     // The state ID we most recently requested the web process update to. Incremented whenever we
    78     // send an UpdateState message to the web process to tell it we need to allocate a new backing
    79     // store.
    80     uint64_t m_requestedStateID;
     79    // The next state ID we will request the web process update to. Incremented whenever our state
     80    // changes in a way that will require a new backing store to be allocated.
     81    uint64_t m_nextStateID;
    8182
    8283    // The current layer tree context.
Note: See TracChangeset for help on using the changeset viewer.