mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1793834 - part 2/12: also log HWND in message logs r=handyman
This is helpful for the normal event log, and also necessary since we want to group the messages up by window in the about page. Differential Revision: https://phabricator.services.mozilla.com/D161149
This commit is contained in:
parent
0e9cbaa4d2
commit
9f26e06933
@ -5174,7 +5174,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
||||
LRESULT* aRetValue) {
|
||||
// For some events we might change the parameter values, so log
|
||||
// before and after we process them.
|
||||
PrintEvent printEvent(msg, wParam, lParam, *aRetValue);
|
||||
PrintEvent printEvent(mWnd, msg, wParam, lParam, *aRetValue);
|
||||
bool result = ProcessMessageInternal(msg, wParam, lParam, aRetValue);
|
||||
printEvent.SetResult(result);
|
||||
|
||||
|
@ -39,8 +39,10 @@ std::unordered_set<UINT> gEventsToLogOriginalParams = {
|
||||
WM_GETTEXT, WM_GETMINMAXINFO, WM_MEASUREITEM,
|
||||
};
|
||||
|
||||
PrintEvent::PrintEvent(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT retValue)
|
||||
: mMsg(msg),
|
||||
PrintEvent::PrintEvent(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
|
||||
LRESULT retValue)
|
||||
: mHwnd(hwnd),
|
||||
mMsg(msg),
|
||||
mWParam(wParam),
|
||||
mLParam(lParam),
|
||||
mRetValue(retValue),
|
||||
@ -189,8 +191,9 @@ bool PrintEvent::PrintEventInternal() {
|
||||
: "initial call";
|
||||
MOZ_LOG(
|
||||
gWindowsEventLog, LogLevel::Info,
|
||||
("%6ld - 0x%04X %s %s: 0x%08llX (%s)\n",
|
||||
mEventCounter.valueOr(gEventCounter), mMsg, paramInfo.get(),
|
||||
("%6ld 0x%08llX - 0x%04X %s %s: 0x%08llX (%s)\n",
|
||||
mEventCounter.valueOr(gEventCounter),
|
||||
reinterpret_cast<uint64_t>(mHwnd), mMsg, paramInfo.get(),
|
||||
msgText ? msgText : "Unknown",
|
||||
mResult.isSome() ? static_cast<uint64_t>(mRetValue) : 0, resultMsg));
|
||||
gLastEventMsg = mMsg;
|
||||
|
@ -43,12 +43,14 @@ extern std::unordered_map<UINT, EventMsgInfo> gAllEvents;
|
||||
// RAII-style class to log before and after an event is handled.
|
||||
class PrintEvent final {
|
||||
public:
|
||||
PrintEvent(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT retValue);
|
||||
PrintEvent(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
|
||||
LRESULT retValue);
|
||||
void SetResult(bool result) { mResult = mozilla::Some(result); }
|
||||
~PrintEvent();
|
||||
|
||||
private:
|
||||
bool PrintEventInternal();
|
||||
const HWND mHwnd;
|
||||
const UINT mMsg;
|
||||
const WPARAM mWParam;
|
||||
const LPARAM mLParam;
|
||||
|
Loading…
Reference in New Issue
Block a user