refactor: use base::Value::Take*() (#41169)

* perf: avoid temporary strings in Converter<net::HttpRequestHeaders>::FromV8()

* perf: take strings instead of copying them in ToResponseHead()

* refactor: prefer base::Value::Take*() where appropriate

As per the base::Value docs: "prefer over `std::move(value.Get...())`
so clang-tidy can warn about potential use-after-move mistakes."
This commit is contained in:
Charles Kerr 2024-05-13 08:58:52 -05:00 committed by GitHub
parent 88f28a302f
commit 10fd0ba655
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 8 deletions

View file

@ -103,7 +103,7 @@ std::unique_ptr<base::Value::Dict> ParseManifest(
LOG(ERROR) << "Failed to parse extension manifest.";
return std::unique_ptr<base::Value::Dict>();
}
return std::make_unique<base::Value::Dict>(std::move(manifest->GetDict()));
return std::make_unique<base::Value::Dict>(std::move(*manifest).TakeDict());
}
void ElectronExtensionSystem::LoadComponentExtensions() {