refactor: fix modernize-return-braced-init-list warnings (#44856)
* refactor: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] NB: using the braced-initializer list uncovered an error here: the float returned by std::floor() can't be implicitly cast to an int. This is solved by using base::ClampFloor<int>() instead. std::floor() Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
c0d1c3481a
commit
99f2bab4a4
33 changed files with 79 additions and 81 deletions
|
@ -594,7 +594,7 @@ ElectronBrowserClient::GetGeneratedCodeCacheSettings(
|
|||
// If we pass 0 for size, disk_cache will pick a default size using the
|
||||
// heuristics based on available disk size. These are implemented in
|
||||
// disk_cache::PreferredCacheSize in net/disk_cache/cache_util.cc.
|
||||
return content::GeneratedCodeCacheSettings(true, 0, cache_path);
|
||||
return {true, 0, cache_path};
|
||||
}
|
||||
|
||||
void ElectronBrowserClient::AllowCertificateError(
|
||||
|
@ -627,7 +627,7 @@ base::OnceClosure ElectronBrowserClient::SelectClientCertificate(
|
|||
std::move(client_certs), std::move(delegate));
|
||||
}
|
||||
|
||||
return base::OnceClosure();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ElectronBrowserClient::CanCreateWindow(
|
||||
|
@ -983,7 +983,7 @@ base::FilePath ElectronBrowserClient::GetDefaultDownloadDirectory() {
|
|||
base::FilePath download_path;
|
||||
if (base::PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &download_path))
|
||||
return download_path;
|
||||
return base::FilePath();
|
||||
return {};
|
||||
}
|
||||
|
||||
scoped_refptr<network::SharedURLLoaderFactory>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue