predictors: Fix WebUI crash due to the lazy initialization.
Navigation to chrome://predictors cause a crash if it's the first navigation after profile creation. The reason is that ResourcePrefetchPredictor is initialized only after the first commited navigation excluding a navigation to NTP. On the other hand, WebUI predictors handler doesn't check that the predictor was initialized before accessing the field that is nullptr in uninitialized state. This CL turns on the initialization of ResourcePrefetchPredictor after the navigation to NTP and adds a check for a uninitialized state in WebUI handler. Bug: 715525 Change-Id: I9382e892ce713d2b0beb406be344df64e2d5dd3d Reviewed-on: https://chromium-review.googlesource.com/575989 Commit-Queue: Alexandr Ilin <alexilin@chromium.org> Reviewed-by:Benoit L <lizeb@chromium.org> Cr-Commit-Position: refs/heads/master@{#487465}
Showing
Please register or sign in to comment