[getUserMedia] Refactor code to consolidate audio constraints processing.

The refactoring aims at making more explicit the relationship between
the various level of aggregations and the properties. The various levels
of aggregation for audio constraints now abide a general implicit interface,
by implementing ApplyConstraintSet, IsEmpty, and SelectSettingsAndScore.
Such interface expresses the general functionalities implemented by the
various levels of aggregation.

The first level of aggregation is represented by CandidatesContainer,
which owns all the candidates and by looping over all determines the
best fitting.

The second level of aggregation is represented by the DeviceContainer,
representing a single candidate. The container is responsible to
determine the best fitting setting for each single setting.

Finally, the third level of aggregation is represented by
BooleanContainer, StringContainer, and EchoCancellationContainer. Here
each container abstracts, per-type, the relationship between constraints
and settings. The echo cancellation, in this case, requires special
treatment due to the relationship between 3 constraints and one output
setting.

BUG=731170
TESTED=./out/Default/content_unittests
[email protected]

Change-Id: I70df75d4aa0a4c825dc4a34bdc62a5580ba1993c
Reviewed-on: https://chromium-review.googlesource.com/c/1326489
Reviewed-by: Guido Urdaneta <[email protected]>
Commit-Queue: Guido Urdaneta <[email protected]>
Cr-Commit-Position: refs/heads/master@{#610071}
1 file changed