⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245355 in webkit


Ignore:
Timestamp:
May 15, 2019, 2:45:02 PM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r245196. rdar://problem/50753938

Streamline test-and-clear operation for ContextMenu
https://bugs.webkit.org/show_bug.cgi?id=197795
<rdar://problem/50473746>

Reviewed by Wenson Hsieh.

Rather than performing a check when entering the function, doing work,
then clearing the member variable, perform the check and clear in
a single operation. Only perform the selection if the menu exists.

  • WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didSelectItemFromActiveContextMenu):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/Source/WebKit/ChangeLog

    r245346 r245355  
     12019-05-14  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r245196. rdar://problem/50753938
     4
     5    Streamline test-and-clear operation for ContextMenu
     6    https://bugs.webkit.org/show_bug.cgi?id=197795
     7    <rdar://problem/50473746>
     8   
     9    Reviewed by Wenson Hsieh.
     10   
     11    Rather than performing a check when entering the function, doing work,
     12    then clearing the member variable, perform the check and clear in
     13    a single operation. Only perform the selection if the menu exists.
     14   
     15    * WebProcess/WebPage/WebPage.cpp:
     16    (WebKit::WebPage::didSelectItemFromActiveContextMenu):
     17   
     18    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     19
     20    2019-05-10  Brent Fulgham  <bfulgham@apple.com>
     21
     22            Streamline test-and-clear operation for ContextMenu
     23            https://bugs.webkit.org/show_bug.cgi?id=197795
     24            <rdar://problem/50473746>
     25
     26            Reviewed by Wenson Hsieh.
     27
     28            Rather than performing a check when entering the function, doing work,
     29            then clearing the member variable, perform the check and clear in
     30            a single operation. Only perform the selection if the menu exists.
     31
     32            * WebProcess/WebPage/WebPage.cpp:
     33            (WebKit::WebPage::didSelectItemFromActiveContextMenu):
     34
    1352019-05-14  Kocsen Chung  <kocsen_chung@apple.com>
    236
  • branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r243097 r245355  
    41254125void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item)
    41264126{
    4127     if (!m_contextMenu)
    4128         return;
    4129 
    4130     m_contextMenu->itemSelected(item);
    4131     m_contextMenu = nullptr;
     4127    if (auto contextMenu = std::exchange(m_contextMenu, nullptr))
     4128        contextMenu->itemSelected(item);
    41324129}
    41334130#endif
Note: See TracChangeset for help on using the changeset viewer.