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

Changeset 245451 in webkit


Ignore:
Timestamp:
May 17, 2019, 4:25:06 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r245196 - 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):

Location:
releases/WebKitGTK/webkit-2.24/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog

    r245440 r245451  
     12019-05-10  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Streamline test-and-clear operation for ContextMenu
     4        https://bugs.webkit.org/show_bug.cgi?id=197795
     5        <rdar://problem/50473746>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Rather than performing a check when entering the function, doing work,
     10        then clearing the member variable, perform the check and clear in
     11        a single operation. Only perform the selection if the menu exists.
     12
     13        * WebProcess/WebPage/WebPage.cpp:
     14        (WebKit::WebPage::didSelectItemFromActiveContextMenu):
     15
    1162019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
    217
  • releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r243981 r245451  
    41374137void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item)
    41384138{
    4139     if (!m_contextMenu)
    4140         return;
    4141 
    4142     m_contextMenu->itemSelected(item);
    4143     m_contextMenu = nullptr;
     4139    if (auto contextMenu = std::exchange(m_contextMenu, nullptr))
     4140        contextMenu->itemSelected(item);
    41444141}
    41454142#endif
Note: See TracChangeset for help on using the changeset viewer.