Changeset 247396 in webkit


Ignore:
Timestamp:
Jul 12, 2019 1:58:43 PM (5 years ago)
Author:
Michael Catanzaro
Message:

WebBackForwardListItem::setPageState should receive pageState by rvalue reference
https://bugs.webkit.org/show_bug.cgi?id=199535

Reviewed by Alex Christensen

Coverity is complaining here about copying PageState by value in the parameter list. It's
sort of a false positive, in that the PageState really does need to be copied here, so this
is the best we can do. But pass by value and then WTFMove() is a pretty strange way to write
it. Passing by rvalue reference would be better. This makes the copy more clear.

  • Shared/WebBackForwardListItem.h:

(WebKit::WebBackForwardListItem::setPageState):

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::updateBackForwardItem):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r247395 r247396  
     12019-07-12  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        WebBackForwardListItem::setPageState should receive pageState by rvalue reference
     4        https://bugs.webkit.org/show_bug.cgi?id=199535
     5
     6        Reviewed by Alex Christensen
     7
     8        Coverity is complaining here about copying PageState by value in the parameter list. It's
     9        sort of a false positive, in that the PageState really does need to be copied here, so this
     10        is the best we can do. But pass by value and then WTFMove() is a pretty strange way to write
     11        it. Passing by rvalue reference would be better. This makes the copy more clear.
     12
     13        * Shared/WebBackForwardListItem.h:
     14        (WebKit::WebBackForwardListItem::setPageState):
     15        * UIProcess/WebProcessProxy.cpp:
     16        (WebKit::WebProcessProxy::updateBackForwardItem):
     17
    1182019-07-12  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebKit/Shared/WebBackForwardListItem.h

    r246694 r247396  
    6161    void setLastProcessIdentifier(const WebCore::ProcessIdentifier& identifier) { m_lastProcessIdentifier = identifier; }
    6262
    63     void setPageState(PageState pageState) { m_itemState.pageState = WTFMove(pageState); }
     63    void setPageState(PageState&& pageState) { m_itemState.pageState = WTFMove(pageState); }
    6464    const PageState& pageState() const { return m_itemState.pageState; }
    6565
  • trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp

    r247146 r247396  
    593593        return;
    594594
    595     item->setPageState(itemState.pageState);
     595    item->setPageState(PageState { itemState.pageState });
    596596}
    597597
Note: See TracChangeset for help on using the changeset viewer.