[omnibox][ml] Fix crash when running linear-mapped scoring logic. When executing the linear-mapped scoring variant in client code, it's possible for the AutocompleteController to invoke the ML scoring service before the scoring model has been fully loaded into memory. Doing so will result in the model returning std::nullopt as the prediction value associated with all URL suggestions. Since we didn't originally account for the presence of std::nullopt in the original code, this results in the client crashing when encountering this scenario. As such, this CL fixes the issue by defaulting to a prediction value of zero when the model returns std::nullopt. Bug: 330695208,40062540 Change-Id: I8b1834c4b800f21604577e9d857a4f53472f5fc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5398677 Commit-Queue: Khalid Peer <khalidpeer@chromium.org> Reviewed-by: manuk hovanesian <manukh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1282810}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.