Commit 7f28356d authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //content/browser/gpu/

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

Bug: 1122844
Change-Id: I6bf3cff46d06bd2db9a667b5846bee26e7d76dfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2383020Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805512}
parent b13df0ca
...@@ -52,13 +52,14 @@ void VizDevToolsConnector::ConnectVizDevTools() { ...@@ -52,13 +52,14 @@ void VizDevToolsConnector::ConnectVizDevTools() {
mojo::PendingRemote<network::mojom::TCPServerSocket> server_socket; mojo::PendingRemote<network::mojom::TCPServerSocket> server_socket;
int port = ui_devtools::UiDevToolsServer::GetUiDevToolsPort( int port = ui_devtools::UiDevToolsServer::GetUiDevToolsPort(
switches::kEnableVizDevTools, kVizDevToolsDefaultPort); switches::kEnableVizDevTools, kVizDevToolsDefaultPort);
mojo::PendingReceiver<network::mojom::TCPServerSocket>
server_socket_receiver = server_socket.InitWithNewPipeAndPassReceiver();
// Jump to the UI thread to get the network context, create the socket, then // Jump to the UI thread to get the network context, create the socket, then
// jump back to the IO thread to complete the callback. // jump back to the IO thread to complete the callback.
GetUIThreadTaskRunner({})->PostTask( GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&CreateSocketOnUiThread, &CreateSocketOnUiThread, std::move(server_socket_receiver), port,
server_socket.InitWithNewPipeAndPassReceiver(), port,
base::BindOnce(&VizDevToolsConnector::OnVizDevToolsSocketCreated, base::BindOnce(&VizDevToolsConnector::OnVizDevToolsSocketCreated,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(),
std::move(server_socket)))); std::move(server_socket))));
......
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