-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prerender2: Accept FrameTreeNodeId for primary main frames too
If a valid FrameTreeNodeId for the primary main frame is specified as frameId, ScriptExecutor::Handler inconsistently convert it to 0 internally, and ExecuteCodeFunction panics on receiving the results with unexpected frameId 0. This happens regardless of Prerendering, but is happening more frequently probably because Extensions have more chance to specify stale frameIds with prerendering, and it matches to the newly activated page's frameId by chance. In the ScriptExecutor::Handler, we push RenderFrameHost into `pending_render_frames_` and recalculate the relevant frameId before the script execution. This is synchronous operation and assumed as safe. But if FrameTreeNodeId reaches here, the recalculated frameId for the result gets to be 0. Thus ExecuteCodeFunction is confused on the frameId different between the request and result. This patch modifies the Result preparation to be done with the exact given frameId. This patch also reverts the previous debugging code in ExecuteCodeFunction. Bug: 1346998 Change-Id: Ie3c0635e994e94659c1cc9dd5fdac3268f10e08a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3810982 Reviewed-by: Huanpo Lin <robertlin@chromium.org> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org> Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/main@{#1035014}
- Loading branch information
Showing
3 changed files
with
76 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters