зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1589497 - Make PendingAction of TSFStore copy of key message r=m_kato
`TSFTextStore::sHandlingKeyMsg` refers pointer of struct, but referred via `TSFTextStore::PendingAction` so that we should make it has a copy of `sHandlingKeyMsg` because of for async handling. Differential Revision: https://phabricator.services.mozilla.com/D68049 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
a67aefcc66
Коммит
3fd73c16fb
|
@ -1560,8 +1560,10 @@ void NativeKey::InitWithKeyOrChar() {
|
|||
ComputeVirtualKeyCodeFromScanCodeEx();
|
||||
NS_ASSERTION(mVirtualKeyCode, "Failed to compute virtual keycode");
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unsupported message");
|
||||
default: {
|
||||
MOZ_CRASH_UNSAFE_PRINTF("Unsupported message: 0x%04X", mMsg.message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mVirtualKeyCode) {
|
||||
|
|
|
@ -2341,15 +2341,15 @@ void TSFTextStore::FlushPendingActions() {
|
|||
switch (action.mType) {
|
||||
case PendingAction::Type::eKeyboardEvent:
|
||||
if (mDestroyed) {
|
||||
MOZ_LOG(
|
||||
sTextStoreLog, LogLevel::Warning,
|
||||
("0x%p TSFTextStore::FlushPendingActions() "
|
||||
"IGNORED pending KeyboardEvent(%s) due to already destroyed",
|
||||
action.mKeyMsg->message == WM_KEYDOWN ? "eKeyDown" : "eKeyUp",
|
||||
this));
|
||||
MOZ_LOG(sTextStoreLog, LogLevel::Warning,
|
||||
("0x%p TSFTextStore::FlushPendingActions() "
|
||||
"IGNORED pending KeyboardEvent(%s) due to already destroyed",
|
||||
action.mKeyMsg.message == WM_KEYDOWN ? "eKeyDown" : "eKeyUp",
|
||||
this));
|
||||
}
|
||||
MOZ_DIAGNOSTIC_ASSERT(action.mKeyMsg);
|
||||
DispatchKeyboardEventAsProcessedByIME(*action.mKeyMsg);
|
||||
MOZ_DIAGNOSTIC_ASSERT(action.mKeyMsg.message == WM_KEYDOWN ||
|
||||
action.mKeyMsg.message == WM_KEYUP);
|
||||
DispatchKeyboardEventAsProcessedByIME(action.mKeyMsg);
|
||||
if (!widget || widget->Destroyed()) {
|
||||
break;
|
||||
}
|
||||
|
@ -2665,7 +2665,7 @@ void TSFTextStore::MaybeDispatchKeyboardEventAsProcessedByIME() {
|
|||
this));
|
||||
PendingAction* action = mPendingActions.AppendElement();
|
||||
action->mType = PendingAction::Type::eKeyboardEvent;
|
||||
action->mKeyMsg = sHandlingKeyMsg;
|
||||
memcpy(&action->mKeyMsg, sHandlingKeyMsg, sizeof(MSG));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -679,7 +679,7 @@ class TSFTextStore final : public ITextStoreACP,
|
|||
// For eCompositionUpdate
|
||||
RefPtr<TextRangeArray> mRanges;
|
||||
// For eKeyboardEvent
|
||||
const MSG* mKeyMsg;
|
||||
MSG mKeyMsg;
|
||||
// For eSetSelection
|
||||
bool mSelectionReversed;
|
||||
// For eCompositionUpdate
|
||||
|
|
Загрузка…
Ссылка в новой задаче