Compute the revalidation based on the stale-while-revalidate attribute.

Add additional API to determine if we should revalidate if we are allowing
a stale response. Add a test to cover the different intervals of what
should be returned by the API.

BUG=348877

Change-Id: I69be1c768e4896362406bb80a3dde307edae27d2
Reviewed-on: https://chromium-review.googlesource.com/1102352
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569263}
6 files changed