Commit 83dffc51 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //weblayer/browser/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: I02b0dab841d1efbb7efd73b97b269f7e39c56e06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387057Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803487}
parent 6d9c0f21
...@@ -428,8 +428,9 @@ std::unique_ptr<ProfileImpl> ProfileImpl::DestroyAndDeleteDataFromDisk( ...@@ -428,8 +428,9 @@ std::unique_ptr<ProfileImpl> ProfileImpl::DestroyAndDeleteDataFromDisk(
if (profile->GetNumberOfBrowsers() > 0) if (profile->GetNumberOfBrowsers() > 0)
return profile; return profile;
ProfileInfo profile_info = profile->info_;
GetBackgroundDiskOperationTaskRunner()->PostTaskAndReply( GetBackgroundDiskOperationTaskRunner()->PostTaskAndReply(
FROM_HERE, base::BindOnce(&MarkProfileAsDeleted, profile->info_), FROM_HERE, base::BindOnce(&MarkProfileAsDeleted, profile_info),
base::BindOnce(&ProfileImpl::OnProfileMarked, std::move(profile), base::BindOnce(&ProfileImpl::OnProfileMarked, std::move(profile),
std::move(done_callback))); std::move(done_callback)));
return nullptr; return nullptr;
...@@ -443,7 +444,7 @@ void ProfileImpl::OnProfileMarked(std::unique_ptr<ProfileImpl> profile, ...@@ -443,7 +444,7 @@ void ProfileImpl::OnProfileMarked(std::unique_ptr<ProfileImpl> profile,
ProfileImpl* raw_profile = profile.get(); ProfileImpl* raw_profile = profile.get();
auto* clearer = new DataClearer( auto* clearer = new DataClearer(
profile->GetBrowserContext(), raw_profile->GetBrowserContext(),
base::BindOnce(&ProfileImpl::NukeDataAfterRemovingData, base::BindOnce(&ProfileImpl::NukeDataAfterRemovingData,
std::move(profile), std::move(done_callback))); std::move(profile), std::move(done_callback)));
uint64_t remove_all_mask = 0xffffffffffffffffull; uint64_t remove_all_mask = 0xffffffffffffffffull;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment