ServiceWorker: Consolidate version manipulation functions in SWProviderContext
This is a preparation patch for exposing SWRegistration object into
SWGlobalScope.
According to the design doc[1], we're going to make SWProviderContext
thread-safe using the lock mechanism so that the worker thread can also
use the context.
But, in the current implementation, functions to manipulate versions
(eg. OnSetInstallingServiceWorker()) are fine-grained and they can be
interleaved from multiple threads if we naively use the lock on a per
function basis. To avoid the situation, this CL consolidates those
functions as SetVersionAttributes() and makes it easier to protect by lock.
[1] https://docs.google.com/document/d/1qDGbMlwKOXxCRBlw9IirK8Qmna3JqvnO3Aogkfu9UJQ/edit?usp=sharing
BUG=437677
TEST=run-webkit-tests http/tests/serviceworker/
Review URL: https://codereview.chromium.org/
849203002
Cr-Commit-Position: refs/heads/master@{#311822}