Make OffscreenCanvas histogram thread safe

In OffscreenCanvasFrameDispatcherImpl::dispatchFrame, we have a timer
histogram at the end of this function which uses DEFINE_STATIC_LOCAL. This
is not thread safe in the cases where multiple worker commit at the same
time. This CL makes the timer histogram thread safe.

A layout test has been added to make sure that the test doesn't crash.

BUG=663916

Review-Url: https://codereview.chromium.org/2502853003
Cr-Commit-Position: refs/heads/master@{#432333}
2 files changed