Throttle DownloadDB updates

This CL stops DownloadDBCache to immediately updating the DB.
Instead, it caches the change and only update the DB when timer fires.
Some of the updates are considered high priority and will thus
flush to DB immediately.

Bug: 850990
Change-Id: I124ac1c69e5c7e6bd609d656be3ac1a938f78c63
Reviewed-on: https://chromium-review.googlesource.com/1102084
Reviewed-by: David Trainor <[email protected]>
Commit-Queue: Min Qin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#569736}
6 files changed