Refactor chrome://system to load logs async

Previously, chrome://system would fetch logs (which is a multi-second process),
and wait until the logs were returned to template and render the html. This
meant there was a multiple second delay with a blank screen while the browser
waited. Further, the javascript was very inefficient in how it interacted with
the DOM, so rendering took another ~10 seconds.

This change refactors the logic in system_info_ui.cc so that it will
return HTML immediately, display a loading indicator, and then insert
the logs into the page efficiently once they've been fetched.

It also has the benefit of speeding up page load. On a test device,
page load (from refresh to all logs visible) took about 10 seconds,
compared to 20+ before.

BUG=chromium:657156
TEST=run on chromeOS device and load chrome://system

Change-Id: I5d7f259fb4fdf4b8bf994bbaa3c1c2a131e422ae
Reviewed-on: https://chromium-review.googlesource.com/c/1469288
Commit-Queue: Fletcher Woodruff <fletcherw@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631881}
5 files changed