0

Fix double-callback-call crashes in //content/shell/browser/web_test/web_test_storage_access_manager.cc

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

Bug: 1122844
Change-Id: I9fddd7f0c65c877270a86d871044e7b636f75c56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2384469
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804222}
This commit is contained in:
Maksim Ivanov
2020-09-03 14:38:11 +00:00
committed by Commit Bot
parent e724abf0f3
commit 23632f7705

@ -33,11 +33,13 @@ void WebTestStorageAccessManager::SetStorageAccess(
auto primary_pattern = ContentSettingsPattern::FromString(origin);
if (!primary_pattern.IsValid()) {
std::move(callback).Run(false);
return;
}
auto secondary_pattern = ContentSettingsPattern::FromString(embedding_origin);
if (!secondary_pattern.IsValid()) {
std::move(callback).Run(false);
return;
}
content_settings_for_automation_.push_back(