Commit 8f2cf7fa authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //components/omnibox/browser/

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

Bug: 1122844
Change-Id: I4ea0a82440442e986e82a41206a0904223d2a858
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382816Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803140}
parent 8aded5e3
...@@ -552,8 +552,10 @@ void ClipboardProvider::NewClipboardImageMatch( ...@@ -552,8 +552,10 @@ void ClipboardProvider::NewClipboardImageMatch(
void ClipboardProvider::OnReceiveImage( void ClipboardProvider::OnReceiveImage(
ClipboardImageMatchCallback callback, ClipboardImageMatchCallback callback,
base::Optional<gfx::Image> optional_image) { base::Optional<gfx::Image> optional_image) {
if (!optional_image) if (!optional_image) {
std::move(callback).Run(base::nullopt); std::move(callback).Run(base::nullopt);
return;
}
gfx::ImageSkia image_skia = *optional_image.value().ToImageSkia(); gfx::ImageSkia image_skia = *optional_image.value().ToImageSkia();
image_skia.MakeThreadSafe(); image_skia.MakeThreadSafe();
base::ThreadPool::PostTaskAndReplyWithResult( base::ThreadPool::PostTaskAndReplyWithResult(
......
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