Commit e73eb78b authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //chrome/browser/net/network_context_configuration_browsertest.cc

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

Bug: 1122844
Change-Id: I30ef2ad1444a2d21e59da4a590c8da1df4952668
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382071Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803657}
parent 4e0a3fb7
...@@ -167,11 +167,13 @@ class ConnectionTypeWaiter ...@@ -167,11 +167,13 @@ class ConnectionTypeWaiter
void Wait(network::mojom::ConnectionType expected_type) { void Wait(network::mojom::ConnectionType expected_type) {
auto current_type = network::mojom::ConnectionType::CONNECTION_UNKNOWN; auto current_type = network::mojom::ConnectionType::CONNECTION_UNKNOWN;
network::NetworkConnectionTracker::ConnectionTypeCallback callback = for (;;) {
base::BindOnce(&ConnectionTypeWaiter::OnConnectionChanged, network::NetworkConnectionTracker::ConnectionTypeCallback callback =
base::Unretained(this)); base::BindOnce(&ConnectionTypeWaiter::OnConnectionChanged,
while (!tracker_->GetConnectionType(&current_type, std::move(callback)) || base::Unretained(this));
current_type != expected_type) { if (tracker_->GetConnectionType(&current_type, std::move(callback)) &&
current_type == expected_type)
break;
run_loop_ = std::make_unique<base::RunLoop>( run_loop_ = std::make_unique<base::RunLoop>(
base::RunLoop::Type::kNestableTasksAllowed); base::RunLoop::Type::kNestableTasksAllowed);
run_loop_->Run(); run_loop_->Run();
......
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