coalesce image onload handling

Refine the image onload handling introduced in Idc1e1f21.
It turns out that resizing is pretty slow, and image onload
happens pretty often for threads or messages with lots of images
(pretty common). Rather than immediately handle onload events,
process affected Elements in a deferred handler to coalesce
consecutive onload events. This will also debounce situations
where a single message contains many images, as only one measure
and resize should happen.

Add timing logs to better diagnose conversation load issues.

Bug: 7278331
Change-Id: I252cee9c69955d993aea20379fcdc0beb973e372
2 files changed