Skip to content
Snippets Groups Projects
Commit 9b7b18d1 authored by Simon Zünd's avatar Simon Zünd Committed by Chromium LUCI CQ
Browse files

[M126-LTS][inspector] Fix accessing disposed V8 session in page agent

Scripts running as part of Page.evaluateScriptOnNewDocument can pause
the page. During a pause we can detach the DevTools session, but the
page agent is still in the middle of running the
"DidCreateMainWorldContext" probe. This means any additional
Page.evaluateScriptOnNewDocument scripts would attempt to eval on
a detached V8 session.

This CL fixes this by overriding InspectorBaseAgent::Dispose in the
page agent and resetting `v8_session_` to a nullptr which we can
check for before evaling more scripts.

This check is only necessary for page agent methods that execute
more than one JS script as for all the others we wouldn't call
the probes on a disposed agent in the first place.

R=caseq@chromium.org, dsv@chromium.org

(cherry picked from commit 622d2fd9)

Fixed: 368672129
Change-Id: I4c3361c8116a64343206da991e503aaa6bd917f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5886170


Reviewed-by: default avatarDanil Somsikov <dsv@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1359730}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5901054


Reviewed-by: default avatarMohamed Omar <mohamedaomar@google.com>
Reviewed-by: default avatarAlex Rudenko <alexrudenko@chromium.org>
Owners-Override: Mohamed Omar <mohamedaomar@google.com>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Cr-Commit-Position: refs/branch-heads/6478@{#1993}
Cr-Branched-From: e6143acc-refs/heads/main@{#1300313}
parent dbb2b529
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment