Backed out changeset e3e129629026 (bug 1325676) for asserting in nsWindow.cpp on Windows 8 x64 debug. r=backout

This commit is contained in:
Sebastian Hengst 2017-01-03 22:36:22 +01:00
Родитель 826502ca19
Коммит 15a47f6130
2 изменённых файлов: 7 добавлений и 42 удалений

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

@ -167,7 +167,6 @@ int main()
#ifdef _M_X64
TestHook("user32.dll", "GetKeyState") &&
#endif
TestHook("user32.dll", "SetWinEventHook") &&
TestDetour("ntdll.dll", "LdrLoadDll")) {
printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");
return 0;

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

@ -346,9 +346,6 @@ DWORD CurrentWindowsTimeGetter::sLastPostTime = 0;
* raise a flag that blocks a11y before invoking CallNextHookEx which will then
* invoke the global tiptsf hook. Then when we see WM_GETOBJECT, we check the
* flag by calling TIPMessageHandler::IsA11yBlocked().
*
* For Windows 8, we also hook tiptsf!ProcessCaretEvents, which is an a11y hook
* function that also calls into UIA.
*/
class TIPMessageHandler
{
@ -363,16 +360,13 @@ public:
static void Initialize()
{
MOZ_ASSERT(!sInstance);
if (!IsWin8OrLater()) {
return;
}
sInstance = new TIPMessageHandler();
ClearOnShutdown(&sInstance);
}
static bool IsA11yBlocked()
{
MOZ_ASSERT(sInstance);
if (!sInstance) {
return false;
}
@ -399,15 +393,6 @@ private:
mHook = ::SetWindowsHookEx(WH_GETMESSAGE, &TIPHook, nullptr,
::GetCurrentThreadId());
MOZ_ASSERT(mHook);
if (!IsWin10OrLater()) {
// tiptsf loads when STA COM is first initialized, so it should be present
sTipTsfInterceptor.Init("tiptsf.dll");
DebugOnly<bool> ok = sTipTsfInterceptor.AddHook("ProcessCaretEvents",
reinterpret_cast<intptr_t>(&ProcessCaretEventsHook),
(void**) &sProcessCaretEventsStub);
MOZ_ASSERT(ok);
}
}
class MOZ_RAII A11yInstantiationBlocker
@ -415,18 +400,14 @@ private:
public:
A11yInstantiationBlocker()
{
if (!TIPMessageHandler::sInstance) {
return;
}
MOZ_ASSERT(TIPMessageHandler::sInstance);
++TIPMessageHandler::sInstance->mA11yBlockCount;
}
~A11yInstantiationBlocker()
{
if (!TIPMessageHandler::sInstance) {
return;
}
MOZ_ASSERT(TIPMessageHandler::sInstance->mA11yBlockCount > 0);
MOZ_ASSERT(TIPMessageHandler::sInstance &&
TIPMessageHandler::sInstance->mA11yBlockCount > 0);
--TIPMessageHandler::sInstance->mA11yBlockCount;
}
};
@ -452,29 +433,14 @@ private:
return ::CallNextHookEx(nullptr, aCode, aWParam, aLParam);
}
static void CALLBACK ProcessCaretEventsHook(HWINEVENTHOOK aWinEventHook,
DWORD aEvent, HWND aHwnd,
LONG aObjectId, LONG aChildId,
DWORD aGeneratingTid,
DWORD aEventTime)
{
A11yInstantiationBlocker block;
sProcessCaretEventsStub(aWinEventHook, aEvent, aHwnd, aObjectId, aChildId,
aGeneratingTid, aEventTime);
}
static StaticAutoPtr<TIPMessageHandler> sInstance;
static WindowsDllInterceptor sTipTsfInterceptor;
static WINEVENTPROC sProcessCaretEventsStub;
HHOOK mHook;
UINT mMessages[7];
uint32_t mA11yBlockCount;
HHOOK mHook;
UINT mMessages[7];
uint32_t mA11yBlockCount;
};
StaticAutoPtr<TIPMessageHandler> TIPMessageHandler::sInstance;
WindowsDllInterceptor TIPMessageHandler::sTipTsfInterceptor;
WINEVENTPROC TIPMessageHandler::sProcessCaretEventsStub;
#endif // defined(ACCESSIBILITY)