Add convenience Get method into base::PathService
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:Mitsuru Oshima <oshima@chromium.org> Reviewed-by:
Lei Zhang <thestig@chromium.org> Commit-Queue: Maksim Ivanov <emaxx@chromium.org> Cr-Commit-Position: refs/heads/master@{#786413}
Showing
Please register or sign in to comment