Skip to content

Commit

Permalink
Temporarily mark upstream TabInterface pointer as DanglingUntriaged
Browse files Browse the repository at this point in the history
Our sidebar pinning service detaches (but does not delete) tabs and caches their
WebContents under certain circumstances. This has the unwanted side effect of
creating a dangling pointer in the upstream code that manages the embedded tab
interfaces. For now, we will mark this upstream pointer as DanglingUntriaged and
we have opened brave/brave-browser#42322 to track
this issue.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/bf1f8e50ede83c982c28e7e4254bad871b0c6bf7

commit bf1f8e50ede83c982c28e7e4254bad871b0c6bf7
Author: Thomas Lukaszewicz <[email protected]>
Date:   Wed Nov 6 19:37:01 2024 +0000

    [webui] Use SetTabInterface for setting embedding context on tabs

    This CL updates webui::InitEmbeddingContext() to leverage the new
    SetTabInterface API. This allows correct handling of both tab and
    browser interfaces for tabs (vs only browser interfaces for the
    current impl).

    This CL also ensures discard is handled correctly. This handling
    can be removed once the new tab discarding has successfully landed.

    Bug: 360724768
  • Loading branch information
emerick committed Nov 16, 2024
1 parent 2e64713 commit 7d85ac5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/chrome-browser-ui-webui-webui_embedding_context.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/chrome/browser/ui/webui/webui_embedding_context.cc b/chrome/browser/ui/webui/webui_embedding_context.cc
index 77ac87a688034c0b144a73065a76010d7397637c..5566c2e3a1194f45e10344fe0231daee3adee1b3 100644
--- a/chrome/browser/ui/webui/webui_embedding_context.cc
+++ b/chrome/browser/ui/webui/webui_embedding_context.cc
@@ -113,7 +113,7 @@ class EmbeddingTabTracker {
}

// The tab interface currently embedding the host contents.
- raw_ptr<tabs::TabInterface> tab_interface_ = nullptr;
+ raw_ptr<tabs::TabInterface, DanglingUntriaged> tab_interface_ = nullptr;

// Notifies this when `tab_interface_` will detach, tracked to invalidate
// the tab before destruction.

0 comments on commit 7d85ac5

Please sign in to comment.