chore: debug crash on DevTools SetOwnerWindow (#47262)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
38e990c6e0
commit
0c226d8d79
3 changed files with 9 additions and 1 deletions
|
@ -2151,8 +2151,11 @@ void WebContents::DevToolsOpened() {
|
|||
// Inherit owner window in devtools when it doesn't have one.
|
||||
auto* devtools = inspectable_web_contents_->GetDevToolsWebContents();
|
||||
bool has_window = devtools->GetUserData(NativeWindowRelay::UserDataKey());
|
||||
if (owner_window() && !has_window)
|
||||
if (owner_window_ && !has_window) {
|
||||
DCHECK(!owner_window_.WasInvalidated());
|
||||
DCHECK_EQ(handle->owner_window(), nullptr);
|
||||
handle->SetOwnerWindow(devtools, owner_window());
|
||||
}
|
||||
|
||||
Emit("devtools-opened");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue