Skip to content

Commit

Permalink
Merge pull request #15117 from /issues/908
Browse files Browse the repository at this point in the history
Cleanup permission contexts on PermissionManager::Shutdown().
  • Loading branch information
goodov authored Sep 19, 2022
2 parents 34235a6 + f48a74c commit f494ac2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions browser/brave_wallet/ethereum_provider_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class EthereumProviderImplUnitTest : public testing::Test {
void TearDown() override {
provider_.reset();
web_contents_.reset();
profile_.SetPermissionControllerDelegate(nullptr);
}

void SetUp() override {
Expand Down
5 changes: 5 additions & 0 deletions components/permissions/brave_permission_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ BravePermissionManager::BravePermissionManager(
PermissionContextMap permission_contexts)
: PermissionManager(browser_context, std::move(permission_contexts)) {}

void BravePermissionManager::Shutdown() {
PermissionManager::Shutdown();
permission_contexts_.clear();
}

void BravePermissionManager::RequestPermissionsForOrigin(
const std::vector<blink::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
Expand Down
2 changes: 2 additions & 0 deletions components/permissions/brave_permission_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class BravePermissionManager : public PermissionManager {
BravePermissionManager(const BravePermissionManager&) = delete;
BravePermissionManager& operator=(const BravePermissionManager&) = delete;

void Shutdown() override;

void RequestPermissionsForOrigin(
const std::vector<blink::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
Expand Down

0 comments on commit f494ac2

Please sign in to comment.