Push event handling failures up the stack, clear the client early.

Have RenderWidget clear itself as the MainThreadEventQueue client when
it is closing, in OnClose(). The queue already deals with trying to
handle an event when the client is gone.

However, it does not deal with the fact that when not handling the event
it must still run the mojo reply callback or suffer the wrath of a
DCHECK.

RenderWidget does deal with this fact already. But instead of dealing
with this callback behaviour at multiple levels, have the handle
methods return a boolean back up to Dispatch(), where if it gets
false it can run HandledEvent() with the failure args from a single
place.

Remove the closing early outs for MainThreadEventQueue methods in
RenderWidget.

R=bokan@chromium.org

Change-Id: I0f836ed4df801ce470afb10894c9c3caa70c5711
Bug: 912193
Reviewed-on: https://chromium-review.googlesource.com/c/1435520
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626269}
5 files changed