This CL adds a new class HttpCache::Writers which will implement multiple cache
transactions reading from the network and writing to the cache enabling each of
those transactions to drive reading the response body from the network. This
ensures that a slow consumer does not starve other consumers of the same resource.

This CL implements the Writers class in isolation and does not create an
instance or integrates it with HttpCache/HttpCache::Transaction. In a follow up CL
which will be dependent on parallel validation CL
(https://codereview.chromium.org/2721933002/), a Writer object will replace entry-
>writer. In case of transaction types that do not support shared writing like
partial transactions, Writers will only contain one transaction at a time and will
have is_exclusive set to true.

The flow of Read() call will be:
URLRequestHttpJob -> HttpCache::Transaction::Read() -> HttpCache::Writers::Read()
-> HttpNetworkTransaction::Read()
HttpCache::Writers will invoke HC::T's callback after writing the read buffer to
the cache successfully or on network read failure/ cache write failure.
So, in essence, HttpCache::Writers::Read() abstracts away the DoNetworkRead* and
DoCacheWriteData* functions of HC::T

HttpCache::Transaction that has invoked Read() is the |active_transaction_| and
may be killed at any time by it's consumer.

When a transaction completes writing to the cache, either failure or success, it
invokes HttpCache::DoneWritingToEntry as it does now which will invoke the
required functionality in Writers.
But If |active_transaction_| does not exist, Writers object invokes
HttpCache::DoneWritingToEntry itself.

BUG=472740

Review-Url: https://codereview.chromium.org/2886483002
Cr-Commit-Position: refs/heads/master@{#486907}
12 files changed