Title: [245355] branches/safari-607-branch/Source/WebKit
Revision
245355
Author
[email protected]
Date
2019-05-15 14:45:02 -0700 (Wed, 15 May 2019)

Log 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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (245354 => 245355)


--- branches/safari-607-branch/Source/WebKit/ChangeLog	2019-05-15 21:45:00 UTC (rev 245354)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog	2019-05-15 21:45:02 UTC (rev 245355)
@@ -1,5 +1,39 @@
 2019-05-14  Kocsen Chung  <[email protected]>
 
+        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
+
+    2019-05-10  Brent Fulgham  <[email protected]>
+
+            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):
+
+2019-05-14  Kocsen Chung  <[email protected]>
+
         Cherry-pick r239742. rdar://problem/50753925
 
     Prevent cross-site top-level navigations from third-party iframes

Modified: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (245354 => 245355)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-05-15 21:45:00 UTC (rev 245354)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-05-15 21:45:02 UTC (rev 245355)
@@ -4124,11 +4124,8 @@
 #if ENABLE(CONTEXT_MENUS)
 void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item)
 {
-    if (!m_contextMenu)
-        return;
-
-    m_contextMenu->itemSelected(item);
-    m_contextMenu = nullptr;
+    if (auto contextMenu = std::exchange(m_contextMenu, nullptr))
+        contextMenu->itemSelected(item);
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to