summaryrefslogtreecommitdiff
path: root/chromium/services
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-20 11:01:03 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2023-01-03 09:56:39 +0000
commit969c2ab20295099e784f76aaf842a9f442f7b252 (patch)
tree0683c8c14a8a9f56343d81ec2346ea9ad2fae29f /chromium/services
parentb7dc697ebbdd8853731c174a552363d11b31866c (diff)
downloadqtwebengine-chromium-969c2ab20295099e784f76aaf842a9f442f7b252.tar.gz
Stop using C++20 initialization
Named initialization is proposed for C++20 and we are supposed to be using only C++17. Change-Id: Iefd936eeadf5ba3ee53b446bbb4ab7c6891aadaa Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io> Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/448689 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/services')
-rw-r--r--chromium/services/device/compute_pressure/cpu_probe.h2
-rw-r--r--chromium/services/device/hid/hid_service_win.cc16
-rw-r--r--chromium/services/device/serial/serial_device_enumerator_win.cc4
-rw-r--r--chromium/services/network/sct_auditing/sct_auditing_reporter.cc14
-rw-r--r--chromium/services/network/trust_tokens/trust_token_database_owner.cc14
-rw-r--r--chromium/services/network/trust_tokens/trust_token_key_commitment_controller.cc6
-rw-r--r--chromium/services/network/web_transport.cc4
7 files changed, 32 insertions, 28 deletions
diff --git a/chromium/services/device/compute_pressure/cpu_probe.h b/chromium/services/device/compute_pressure/cpu_probe.h
index 3ed891fd0bd..201dbf75fa9 100644
--- a/chromium/services/device/compute_pressure/cpu_probe.h
+++ b/chromium/services/device/compute_pressure/cpu_probe.h
@@ -33,7 +33,7 @@ namespace device {
class CpuProbe {
public:
// LastSample() return value when the implementation fails to get a result.
- static constexpr PressureSample kUnsupportedValue = {.cpu_utilization = 0.0};
+ static constexpr PressureSample kUnsupportedValue = {/*.cpu_utilization = */0.0};
// Instantiates the CpuProbe subclass most suitable for the current platform.
//
diff --git a/chromium/services/device/hid/hid_service_win.cc b/chromium/services/device/hid/hid_service_win.cc
index 40f8a607ee1..8121d99393a 100644
--- a/chromium/services/device/hid/hid_service_win.cc
+++ b/chromium/services/device/hid/hid_service_win.cc
@@ -224,7 +224,8 @@ absl::optional<std::wstring> GetParentInstanceId(
HDEVINFO device_info_set,
SP_DEVICE_INTERFACE_DATA& device_interface_data) {
// Get device info for |device_interface_data|.
- SP_DEVINFO_DATA device_info_data = {.cbSize = sizeof(device_info_data)};
+ SP_DEVINFO_DATA device_info_data{};
+ device_info_data.cbSize = sizeof(device_info_data);
std::wstring device_path;
if (!GetDeviceInfoAndPathFromInterface(device_info_set, device_interface_data,
&device_info_data, &device_path)) {
@@ -535,13 +536,14 @@ void HidServiceWin::EnumerateBlocking(
/*hwndParent=*/nullptr, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE));
if (device_info_set.is_valid()) {
- SP_DEVICE_INTERFACE_DATA device_interface_data = {
- .cbSize = sizeof(device_interface_data)};
+ SP_DEVICE_INTERFACE_DATA device_interface_data{};
+ device_interface_data.cbSize = sizeof(device_interface_data);
for (int device_index = 0; SetupDiEnumDeviceInterfaces(
device_info_set.get(), /*DeviceInfoData=*/nullptr,
&GUID_DEVINTERFACE_HID, device_index, &device_interface_data);
++device_index) {
- SP_DEVINFO_DATA device_info_data = {.cbSize = sizeof(device_info_data)};
+ SP_DEVINFO_DATA device_info_data{};
+ device_info_data.cbSize = sizeof(device_info_data);
std::wstring device_path;
if (!GetDeviceInfoAndPathFromInterface(device_info_set.get(),
device_interface_data,
@@ -585,7 +587,8 @@ void HidServiceWin::AddDeviceBlocking(
if (!preparsed_data)
return;
- HIDD_ATTRIBUTES attrib = {.Size = sizeof(attrib)};
+ HIDD_ATTRIBUTES attrib{};
+ attrib.Size = sizeof(attrib);
if (!HidD_GetAttributes(device_handle.Get(), &attrib)) {
HID_LOG(DEBUG) << "Failed to get device attributes.";
return;
@@ -622,7 +625,8 @@ void HidServiceWin::AddDeviceBlocking(
void HidServiceWin::OnDeviceAdded(const GUID& class_guid,
const std::wstring& device_path) {
- SP_DEVINFO_DATA device_info_data = {.cbSize = sizeof(device_info_data)};
+ SP_DEVINFO_DATA device_info_data{};
+ device_info_data.cbSize = sizeof(device_info_data);
auto device_info_set =
GetDeviceInfoSetFromDevicePath(device_path, &device_info_data);
if (!device_info_set.is_valid())
diff --git a/chromium/services/device/serial/serial_device_enumerator_win.cc b/chromium/services/device/serial/serial_device_enumerator_win.cc
index 07376662984..f8d5f8bfe12 100644
--- a/chromium/services/device/serial/serial_device_enumerator_win.cc
+++ b/chromium/services/device/serial/serial_device_enumerator_win.cc
@@ -277,7 +277,7 @@ void SerialDeviceEnumeratorWin::DoInitialEnumeration() {
if (!dev_info.is_valid())
return;
- SP_DEVINFO_DATA dev_info_data = {.cbSize = sizeof(dev_info_data)};
+ SP_DEVINFO_DATA dev_info_data = {/*.cbSize =*/ sizeof(dev_info_data)};
for (DWORD i = 0; SetupDiEnumDeviceInfo(dev_info.get(), i, &dev_info_data);
i++) {
EnumeratePort(dev_info.get(), &dev_info_data, /*check_port_name=*/false);
@@ -296,7 +296,7 @@ void SerialDeviceEnumeratorWin::DoInitialEnumeration() {
if (!dev_info.is_valid())
return;
- SP_DEVINFO_DATA dev_info_data = {.cbSize = sizeof(dev_info_data)};
+ SP_DEVINFO_DATA dev_info_data = {/*.cbSize =*/ sizeof(dev_info_data)};
for (DWORD i = 0; SetupDiEnumDeviceInfo(dev_info.get(), i, &dev_info_data);
i++) {
EnumeratePort(dev_info.get(), &dev_info_data, /*check_port_name=*/true);
diff --git a/chromium/services/network/sct_auditing/sct_auditing_reporter.cc b/chromium/services/network/sct_auditing/sct_auditing_reporter.cc
index a0a77e27f96..c2bed7c880e 100644
--- a/chromium/services/network/sct_auditing/sct_auditing_reporter.cc
+++ b/chromium/services/network/sct_auditing/sct_auditing_reporter.cc
@@ -117,23 +117,23 @@ std::string TruncateSuffix(base::span<char> bytes, size_t bits_number) {
const net::BackoffEntry::Policy SCTAuditingReporter::kDefaultBackoffPolicy = {
// Don't ignore initial errors; begin exponential back-off rules immediately
// if the first attempt fails.
- .num_errors_to_ignore = 0,
+ /*.num_errors_to_ignore =*/ 0,
// Start with a 30s delay, including for the first attempt (due to setting
// `always_use_initial_delay = true` below).
- .initial_delay_ms = 30 * 1000,
+ /*.initial_delay_ms =*/ 30 * 1000,
// Double the backoff delay each retry.
- .multiply_factor = 2.0,
+ /*.multiply_factor =*/ 2.0,
// Spread requests randomly between 80-100% of the calculated backoff time.
- .jitter_factor = 0.2,
+ /*.jitter_factor =*/ 0.2,
// Max retry delay is 1 day.
- .maximum_backoff_ms = 24 * 60 * 60 * 1000,
+ /*.maximum_backoff_ms =*/ 24 * 60 * 60 * 1000,
// Never discard the entry.
- .entry_lifetime_ms = -1,
+ /*.entry_lifetime_ms =*/ -1,
// Initial attempt will be delayed (and jittered). This reduces the risk of
// a "thundering herd" of reports on startup if a user has many reports
// persisted (once pending reports are persisted and recreated at startup
// with a new BackoffEntry).
- .always_use_initial_delay = true,
+ /*.always_use_initial_delay =*/ true,
};
// How many times an SCTAuditingReporter should retry sending an audit report.
diff --git a/chromium/services/network/trust_tokens/trust_token_database_owner.cc b/chromium/services/network/trust_tokens/trust_token_database_owner.cc
index cf86db10490..aa3b8399b2d 100644
--- a/chromium/services/network/trust_tokens/trust_token_database_owner.cc
+++ b/chromium/services/network/trust_tokens/trust_token_database_owner.cc
@@ -82,17 +82,17 @@ NOINLINE TrustTokenDatabaseOwner::TrustTokenDatabaseOwner(
table_manager_(base::MakeRefCounted<sqlite_proto::ProtoTableManager>(
db_task_runner)),
db_task_runner_(db_task_runner),
- backing_database_(std::make_unique<sql::Database>(sql::DatabaseOptions{
+ backing_database_(std::make_unique<sql::Database>(sql::DatabaseOptions(
// As they work on deleting the feature (crbug.com/1120969), sql/
// owners prefer to see which clients are explicitly okay with using
// exclusive locking (the default).
- .exclusive_locking = true,
- .page_size = 4096,
- .cache_size = 500,
+ /*.exclusive_locking =*/ true,
+ /*.page_size =*/ 4096,
+ /*.cache_size =*/ 500,
// TODO(pwnall): Add a meta table and remove this option.
- .mmap_alt_status_discouraged = true,
- .enable_views_discouraged = true, // Required by mmap_alt_status.
- })),
+ /*.mmap_alt_status_discouraged =*/ true,
+ /*.enable_views_discouraged =*/ true // Required by mmap_alt_status.
+ ))),
issuer_table_(
std::make_unique<sqlite_proto::KeyValueTable<TrustTokenIssuerConfig>>(
kIssuerTableName)),
diff --git a/chromium/services/network/trust_tokens/trust_token_key_commitment_controller.cc b/chromium/services/network/trust_tokens/trust_token_key_commitment_controller.cc
index ccac16c3304..05b4282bb24 100644
--- a/chromium/services/network/trust_tokens/trust_token_key_commitment_controller.cc
+++ b/chromium/services/network/trust_tokens/trust_token_key_commitment_controller.cc
@@ -108,7 +108,7 @@ void TrustTokenKeyCommitmentController::HandleRedirect(
// delay before the client deletes this object.
url_loader_.reset();
std::move(completion_callback_)
- .Run({.value = Status::Value::kGotRedirected}, /*result=*/nullptr);
+ .Run({Status::Value::kGotRedirected}, /*result=*/nullptr);
// |this| may be deleted here.
}
@@ -130,12 +130,12 @@ void TrustTokenKeyCommitmentController::HandleResponseBody(
if (!result) {
std::move(completion_callback_)
- .Run({.value = Status::Value::kCouldntParse}, /*result=*/nullptr);
+ .Run({Status::Value::kCouldntParse}, /*result=*/nullptr);
return;
}
std::move(completion_callback_)
- .Run({.value = Status::Value::kOk}, std::move(result));
+ .Run({Status::Value::kOk}, std::move(result));
// |this| may be deleted here.
}
diff --git a/chromium/services/network/web_transport.cc b/chromium/services/network/web_transport.cc
index 8ddbeb9473c..4d2c360d754 100644
--- a/chromium/services/network/web_transport.cc
+++ b/chromium/services/network/web_transport.cc
@@ -32,8 +32,8 @@ net::WebTransportParameters CreateParameters(
for (const auto& fingerprint : fingerprints) {
params.server_certificate_fingerprints.push_back(
- quic::CertificateFingerprint{.algorithm = fingerprint->algorithm,
- .fingerprint = fingerprint->fingerprint});
+ quic::CertificateFingerprint{/*.algorithm =*/ fingerprint->algorithm,
+ /*.fingerprint =*/ fingerprint->fingerprint});
}
return params;
}