Commit d4449153 authored by Evan Stade's avatar Evan Stade Committed by Chromium LUCI CQ

Fix issue in Location Bar on Linux.

Bug: 1161143
Change-Id: Ifa6a401f033ec2192233432ff13d593290027e40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602581Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839212}
parent cca0dd73
......@@ -1252,8 +1252,16 @@ void LocationBarView::OnLocationIconPressed(const ui::MouseEvent& event) {
ui::Clipboard::IsSupportedClipboardBuffer(
ui::ClipboardBuffer::kSelection)) {
base::string16 text;
// Since ReadText() runs a nested message loop, |this| may be deleted before
// it returns. See https://crbug.com/1161143
auto weak_this = weak_factory_.GetWeakPtr();
ui::Clipboard::GetForCurrentThread()->ReadText(
ui::ClipboardBuffer::kSelection, /* data_dst = */ nullptr, &text);
if (!weak_this) {
return;
}
text = OmniboxView::SanitizeTextForPaste(text);
if (!GetOmniboxView()->model()->CanPasteAndGo(text)) {
......
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