Moving the COM processing to a background thread

Avoid to process COM events when the input method class for windows is
in the process of been destructed, we should create an inner class that
moves the COM processing to a background thread, which controls the
lifetime of all the COM objects.

Bug: 852386, 497381
Change-Id: Ia2517fb8ad813924d45ce58535b09360114d2f30
Reviewed-on: https://chromium-review.googlesource.com/c/1258182
Commit-Queue: Lan Wei <lanwei@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622887}
3 files changed