Commit c2dd43c1 authored by Zinovy Nis's avatar Zinovy Nis Committed by Commit Bot

[clang-tidy] Fix use-after-move in devtools/InputHandler

Bug: 995566
Change-Id: Ia71ae2c5b7f423e685d4a88fabc3bc21c22e307a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135694Reviewed-by: default avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Zinovy Nis <zynis@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#756591}
parent c7272fdd
......@@ -615,9 +615,6 @@ void InputHandler::DispatchKeyEvent(
void InputHandler::InsertText(const std::string& text,
std::unique_ptr<InsertTextCallback> callback) {
base::string16 text16 = base::UTF8ToUTF16(text);
base::OnceClosure closure =
base::BindOnce(&InsertTextCallback::sendSuccess, std::move(callback));
if (!host_ || !host_->GetRenderWidgetHost()) {
callback->sendFailure(Response::InternalError());
return;
......@@ -631,6 +628,9 @@ void InputHandler::InsertText(const std::string& text,
widget_host = target_host;
}
base::OnceClosure closure =
base::BindOnce(&InsertTextCallback::sendSuccess, std::move(callback));
widget_host->Focus();
widget_host->GetWidgetInputHandler()->ImeCommitText(
text16, std::vector<ui::ImeTextSpan>(), gfx::Range::InvalidRange(), 0,
......
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