Bug 1189709 - Reduce scope of MessageChannel window neutering. r=jimm

CLOSED TREE
This commit is contained in:
Aaron Klotz
2015-08-26 15:57:29 -06:00
parent 92b20d51ec
commit 32c8b8dbe2
2 changed files with 17 additions and 6 deletions

View File

@@ -894,10 +894,10 @@ StopNeutering()
}
NeuteredWindowRegion::NeuteredWindowRegion(bool aDoNeuter MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
: mNeuteredByThis(!gWindowHook)
: mNeuteredByThis(!gWindowHook && aDoNeuter)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
if (aDoNeuter && mNeuteredByThis) {
if (mNeuteredByThis) {
StartNeutering();
}
}
@@ -912,6 +912,11 @@ NeuteredWindowRegion::~NeuteredWindowRegion()
void
NeuteredWindowRegion::PumpOnce()
{
if (!gWindowHook) {
// This should be a no-op if nothing has been neutered.
return;
}
MSG msg = {0};
// Pump any COM messages so that we don't hang due to STA marshaling.
if (gCOMWindow && ::PeekMessageW(&msg, gCOMWindow, 0, 0, PM_REMOVE)) {