Closed Bug 1224454 Opened 9 years ago Closed 9 years ago

[e10s][IMM][TSF] IMMHandler and TSFTextStore should clean up itself when focused widget being destroyed before NOTIFY_IME_OF_BLUR

Categories

(Core :: Widget: Win32, defect)

x86
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod)

Attachments

(2 files)

In e10s mode, the parent process's widget may be destroyed before it receives NOTIFY_IME_OF_BLUR. In such case, IMMHandler and TSFTextStore should release the reference and don't keep active composition.
Blocks: 1222092
No longer depends on: 1222092
Status: NEW → ASSIGNED
In e10s mode, NOTIFY_IME_OF_BLUR won't reach to native IME handler when focused element is in a remote process and its parent window is closed by "X" button.

Therefore, when focused window is being destroyed, IMEHandler should generate NOTIFY_IME_OF_BLUR for cleaning up IMMHandler and/or TSFTextStore which believes IME still has focus.
Attachment #8688227 - Flags: review?(m_kato)
IMMHandler does do nothing when focused editor is changed but it stores a pointer to nsWindow which has composition. So, if there is composition on the destroying window, IMMHandler should cancel its composition but shouldn't dispatch any composition events on the widget.
Attachment #8688228 - Flags: review?(m_kato)
Although, I cannot test if these patch are enough to fix all memory leak at shutting down because debug build crashes at shutting down the process on my environment.

Assertion failure: isEmpty(), at a:\mozilla\mc-b\fx64-dbg\dist\include\mozilla/LinkedList.h:328
>	xul.dll!mozilla::LinkedList<js::WeakMapBase>::~LinkedList<js::WeakMapBase>() Line 328	C++
>  	xul.dll!JS::Zone::~Zone() Line 64	C++
>  	xul.dll!js::gc::GCRuntime::sweepZones(js::FreeOp * fop, bool destroyingRuntime) Line 3753	C++
>  	xul.dll!js::gc::GCRuntime::endSweepPhase(bool destroyingRuntime) Line 5579	C++
>  	xul.dll!js::gc::GCRuntime::incrementalCollectSlice(js::SliceBudget & budget, JS::gcreason::Reason reason) Line 6087	C++
>  	xul.dll!js::gc::GCRuntime::gcCycle(bool nonincrementalByAPI, js::SliceBudget & budget, JS::gcreason::Reason reason) Line 6276	C++
>  	xul.dll!js::gc::GCRuntime::collect(bool nonincrementalByAPI, js::SliceBudget budget, JS::gcreason::Reason reason) Line 6382	C++
>  	xul.dll!js::gc::GCRuntime::gc(JSGCInvocationKind gckind, JS::gcreason::Reason reason) Line 6438	C++
>  	xul.dll!JSRuntime::~JSRuntime() Line 417	C++
>  	xul.dll!JS_DestroyRuntime(JSRuntime * rt) Line 480	C++
>  	xul.dll!mozilla::CycleCollectedJSRuntime::~CycleCollectedJSRuntime() Line 464	C++
>  	[External Code]	
>  	xul.dll!nsXPConnect::~nsXPConnect() Line 101	C++
>  	xul.dll!nsXPConnect::Release() Line 39	C++
>  	xul.dll!nsXPConnect::ReleaseXPConnectSingleton() Line 149	C++
>  	xul.dll!xpcModuleDtor() Line 24	C++
Attachment #8688227 - Flags: review?(m_kato) → review+
Attachment #8688228 - Flags: review?(m_kato) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d6526066ab972b19bd54598f37b274a35a5f636
Bug 1224454 part.1 IMEHandler should generate NOTIFY_IME_OF_BLUR in e10s mode if the focused widget is being destroyed before receiving NOTIFY_IME_OF_BLUR r=m_kato

https://hg.mozilla.org/integration/mozilla-inbound/rev/d46495734a544e4dd1ee90e02acdc6bb06357e87
Bug 1224454 part.2 IMMHandler::OnFocusChange() should cancel remaining composition when given nsWindow is being destroyed r=m_kato
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: