• Maksim Ivanov's avatar
    Add convenience Get method into base::PathService · 9a39401c
    Maksim Ivanov authored
    Add a new CheckedGet() method that is equivalent to
    base::PathService::Get(), but returns the result as a return value (and
    CHECKs that the operation succeeded).
    
    This is a pure convenience addition that allows to simplify the code
    that anyway cannot correctly handle the path service being unavailable.
    (In the existing codebase, there are already >100 callsites that do
    CHECK(PathService::Get(...)), and also many callsites in tests that just
    take the path returned by PathService::Get() without checking its return
    value.)
    
    Bug: none
    Change-Id: I38535138ea08f0fd71e0eaf1979a1bdc99c504ab
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279813Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
    Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#786413}
    9a39401c
path_service_unittest.cc 11.1 KB