Merge sync and async code paths for getting context menus
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 19:22:46 +0000 (19:22 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 19:22:46 +0000 (19:22 +0000)
commit290a9bbbc8223d1c0693484649732b44a75b8e0e
treefe87aa2b90914f4b1163096979f863ac04a48906
parentcc3f4e62dddc1408035ef12fcbeec33dcaac7d9b
Merge sync and async code paths for getting context menus
https://bugs.webkit.org/show_bug.cgi?id=181423

Reviewed by Joseph Pecoraro.

What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!

* UIProcess/API/APIContextMenuClient.h:
(API::ContextMenuClient::getContextMenuFromProposedMenu):
(API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageContextMenuClient):
* UIProcess/API/glib/WebKitContextMenuClient.cpp:
* UIProcess/WebContextMenuProxy.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::show):
(WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
* UIProcess/gtk/WebContextMenuProxyGtk.h:
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/wpe/WebContextMenuProxyWPE.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/PlatformMac.cmake
Source/WebKit/UIProcess/API/APIContextMenuClient.h
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/glib/WebKitContextMenuClient.cpp
Source/WebKit/UIProcess/WebContextMenuProxy.h
Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.h
Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h
Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
Source/WebKit/UIProcess/wpe/WebContextMenuProxyWPE.h