Bug 1539581 - Cleanup use of RegisterWindowMessgae in nsAppShell. r=bobowen

Differential Revision: https://phabricator.services.mozilla.com/D25235

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jim Mathies 2019-04-01 16:53:04 +00:00
Родитель e7c6257344
Коммит 3a40fd71ea
2 изменённых файлов: 13 добавлений и 14 удалений

Просмотреть файл

@ -76,12 +76,8 @@ using namespace mozilla::ipc::windows;
extern const wchar_t* kPropNameTabContent;
#endif
// widget related message id constants we need to defer
namespace mozilla {
namespace widget {
// widget related message id constants we need to defer, see nsAppShell.
extern UINT sAppShellGeckoMsgId;
}
} // namespace mozilla
namespace {
@ -390,7 +386,7 @@ ProcessOrDeferMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
default: {
// Unknown messages only are logged in debug builds and sent to
// DefWindowProc.
if (uMsg && uMsg == mozilla::widget::sAppShellGeckoMsgId) {
if (uMsg && uMsg == sAppShellGeckoMsgId) {
// Widget's registered native event callback
deferred = new DeferredSendMessage(hwnd, uMsg, wParam, lParam);
}

Просмотреть файл

@ -157,13 +157,11 @@ SingleNativeEventPump::AfterProcessNextEvent(nsIThreadInternal* aThread,
return NS_OK;
}
namespace mozilla {
namespace widget {
// Native event callback message.
UINT sAppShellGeckoMsgId = RegisterWindowMessageW(L"nsAppShell:EventID");
} // namespace widget
} // namespace mozilla
// RegisterWindowMessage values
// Native event callback message
const wchar_t* kAppShellGeckoEventId = L"nsAppShell:EventID";
UINT sAppShellGeckoMsgId;
// Taskbar button creation message
const wchar_t* kTaskbarButtonEventId = L"TaskbarButtonCreated";
UINT sTaskbarButtonCreatedMsg;
@ -331,8 +329,13 @@ nsresult nsAppShell::Init() {
// The hidden message window is used for interrupting the processing of native
// events, so that we can process gecko events. Therefore, we only need it if
// we are processing native events.
// we are processing native events. Disabling this is required for win32k
// syscall lockdown.
if (XRE_UseNativeEventProcessing()) {
sAppShellGeckoMsgId = ::RegisterWindowMessageW(kAppShellGeckoEventId);
NS_ASSERTION(sAppShellGeckoMsgId,
"Could not register hidden window event message!");
mLastNativeEventScheduled = TimeStamp::NowLoRes();
WNDCLASSW wc;