[iOS] Fix logic for triggering Safe Browsing warnings for subframes
Error pages for unsafe subframes are triggered by associating an UnsafeResource with the corresponding main frame item and reloading that item. This reload is detected in SafeBrowsingTabHelper::ShouldAllowRequest and an error decision is created. This detection logic was incorrectly also applied to subframe reloads, triggering a crash since these can happen while both the pending item and last committed item are null. More specifically, this can happen when a subframe triggers a reload using JavaScript, at the same time as the user performs a back/forward navigation to a restore_session URL. This CL fixes this logic by only applying it to main frame requests. Bug: 1124308 Change-Id: Idc485b836e88c41116f16b5b42a964585666d9cb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392398Reviewed-by:Eugene But <eugenebut@chromium.org> Commit-Queue: Ali Juma <ajuma@chromium.org> Cr-Commit-Position: refs/heads/master@{#804282}
Showing
Please register or sign in to comment