• Etienne Pierre-doray's avatar
    [Task Scheduler]: Make task traits more robust and simple. · 88396607
    Etienne Pierre-doray authored
    Main issue: TaskTraits constructor is not robust; any
    signature is part of the overload set, even if it may not compile.
    Because of that, it may not possible to hold TaskTrait in a tuple (depending on implementation).
    Fix: Expose a single constructor that checks if all traits are valid,
    or if an extension can accept all traits.
    Caveat: An extension has to redefine base TaskTrait::ValidTraits as valid
    (through inheritance).
    This CL also simplifies querying traits thanks to C++14 relaxed constant expressions.
    This reduces compile time complexity of TaskTraits constructor from O(n^3) to O(n^2).
    
    
    Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
    Change-Id: I73f993f6be837f1ac665b4b09c78d9d7272435a8
    Reviewed-on: https://chromium-review.googlesource.com/c/1194687Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
    Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
    Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
    Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#596341}
    88396607
task_traits.h 12.8 KB