Commit 49a91671 authored by Melissa Zhang's avatar Melissa Zhang Committed by Commit Bot

[Sharesheet] Display name is null.

Make copy of display name before std::move target so value is not
null.

Bug: 1097623
Change-Id: I949002b09c022d7d1cb7bda67f4932829406167c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2483548
Auto-Submit: Melissa Zhang <melzhang@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818456}
parent 8305e548
......@@ -243,6 +243,8 @@ void SharesheetBubbleView::PopulateLayoutsWithTargets(
}
++target_counter;
// Make a copy because value is needed after target is std::moved below.
base::string16 display_name = target.display_name;
base::string16 secondary_display_name =
target.secondary_display_name.value_or(base::string16());
......@@ -250,7 +252,7 @@ void SharesheetBubbleView::PopulateLayoutsWithTargets(
base::BindRepeating(&SharesheetBubbleView::TargetButtonPressed,
base::Unretained(this),
base::Passed(std::move(target))),
target.display_name, secondary_display_name, &target.icon);
display_name, secondary_display_name, &target.icon);
layout_for_target->AddView(std::move(target_view));
}
......
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