Add SlidingAverage to FPSMeter, use for WebVR prediction time

Refactor FPSMeter to extract the "sliding window sum" code
into a separate class, use it in FPSMeter, and separately
use it to implement a SlidingAverage class.

This revealed a pre-existing bug where current_index_ was
not being initialized, leading to wrong FPS calculations.

Use SlidingAverage to calculate WebVR Javascript and rendering
times, and use those to calculate the prediction time offset
for GVR poses instead of hardcoding 50ms for this.

BUG=723962

Review-Url: https://codereview.chromium.org/2901213002
Cr-Commit-Position: refs/heads/master@{#474549}
7 files changed