-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cherry-pick 2 changes from Release-0-M121 (#41105)
* chore: [28-x-y] cherry-pick 2 changes from Release-0-M121 * cc07a95bc309 from chromium * chore: update patches --------- Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
- Loading branch information
1 parent
116dcfb
commit 9283a9d
Showing
2 changed files
with
56 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Bo Liu <boliu@chromium.org> | ||
Date: Mon, 4 Dec 2023 15:01:22 +0000 | ||
Subject: Safely crash on dangling profile | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Bug: 1407197 | ||
Change-Id: Idcafd8f0ba2f980d06338e573489a3456e3823c1 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5080603 | ||
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> | ||
Commit-Queue: Bo Liu <boliu@chromium.org> | ||
Cr-Commit-Position: refs/heads/main@{#1232704} | ||
|
||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc | ||
index e49ccf4ffc115a78abceeddd7f452aeeb5c6a917..09a30d7329b3da7e1f7aa1ea13f4bef876555319 100644 | ||
--- a/content/browser/web_contents/web_contents_impl.cc | ||
+++ b/content/browser/web_contents/web_contents_impl.cc | ||
@@ -256,6 +256,11 @@ BASE_FEATURE(kBackNavigationPredictionMetrics, | ||
"BackNavigationPredictionMetrics", | ||
base::FEATURE_ENABLED_BY_DEFAULT); | ||
|
||
+// Kill switch for crash immediately on dangling BrowserContext. | ||
+BASE_FEATURE(kCrashOnDanglingBrowserContext, | ||
+ "CrashOnDanglingBrowserContext", | ||
+ base::FEATURE_ENABLED_BY_DEFAULT); | ||
+ | ||
using LifecycleState = RenderFrameHost::LifecycleState; | ||
using LifecycleStateImpl = RenderFrameHostImpl::LifecycleStateImpl; | ||
|
||
@@ -1017,11 +1022,18 @@ class WebContentsOfBrowserContext : public base::SupportsUserData::Data { | ||
env, web_contents_with_dangling_ptr_to_browser_context); | ||
#endif // BUILDFLAG(IS_ANDROID) | ||
|
||
- NOTREACHED() | ||
- << "BrowserContext is getting destroyed without first closing all " | ||
- << "WebContents (for more info see https://crbug.com/1376879#c44); " | ||
- << "creator = " << creator; | ||
- base::debug::DumpWithoutCrashing(); | ||
+ if (base::FeatureList::IsEnabled(kCrashOnDanglingBrowserContext)) { | ||
+ LOG(FATAL) | ||
+ << "BrowserContext is getting destroyed without first closing all " | ||
+ << "WebContents (for more info see https://crbug.com/1376879#c44); " | ||
+ << "creator = " << creator; | ||
+ } else { | ||
+ NOTREACHED() | ||
+ << "BrowserContext is getting destroyed without first closing all " | ||
+ << "WebContents (for more info see https://crbug.com/1376879#c44); " | ||
+ << "creator = " << creator; | ||
+ base::debug::DumpWithoutCrashing(); | ||
+ } | ||
} | ||
} | ||
|