Reland "Migrate client_update::SendProtocolRequest to SimpleURLLoader"

This is a reland of ccd4ec0882bbc5d235b49188ca6cc3ac43c6c9d5

Difference from the original CL is minor, but indeed the cause of
failures on debug bots:

  -  headers.AddHeadersFromString(request.all_headers);
  +  for (auto it : request.headers)
  +    headers.SetHeader(it.first, it.second);

Basically, network::ResourceRequest::all_headers can contain
lines that do not match the "key: value" syntax expected by
net::HttpRequestHeaders. Hence, we iterate over
network::ResourceRequest::headers instead.

TBR=emaxx@chromium.org,sorin@chromium.org,rdevlin.cronin@chromium.org,droger@chromium.org,mmenke@chromium.org

Original change's description:
> Migrate client_update::SendProtocolRequest to SimpleURLLoader
>
> URLFetcher et al will stop working in the browser process with advent
> of Network Service, and SimpleURLLoader is the replacement API
> for most clients. CL migrates SendProtocolRequest to the new API.
>
> Major remarks:
>
> * URLRequestPostInterceptor is replaced by URLLoaderPostInterceptor although the public APIs
> of the former is kept (are almost the same) in the later. This allows the extensive set of unit
> tests to remain untouched. The replacement is needed because URLRequestPostInterceptor used
> to intercept requests instantiated by URLFetcher, precisely the class we are moving away to use.
>
> * URLLoaderPostInterceptor operates in two modes: it supports working both with TestURLLoaderFactory
> and EmbeddedTestServer. Two constructors are offered that control the 'mode' it operates on.
> This is needed because of the nature of the tests: some tests manipulate the TestConfigurator
> directly, hence the needed SharedURLLoaderFactory instance can be acquired directly from it,
> eg PingManagerTest, UpdateCheckerTest and RequestSenderTest.
> Some other tests, trigger the respective SimpleURLLoader machinery from upper layers, and then
> have no access to TestConfigurator instances. In such cases, URLLoaderPostInterceptor operates
> using EmbeddedTestServer in order to intercept URL loads.
>
> Note that this CL migrates components/update_client/utils.cc|h to SimpleURLLoader, but there
> some other classes on the same directory that still use URLFetcher (eg UrlFetcherDownloader),
> so we simply can not *yet* remove all the references to URLFetcher and URLRequestContextGetter.
> It will be done in a follow up CL.
>
> BUG=773295,844973
>
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
> Change-Id: I3d8be368818ba77b559907c0217995f8c6a95b04
> Reviewed-on: https://chromium-review.googlesource.com/1097337
> Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
> Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
> Reviewed-by: Sorin Jianu <sorin@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Reviewed-by: David Roger <droger@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#571097}

Bug: 773295, 844973
Change-Id: I3a8252aecf687d08e41c0d09cb9bd245fe3f712b
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/1118646
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#571242}
25 files changed