Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cr105 follow up] Fixes crash in ProfileDestroyer. (uplift to 1.44.x) #14826

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions chromium_src/chrome/browser/profiles/profile_destroyer.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* Copyright (c) 2022 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "chrome/browser/profiles/profile_destroyer.h"

// When there are multiple OTR profiles, such as with a Private window and a Tor
// window open, it doesn't make sense that when destroying one of the OTR
// profiles the Chromium code wants to check that hosts for all OTR profiles are
// gone.
#define BRAVE_PROFILE_DESTROYER_DESTROY_PROFILE_WHEN_APPROPRIATE \
if (!profile->IsOffTheRecord())

#include "src/chrome/browser/profiles/profile_destroyer.cc"
#undef BRAVE_PROFILE_DESTROYER_DESTROY_PROFILE_WHEN_APPROPRIATE
12 changes: 12 additions & 0 deletions patches/chrome-browser-profiles-profile_destroyer.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/browser/profiles/profile_destroyer.cc b/chrome/browser/profiles/profile_destroyer.cc
index 517fd2a8a924f3076ad14105a0ec2677e18b0c79..1abc39094e3ffa59725dbeec543eac4371b81d18 100644
--- a/chrome/browser/profiles/profile_destroyer.cc
+++ b/chrome/browser/profiles/profile_destroyer.cc
@@ -88,6 +88,7 @@ void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) {
// ignored during shutdown and by the System Profile do not either.
HostSet profile_hosts;
GetHostsForProfile(&profile_hosts, profile);
+ BRAVE_PROFILE_DESTROYER_DESTROY_PROFILE_WHEN_APPROPRIATE
for (Profile* otr_profile : profile->GetAllOffTheRecordProfiles()) {
GetHostsForProfile(&profile_hosts, otr_profile);
}