[keyed_service] Add workaround for DependsOn between layers.

Adds a layer-breaking workaround to ensure no services factories above
the simple layer can ever depend on services of other types. This enables
us to keep the DependsOn(...) invocations as more services move to the
simple service factory type.

It is implemented as giving a Type enum to the base class, that all
subclasses pass up through their constructor, which means they all
have to declare their type. The type is then checked when DependsOn(...)
is invoked.

Going forward, there should be a solution to be able to handle these
dependencies gracefully, but until then, this CL be seen as a stopgap
measure.

Bug: 944906

Change-Id: Ifeeb6685a9420209a6d3baa599b133a103021c73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1534708
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643554}
14 files changed