diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-20 11:01:03 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-01-03 09:56:39 +0000 |
commit | 969c2ab20295099e784f76aaf842a9f442f7b252 (patch) | |
tree | 0683c8c14a8a9f56343d81ec2346ea9ad2fae29f | |
parent | b7dc697ebbdd8853731c174a552363d11b31866c (diff) | |
download | qtwebengine-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>
160 files changed, 1093 insertions, 1066 deletions
diff --git a/chromium/base/allocator/partition_allocator/starscan/pcscan_internal.cc b/chromium/base/allocator/partition_allocator/starscan/pcscan_internal.cc index 91f3e617c58..748666fc77a 100644 --- a/chromium/base/allocator/partition_allocator/starscan/pcscan_internal.cc +++ b/chromium/base/allocator/partition_allocator/starscan/pcscan_internal.cc @@ -243,7 +243,7 @@ GetSlotStartInSuperPage(uintptr_t maybe_inner_address) { const uintptr_t slot_start = slot_span_start + (slot_number * slot_size); PA_SCAN_DCHECK(slot_start <= maybe_inner_address && maybe_inner_address < slot_start + slot_size); - return {.slot_start = slot_start, .slot_size = slot_size}; + return {/*.slot_start =*/ slot_start, /*.slot_size =*/ slot_size}; } #if PA_SCAN_DCHECK_IS_ON() diff --git a/chromium/base/logging.cc b/chromium/base/logging.cc index f934ccba4c4..cf33bea6b61 100644 --- a/chromium/base/logging.cc +++ b/chromium/base/logging.cc @@ -1154,13 +1154,13 @@ ScopedLoggingSettings::ScopedLoggingSettings() ScopedLoggingSettings::~ScopedLoggingSettings() { // Re-initialize logging via the normal path. This will clean up old file // name and handle state, including re-initializing the VLOG internal state. - CHECK(InitLogging({ - .logging_dest = logging_destination_, - .log_file_path = log_file_name_ ? log_file_name_->data() : nullptr, + LoggingSettings settings; + settings.logging_dest = logging_destination_; + settings.log_file_path = log_file_name_ ? log_file_name_->data() : nullptr; #if BUILDFLAG(IS_CHROMEOS) - .log_format = log_format_ + settings.log_format = log_format_; #endif - })) << "~ScopedLoggingSettings() failed to restore settings."; + CHECK(InitLogging(settings)) << "~ScopedLoggingSettings() failed to restore settings."; // Restore plain data settings. SetMinLogLevel(min_log_level_); diff --git a/chromium/base/power_monitor/battery_level_provider_win.cc b/chromium/base/power_monitor/battery_level_provider_win.cc index 90dac87d880..09ce6611936 100644 --- a/chromium/base/power_monitor/battery_level_provider_win.cc +++ b/chromium/base/power_monitor/battery_level_provider_win.cc @@ -227,11 +227,11 @@ BatteryLevelProviderWin::GetBatteryStateImpl() { } battery_details_list.push_back(BatteryDetails( - {.is_external_power_connected = + {/*.is_external_power_connected =*/ !!(battery_status->PowerState & BATTERY_POWER_ON_LINE), - .current_capacity = battery_status->Capacity, - .full_charged_capacity = battery_information->FullChargedCapacity, - .charge_unit = + /*.current_capacity =*/ battery_status->Capacity, + /*.full_charged_capacity =*/ battery_information->FullChargedCapacity, +// .charge_unit = ((battery_information->Capabilities & BATTERY_CAPACITY_RELATIVE) ? BatteryLevelUnit::kRelative : BatteryLevelUnit::kMWh)})); diff --git a/chromium/base/threading/platform_thread_win.cc b/chromium/base/threading/platform_thread_win.cc index c4df0797841..0aa5cb3e421 100644 --- a/chromium/base/threading/platform_thread_win.cc +++ b/chromium/base/threading/platform_thread_win.cc @@ -474,10 +474,10 @@ void SetCurrentThreadQualityOfService(ThreadType thread_type) { } THREAD_POWER_THROTTLING_STATE thread_power_throttling_state{ - .Version = THREAD_POWER_THROTTLING_CURRENT_VERSION, - .ControlMask = + /*.Version =*/ THREAD_POWER_THROTTLING_CURRENT_VERSION, +// .ControlMask = desire_ecoqos ? THREAD_POWER_THROTTLING_EXECUTION_SPEED : 0ul, - .StateMask = +// .StateMask = desire_ecoqos ? THREAD_POWER_THROTTLING_EXECUTION_SPEED : 0ul, }; [[maybe_unused]] const BOOL success = set_thread_information_fn( diff --git a/chromium/base/win/windows_version.cc b/chromium/base/win/windows_version.cc index 6ce96f706e0..2b8024e56e6 100644 --- a/chromium/base/win/windows_version.cc +++ b/chromium/base/win/windows_version.cc @@ -232,10 +232,10 @@ Version OSInfo::Kernel32Version() const { OSInfo::VersionNumber OSInfo::Kernel32VersionNumber() const { DCHECK_EQ(Kernel32BaseVersion().components().size(), 4u); static const VersionNumber version = { - .major = Kernel32BaseVersion().components()[0], - .minor = Kernel32BaseVersion().components()[1], - .build = Kernel32BaseVersion().components()[2], - .patch = Kernel32BaseVersion().components()[3]}; + /*.major =*/ Kernel32BaseVersion().components()[0], + /*.minor =*/ Kernel32BaseVersion().components()[1], + /*.build =*/ Kernel32BaseVersion().components()[2], + /*.patch =*/ Kernel32BaseVersion().components()[3]}; return version; } diff --git a/chromium/components/autofill/content/browser/form_forest.cc b/chromium/components/autofill/content/browser/form_forest.cc index de3954f176c..6e2ceea76d2 100644 --- a/chromium/components/autofill/content/browser/form_forest.cc +++ b/chromium/components/autofill/content/browser/form_forest.cc @@ -480,7 +480,7 @@ void FormForest::UpdateTreeOfRendererForm(FormData* form, // Pushes the right-sibling field range of |n| onto the stack. frontier.push( - {.frame = n.frame, .form = n.form, .next_frame = n.next_frame + 1}); + {/*.frame =*/ n.frame, /*.form =*/ n.form, /*.next_frame =*/ n.next_frame + 1}); // Pushes the child field ranges of |n| onto the stack. To ensure DOM // order, we do so in reverse order and after the right sibling. @@ -503,9 +503,9 @@ void FormForest::UpdateTreeOfRendererForm(FormData* form, } else { child_frame->parent_form = n.form->global_id(); for (size_t i = child_frame->child_forms.size(); i > 0; --i) { - frontier.push({.frame = child_frame, - .form = &child_frame->child_forms[i - 1], - .next_frame = 0}); + frontier.push({/*.frame =*/ child_frame, + /*.form =*/ &child_frame->child_forms[i - 1], + /*.next_frame =*/ 0}); } } } diff --git a/chromium/components/autofill/content/renderer/autofill_agent.cc b/chromium/components/autofill/content/renderer/autofill_agent.cc index 4db121d82d7..d2510ff5f2e 100644 --- a/chromium/components/autofill/content/renderer/autofill_agent.cc +++ b/chromium/components/autofill/content/renderer/autofill_agent.cc @@ -450,7 +450,9 @@ void AutofillAgent::OnTextFieldDidChange(const WebInputElement& element) { return; } - ShowSuggestions(element, {.requires_caret_at_end = true}); + ShowSuggestionsOptions options; + options.requires_caret_at_end = true; + ShowSuggestions(element, options); FormData form; FormFieldData field; @@ -470,17 +472,20 @@ void AutofillAgent::TextFieldDidReceiveKeyDown(const WebInputElement& element, if (event.windows_key_code == ui::VKEY_DOWN || event.windows_key_code == ui::VKEY_UP) { - ShowSuggestions(element, - {.autofill_on_empty_values = true, - .requires_caret_at_end = true, - .autoselect_first_suggestion = - ShouldAutoselectFirstSuggestionOnArrowDown()}); + ShowSuggestionsOptions options; + options.autofill_on_empty_values = true; + options.requires_caret_at_end = true; + options.autoselect_first_suggestion = + ShouldAutoselectFirstSuggestionOnArrowDown(); + ShowSuggestions(element, options); } } void AutofillAgent::OpenTextDataListChooser(const WebInputElement& element) { DCHECK(IsOwnedByFrame(element, render_frame())); - ShowSuggestions(element, {.autofill_on_empty_values = true}); + ShowSuggestionsOptions options; + options.autofill_on_empty_values = true; + ShowSuggestions(element, options); } // Notifies the AutofillDriver about changes in the <datalist> options in @@ -1130,16 +1135,17 @@ void AutofillAgent::FormControlElementClicked( password_autofill_agent_->TryToShowTouchToFill(element); #endif - ShowSuggestions( - element, {.autofill_on_empty_values = true, + ShowSuggestionsOptions options; + options.autofill_on_empty_values = true; // Even if the user has not edited an input element, it may // still contain a value: A default value filled by the website. // In that case, we don't want to elide suggestions that don't // have a common prefix with the default value. - .show_full_suggestion_list = - element.IsAutofilled() || !element.UserHasEditedTheField(), - .form_element_was_clicked = FormElementWasClicked(true)}); + options.show_full_suggestion_list = + element.IsAutofilled() || !element.UserHasEditedTheField(); + options.form_element_was_clicked = FormElementWasClicked(true); + ShowSuggestions(element, std::move(options)); SendPotentiallySubmittedFormToBrowser(); } diff --git a/chromium/components/autofill/content/renderer/form_autofill_util.cc b/chromium/components/autofill/content/renderer/form_autofill_util.cc index 3e5a3d8a263..ae7db554c3c 100644 --- a/chromium/components/autofill/content/renderer/form_autofill_util.cc +++ b/chromium/components/autofill/content/renderer/form_autofill_util.cc @@ -943,8 +943,8 @@ void GetOptionStringsFromElement(const WebSelectElement& select_element, for (const auto& list_item : list_items) { if (IsOptionElement(list_item)) { const WebOptionElement option = list_item.To<WebOptionElement>(); - options->push_back({.value = option.Value().Utf16(), - .content = option.GetText().Utf16()}); + options->push_back({/*.value =*/ option.Value().Utf16(), + /*.content =*/ option.GetText().Utf16()}); } } } diff --git a/chromium/components/autofill/core/common/form_field_data.cc b/chromium/components/autofill/core/common/form_field_data.cc index d095c7410e6..a5834a81905 100644 --- a/chromium/components/autofill/core/common/form_field_data.cc +++ b/chromium/components/autofill/core/common/form_field_data.cc @@ -39,7 +39,7 @@ bool ReadSelectOption(base::PickleIterator* iter, SelectOption* option) { std::u16string content; if (!iter->ReadString16(&value) || !iter->ReadString16(&content)) return false; - *option = {.value = value, .content = content}; + *option = { /* .value = */ value, /* .content =*/ content}; return true; } @@ -136,8 +136,8 @@ bool DeserializeSection3(base::PickleIterator* iter, return false; } for (size_t i = 0; i < option_values.size(); ++i) { - field_data->options.push_back({.value = std::move(option_values[i]), - .content = std::move(option_contents[i])}); + field_data->options.push_back({/*.value =*/ std::move(option_values[i]), + /*.content =*/ std::move(option_contents[i])}); } return true; } diff --git a/chromium/components/cdm/renderer/widevine_key_system_info.cc b/chromium/components/cdm/renderer/widevine_key_system_info.cc index e4140ea3a81..abc1aa4096f 100644 --- a/chromium/components/cdm/renderer/widevine_key_system_info.cc +++ b/chromium/components/cdm/renderer/widevine_key_system_info.cc @@ -123,9 +123,13 @@ EmeConfig::Rule WidevineKeySystemInfo::GetEncryptionSchemeConfigRule( if (is_supported && is_hw_secure_supported) { return EmeConfig::SupportedRule(); } else if (is_supported && !is_hw_secure_supported) { - return EmeConfig{.hw_secure_codecs = EmeConfigRuleState::kNotAllowed}; + EmeConfig tmp = {}; + tmp.hw_secure_codecs = EmeConfigRuleState::kNotAllowed; + return tmp; } else if (!is_supported && is_hw_secure_supported) { - return EmeConfig{.hw_secure_codecs = EmeConfigRuleState::kRequired}; + EmeConfig tmp = {}; + tmp.hw_secure_codecs = EmeConfigRuleState::kRequired; + return tmp; } else { return media::EmeConfig::UnsupportedRule(); } @@ -212,9 +216,11 @@ EmeConfig::Rule WidevineKeySystemInfo::GetRobustnessConfigRule( // requires identifier and persistent state. if (IsHardwareSecurityEnabledForKeySystem(key_system)) { - return EmeConfig{.identifier = EmeConfigRuleState::kRequired, - .persistence = EmeConfigRuleState::kRequired, - .hw_secure_codecs = EmeConfigRuleState::kRequired}; + EmeConfig tmp = {}; + tmp.identifier = EmeConfigRuleState::kRequired; + tmp.persistence = EmeConfigRuleState::kRequired; + tmp.hw_secure_codecs = EmeConfigRuleState::kRequired; + return tmp; } else { return media::EmeConfig::UnsupportedRule(); } @@ -222,7 +228,9 @@ EmeConfig::Rule WidevineKeySystemInfo::GetRobustnessConfigRule( // On Windows, when software security is queried, explicitly not allow // hardware secure codecs to prevent robustness level upgrade, for stability // and compatibility reasons. See https://crbug.com/1327043. - return EmeConfig{.hw_secure_codecs = EmeConfigRuleState::kNotAllowed}; + EmeConfig config = {}; + config.hw_secure_codecs = EmeConfigRuleState::kNotAllowed; + return config; } #else // On other platforms, require hardware secure codecs for HW_SECURE_CRYPTO and @@ -265,9 +273,13 @@ EmeConfig::Rule WidevineKeySystemInfo::GetPersistentLicenseSessionSupport() if (is_supported && is_hw_secure_supported) { return EmeConfig::SupportedRule(); } else if (is_supported && !is_hw_secure_supported) { - return EmeConfig{.hw_secure_codecs = EmeConfigRuleState::kNotAllowed}; + EmeConfig config = {}; + config.hw_secure_codecs = EmeConfigRuleState::kNotAllowed; + return config; } else if (!is_supported && is_hw_secure_supported) { - return EmeConfig{.hw_secure_codecs = EmeConfigRuleState::kRequired}; + EmeConfig config = {}; + config.hw_secure_codecs = EmeConfigRuleState::kRequired; + return config; } else { return media::EmeConfig::UnsupportedRule(); } diff --git a/chromium/components/favicon/core/favicon_database.cc b/chromium/components/favicon/core/favicon_database.cc index ba70f3e76e4..606e0660ab9 100644 --- a/chromium/components/favicon/core/favicon_database.cc +++ b/chromium/components/favicon/core/favicon_database.cc @@ -249,14 +249,14 @@ bool FaviconDatabase::IconMappingEnumerator::GetNextIconMapping( } FaviconDatabase::FaviconDatabase() - : db_({// Run the database in exclusive mode. Nobody else should be + : db_(sql::DatabaseOptions(// Run the database in exclusive mode. Nobody else should be // accessing the database while we're running, and this will give // somewhat improved perf. - .exclusive_locking = true, + /*.exclusive_locking =*/ true, // Favicons db only stores favicons, so we don't need that big a page // size or cache. - .page_size = 2048, - .cache_size = 32}) {} + /*.page_size =*/ 2048, + /*.cache_size =*/ 32)) {} FaviconDatabase::~FaviconDatabase() { // The DBCloseScoper will delete the DB and the cache. diff --git a/chromium/components/history/core/browser/history_database.cc b/chromium/components/history/core/browser/history_database.cc index dea4223614c..38dbea5074d 100644 --- a/chromium/components/history/core/browser/history_database.cc +++ b/chromium/components/history/core/browser/history_database.cc @@ -81,21 +81,21 @@ HistoryDatabase::HistoryDatabase( DownloadInterruptReason download_interrupt_reason_crash) : DownloadDatabase(download_interrupt_reason_none, download_interrupt_reason_crash), - db_(sql::DatabaseOptions{ + db_(sql::DatabaseOptions( // Note that we don't set exclusive locking here. That's done by // BeginExclusiveMode below which is called later (we have to be in // shared mode to start out for the in-memory backend to read the // data). // TODO(1153459) Remove this dependency on normal locking mode. - .exclusive_locking = false, + /*.exclusive_locking =*/ false, // Set the database page size to something a little larger to give us // better performance (we're typically seek rather than bandwidth // limited). Must be a power of 2 and a max of 65536. - .page_size = 4096, + /*.page_size =*/ 4096, // Set the cache size. The page size, plus a little extra, times this // value, tells us how much memory the cache will use maximum. // 1000 * 4kB = 4MB - .cache_size = 1000}) + /*.cache_size =*/ 1000)) #if !defined(TOOLKIT_QT) , typed_url_metadata_db_(&db_, &meta_table_) , history_metadata_db_(&db_, &meta_table_) diff --git a/chromium/components/history/core/browser/in_memory_database.cc b/chromium/components/history/core/browser/in_memory_database.cc index 0f746a89d3c..0cf938afbad 100644 --- a/chromium/components/history/core/browser/in_memory_database.cc +++ b/chromium/components/history/core/browser/in_memory_database.cc @@ -16,7 +16,7 @@ namespace history { InMemoryDatabase::InMemoryDatabase() - : db_({.exclusive_locking = true, .page_size = 4096, .cache_size = 500}) {} + : db_(sql::DatabaseOptions(/*.exclusive_locking =*/ true, /*.page_size =*/ 4096, /*.cache_size =*/ 500)) {} InMemoryDatabase::~InMemoryDatabase() = default; diff --git a/chromium/components/metrics/cloned_install_detector.cc b/chromium/components/metrics/cloned_install_detector.cc index 6b960423575..b498c16a5b0 100644 --- a/chromium/components/metrics/cloned_install_detector.cc +++ b/chromium/components/metrics/cloned_install_detector.cc @@ -120,12 +120,13 @@ void ClonedInstallDetector::RegisterPrefs(PrefRegistrySimple* registry) { ClonedInstallInfo ClonedInstallDetector::ReadClonedInstallInfo( PrefService* local_state) { - return ClonedInstallInfo{ - .last_reset_timestamp = + ClonedInstallInfo out = { +// .last_reset_timestamp = local_state->GetInt64(prefs::kLastClonedResetTimestamp), - .first_reset_timestamp = +// .first_reset_timestamp = local_state->GetInt64(prefs::kFirstClonedResetTimestamp), - .reset_count = local_state->GetInteger(prefs::kClonedResetCount)}; + /*.reset_count =*/ local_state->GetInteger(prefs::kClonedResetCount)}; + return out; } void ClonedInstallDetector::ClearClonedInstallInfo(PrefService* local_state) { diff --git a/chromium/components/services/storage/shared_storage/shared_storage_database.cc b/chromium/components/services/storage/shared_storage/shared_storage_database.cc index b39fb4ea75c..6eed4c4ea76 100644 --- a/chromium/components/services/storage/shared_storage/shared_storage_database.cc +++ b/chromium/components/services/storage/shared_storage/shared_storage_database.cc @@ -140,14 +140,14 @@ SharedStorageDatabase::SharedStorageDatabase( base::FilePath db_path, scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy, std::unique_ptr<SharedStorageDatabaseOptions> options) - : db_({// Run the database in exclusive mode. Nobody else should be + : db_(sql::DatabaseOptions(// Run the database in exclusive mode. Nobody else should be // accessing the database while we're running, and this will give // somewhat improved perf. - .exclusive_locking = true, + /*.exclusive_locking =*/ true, // We DCHECK that the page size is valid in the constructor for // `SharedStorageOptions`. - .page_size = options->max_page_size, - .cache_size = options->max_cache_size}), + /*.page_size =*/ options->max_page_size, + /*.cache_size =*/ options->max_cache_size)), db_path_(std::move(db_path)), special_storage_policy_(std::move(special_storage_policy)), // We DCHECK that these `options` fields are all positive in the diff --git a/chromium/components/site_isolation/site_isolation_policy.cc b/chromium/components/site_isolation/site_isolation_policy.cc index b65e3257bdd..6443018f1b5 100644 --- a/chromium/components/site_isolation/site_isolation_policy.cc +++ b/chromium/components/site_isolation/site_isolation_policy.cc @@ -95,9 +95,9 @@ bool ShouldDisableSiteIsolationDueToMemorySlow( IsolationDisableDecisions MakeBothDecisions() { IsolationDisableDecisions result{ - .should_disable_strict = ShouldDisableSiteIsolationDueToMemorySlow( + /*.should_disable_strict =*/ ShouldDisableSiteIsolationDueToMemorySlow( content::SiteIsolationMode::kStrictSiteIsolation), - .should_disable_partial = ShouldDisableSiteIsolationDueToMemorySlow( + /*.should_disable_partial =*/ ShouldDisableSiteIsolationDueToMemorySlow( content::SiteIsolationMode::kPartialSiteIsolation)}; return result; } diff --git a/chromium/components/variations/variations_layers.cc b/chromium/components/variations/variations_layers.cc index 448d8529824..8445104d670 100644 --- a/chromium/components/variations/variations_layers.cc +++ b/chromium/components/variations/variations_layers.cc @@ -64,8 +64,8 @@ void VariationsLayers::ConstructLayer(const EntropyProviders& entropy_providers, if (!chosen_member) return; active_member_for_layer_.emplace( - layer_proto.id(), LayerInfo{.active_member_id = chosen_member->id(), - .entropy_mode = layer_proto.entropy_mode()}); + layer_proto.id(), LayerInfo{/*.active_member_id =*/ chosen_member->id(), + /* .entropy_mode =*/ layer_proto.entropy_mode()}); } bool VariationsLayers::IsLayerMemberActive(uint32_t layer_id, diff --git a/chromium/components/variations/variations_seed_store.cc b/chromium/components/variations/variations_seed_store.cc index d8d5c1460de..f5cd7ca623a 100644 --- a/chromium/components/variations/variations_seed_store.cc +++ b/chromium/components/variations/variations_seed_store.cc @@ -170,10 +170,8 @@ void VariationsSeedStore::StoreSeedData( base::OnceCallback<void(bool, VariationsSeed)> done_callback) { UMA_HISTOGRAM_COUNTS_1000("Variations.StoreSeed.DataSize", data.length() / 1024); - InstanceManipulations im = { - .gzip_compressed = is_gzip_compressed, - .delta_compressed = is_delta_compressed, - }; + InstanceManipulations im{is_gzip_compressed, is_delta_compressed}; + RecordSeedInstanceManipulations(im); std::string seed_bytes; StoreSeedResult im_result = diff --git a/chromium/components/viz/service/display_embedder/skia_output_device.cc b/chromium/components/viz/service/display_embedder/skia_output_device.cc index 497396e88fb..09a09bee261 100644 --- a/chromium/components/viz/service/display_embedder/skia_output_device.cc +++ b/chromium/components/viz/service/display_embedder/skia_output_device.cc @@ -342,10 +342,9 @@ GrSemaphoresSubmitted SkiaOutputDevice::Flush( VulkanContextProvider* vulkan_context_provider, std::vector<GrBackendSemaphore> end_semaphores, base::OnceClosure on_finished) { - GrFlushInfo flush_info = { - .fNumSemaphores = end_semaphores.size(), - .fSignalSemaphores = end_semaphores.data(), - }; + GrFlushInfo flush_info; + flush_info.fNumSemaphores = end_semaphores.size(); + flush_info.fSignalSemaphores = end_semaphores.data(); gpu::AddVulkanCleanupTaskForSkiaFlush(vulkan_context_provider, &flush_info); if (on_finished) gpu::AddCleanupTaskForSkiaFlush(std::move(on_finished), &flush_info); diff --git a/chromium/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/chromium/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc index 1c5d4980623..23f299b27cd 100644 --- a/chromium/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +++ b/chromium/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc @@ -682,9 +682,10 @@ void SkiaOutputSurfaceImplOnGpu::FinishPaintRenderPass( } #endif GrFlushInfo flush_info = { - .fNumSemaphores = end_semaphores.size(), - .fSignalSemaphores = end_semaphores.data(), + /*.fNumSemaphores =*/ end_semaphores.size(), + /*.fSignalSemaphores =*/ end_semaphores.data(), }; + gpu::AddVulkanCleanupTaskForSkiaFlush(vulkan_context_provider_, &flush_info); if (on_finished) { diff --git a/chromium/components/webdata/common/web_database.cc b/chromium/components/webdata/common/web_database.cc index aa8216070f6..d73fe9f89c9 100644 --- a/chromium/components/webdata/common/web_database.cc +++ b/chromium/components/webdata/common/web_database.cc @@ -48,17 +48,17 @@ sql::InitStatus FailedMigrationTo(int version_num) { } // namespace WebDatabase::WebDatabase() - : db_({// Run the database in exclusive mode. Nobody else should be + : db_(sql::DatabaseOptions(// Run the database in exclusive mode. Nobody else should be // accessing the database while we're running, and this will give // somewhat improved perf. - .exclusive_locking = true, + /* .exclusive_locking = */ true, // We don't store that much data in the tables so use a small page // size. This provides a large benefit for empty tables (which is // very likely with the tables we create). - .page_size = 2048, + /* .page_size = */ 2048, // We shouldn't have much data and what access we currently have is // quite infrequent. So we go with a small cache size. - .cache_size = 32}) {} + /* .cache_size = */ 32)) {} WebDatabase::~WebDatabase() = default; diff --git a/chromium/content/app/content_main_runner_impl.cc b/chromium/content/app/content_main_runner_impl.cc index a96069d6269..b655886efef 100644 --- a/chromium/content/app/content_main_runner_impl.cc +++ b/chromium/content/app/content_main_runner_impl.cc @@ -1135,7 +1135,7 @@ int ContentMainRunnerImpl::RunBrowser(MainFunctionParams main_params, if (!mojo_ipc_support_) { const ContentMainDelegate::InvokedInBrowserProcess invoked_in_browser{ - .is_running_test = !main_params.ui_task.is_null()}; + /*.is_running_test =*/ !main_params.ui_task.is_null()}; if (delegate_->ShouldCreateFeatureList(invoked_in_browser)) { // This is intentionally leaked since it needs to live for the duration // of the process and there's no benefit in cleaning it up at exit. diff --git a/chromium/content/browser/aggregation_service/aggregation_service_storage_sql.cc b/chromium/content/browser/aggregation_service/aggregation_service_storage_sql.cc index 255c45230a1..fd258c05fec 100644 --- a/chromium/content/browser/aggregation_service/aggregation_service_storage_sql.cc +++ b/chromium/content/browser/aggregation_service/aggregation_service_storage_sql.cc @@ -154,9 +154,9 @@ AggregationServiceStorageSql::AggregationServiceStorageSql( clock_(*clock), max_stored_requests_per_reporting_origin_( max_stored_requests_per_reporting_origin), - db_(sql::DatabaseOptions{.exclusive_locking = true, - .page_size = 4096, - .cache_size = 32}) { + db_(sql::DatabaseOptions(/*.exclusive_locking =*/ true, + /*.page_size =*/ 4096, + /*.cache_size =*/ 32)) { DETACH_FROM_SEQUENCE(sequence_checker_); DCHECK(clock); @@ -628,8 +628,8 @@ AggregationServiceStorageSql::GetRequestsReportingOnOrBefore( return {}; result.push_back(AggregationServiceStorage::RequestAndId{ - .request = std::move(parsed_request.value()), - .id = AggregationServiceStorage::RequestId( + /*.request =*/ std::move(parsed_request.value()), + /*.id =*/ AggregationServiceStorage::RequestId( get_requests_statement.ColumnInt64(0))}); } @@ -664,8 +664,8 @@ AggregationServiceStorageSql::GetRequests( if (!parsed_request) continue; result.push_back(AggregationServiceStorage::RequestAndId{ - .request = std::move(*parsed_request), - .id = id, + /*.request =*/ std::move(*parsed_request), + /*.id =*/ id, }); } return result; diff --git a/chromium/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc b/chromium/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc index 75654abeee1..69238b27aeb 100644 --- a/chromium/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc +++ b/chromium/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc @@ -231,10 +231,14 @@ void AttributionDataHostManagerImpl::RegisterDataHost( url::Origin context_origin) { DCHECK(network::IsOriginPotentiallyTrustworthy(context_origin)); + + FrozenContext tmp = {}; + tmp.context_origin = std::move(context_origin); + tmp.source_type = AttributionSourceType::kEvent; + tmp.register_time = base::TimeTicks::Now(); + receivers_.Add(this, std::move(data_host), - FrozenContext{.context_origin = std::move(context_origin), - .source_type = AttributionSourceType::kEvent, - .register_time = base::TimeTicks::Now()}); + std::move(tmp)); data_hosts_in_source_mode_++; } @@ -243,8 +247,8 @@ bool AttributionDataHostManagerImpl::RegisterNavigationDataHost( const blink::AttributionSrcToken& attribution_src_token) { auto [it, inserted] = navigation_data_host_map_.try_emplace( attribution_src_token, - NavigationDataHost{.data_host = std::move(data_host), - .register_time = base::TimeTicks::Now()}); + NavigationDataHost{/*.data_host =*/ std::move(data_host), + /*.register_time =*/ base::TimeTicks::Now()}); // Should only be possible with a misbehaving renderer. if (!inserted) return false; @@ -275,8 +279,9 @@ void AttributionDataHostManagerImpl::NotifyNavigationRedirectRegistration( auto [it, inserted] = redirect_registrations_.try_emplace( attribution_src_token, NavigationRedirectSourceRegistrations{ - .source_origin = source_origin, - .register_time = base::TimeTicks::Now()}); + /*.source_origin =*/ source_origin, + 0, {}, {}, + /*.register_time =*/ base::TimeTicks::Now()}); // Redirect data may not be registered if the navigation is already finished. DCHECK(it->second.destination.opaque()); @@ -312,10 +317,11 @@ void AttributionDataHostManagerImpl::NotifyNavigationForDataHost( if (it != navigation_data_host_map_.end()) { receivers_.Add( this, std::move(it->second.data_host), - FrozenContext{.context_origin = source_origin, - .source_type = AttributionSourceType::kNavigation, - .destination = net::SchemefulSite(destination_origin), - .register_time = it->second.register_time}); + FrozenContext{/*.context_origin =*/ source_origin, + /*.source_type =*/ AttributionSourceType::kNavigation, + /*.destination =*/ net::SchemefulSite(destination_origin), + RegistrationType::kNone, 0, + /*.register_time =*/ it->second.register_time}); navigation_data_host_map_.erase(it); RecordNavigationDataHostStatus(NavigationDataHostStatus::kProcessed); @@ -600,8 +606,8 @@ void AttributionDataHostManagerImpl::TriggerDataAvailable( const base::TimeDelta delay = kTriggerDelay.Get(); delayed_triggers_.emplace_back(DelayedTrigger{ - .delay_until = base::TimeTicks::Now() + delay, - .trigger = std::move(trigger), + /*.delay_until =*/ base::TimeTicks::Now() + delay, + /*.trigger =*/ std::move(trigger), }); RecordTriggerQueueEvent(TriggerQueueEvent::kEnqueued); diff --git a/chromium/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc b/chromium/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc index 621567b4fd0..4d63edf8cad 100644 --- a/chromium/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc +++ b/chromium/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc @@ -124,8 +124,8 @@ AttributionStorageDelegateImpl::GetOfflineReportDelayConfig() const { // sent at reasonable times, and not delayed for many browser sessions due // to short session up-times. return OfflineReportDelayConfig{ - .min = base::Minutes(0), - .max = base::Minutes(1), + /*.min =*/ base::Minutes(0), + /*.max =*/ base::Minutes(1), }; } @@ -218,8 +218,8 @@ AttributionStorageDelegateImpl::GetFakeReportsForSequenceIndex( DCHECK_LT(trigger_data, trigger_data_cardinality); fake_reports.push_back({ - .trigger_data = static_cast<uint64_t>(trigger_data), - .report_time = ReportTimeAtWindow(source, /*window_index=*/result.quot), + /*.trigger_data =*/ static_cast<uint64_t>(trigger_data), + /*.report_time =*/ ReportTimeAtWindow(source, /*window_index=*/result.quot), }); } return fake_reports; diff --git a/chromium/content/browser/attribution_reporting/attribution_storage_sql.cc b/chromium/content/browser/attribution_reporting/attribution_storage_sql.cc index 7247c51f7d4..38c877198ff 100644 --- a/chromium/content/browser/attribution_reporting/attribution_storage_sql.cc +++ b/chromium/content/browser/attribution_reporting/attribution_storage_sql.cc @@ -347,7 +347,7 @@ absl::optional<StoredSourceData> ReadSourceFromStatement( return absl::nullopt; return StoredSourceData{ - .source = StoredSource( + /*.source =*/ StoredSource( CommonSourceInfo( source_event_id, std::move(source_origin), std::move(destination_origin), std::move(reporting_origin), @@ -355,7 +355,7 @@ absl::optional<StoredSourceData> ReadSourceFromStatement( std::move(*filter_data), debug_key, std::move(*aggregation_keys)), *attribution_logic, *active_state, source_id, aggregatable_budget_consumed), - .num_conversions = num_conversions}; + /*.num_conversions =*/ num_conversions}; } absl::optional<StoredSourceData> ReadSourceToAttribute( @@ -1953,7 +1953,7 @@ bool AttributionStorageSql::LazyInit(DbCreationPolicy creation_policy) { } db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{ - .exclusive_locking = true, .page_size = 4096, .cache_size = 32}); + /*.exclusive_locking =*/ true, /*.page_size =*/ 4096, /*.cache_size =*/ 32}); db_->set_histogram_tag("Conversions"); // `base::Unretained()` is safe because the callback will only be called diff --git a/chromium/content/browser/browsing_topics/browsing_topics_site_data_storage.cc b/chromium/content/browser/browsing_topics/browsing_topics_site_data_storage.cc index 2dd4e2fff67..8ab22b3244b 100644 --- a/chromium/content/browser/browsing_topics/browsing_topics_site_data_storage.cc +++ b/chromium/content/browser/browsing_topics/browsing_topics_site_data_storage.cc @@ -162,8 +162,8 @@ bool BrowsingTopicsSiteDataStorage::LazyInit() { if (db_init_status_ != InitStatus::kUnattempted) return db_init_status_ == InitStatus::kSuccess; - db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{ - .exclusive_locking = true, .page_size = 4096, .cache_size = 32}); + db_ = std::make_unique<sql::Database>(sql::DatabaseOptions( + /*.exclusive_locking =*/ true, /*.page_size =*/ 4096, /*.cache_size = */32)); db_->set_histogram_tag("BrowsingTopics"); // base::Unretained is safe here because this BrowsingTopicsSiteDataStorage diff --git a/chromium/content/browser/first_party_sets/database/first_party_sets_database.cc b/chromium/content/browser/first_party_sets/database/first_party_sets_database.cc index f37854bf4ad..08abeca99d0 100644 --- a/chromium/content/browser/first_party_sets/database/first_party_sets_database.cc +++ b/chromium/content/browser/first_party_sets/database/first_party_sets_database.cc @@ -645,8 +645,8 @@ bool FirstPartySetsDatabase::LazyInit() { return db_status_ == InitStatus::kSuccess; DCHECK_EQ(db_.get(), nullptr); - db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{ - .exclusive_locking = true, .page_size = 4096, .cache_size = 32}); + db_ = std::make_unique<sql::Database>(sql::DatabaseOptions( + /*.exclusive_locking =*/ true, /*.page_size = */ 4096, /*.cache_size =*/ 32)); db_->set_histogram_tag("FirstPartySets"); // base::Unretained is safe here because this FirstPartySetsDatabase owns // the sql::Database instance that stores and uses the callback. So, diff --git a/chromium/content/browser/first_party_sets/first_party_set_parser.cc b/chromium/content/browser/first_party_sets/first_party_set_parser.cc index c119d200643..c56be4e99da 100644 --- a/chromium/content/browser/first_party_sets/first_party_set_parser.cc +++ b/chromium/content/browser/first_party_sets/first_party_set_parser.cc @@ -301,15 +301,15 @@ base::expected<SetsAndAliases, ParseError> ParseSet( for (const SubsetDescriptor& descriptor : { SubsetDescriptor{ - .field_name = kFirstPartySetAssociatedSitesField, - .site_type = net::SiteType::kAssociated, - .size_limit = absl::make_optional( + /*.field_name =*/ kFirstPartySetAssociatedSitesField, + /*.site_type =*/ net::SiteType::kAssociated, + /*.size_limit =*/ absl::make_optional( features::kFirstPartySetsMaxAssociatedSites.Get()), }, { - .field_name = kFirstPartySetServiceSitesField, - .site_type = net::SiteType::kService, - .size_limit = absl::nullopt, + /*.field_name =*/ kFirstPartySetServiceSitesField, + /*.site_type =*/ net::SiteType::kService, + /*.size_limit =*/ absl::nullopt, }, }) { if (absl::optional<ParseError> error = diff --git a/chromium/content/browser/font_access/font_access_manager.cc b/chromium/content/browser/font_access/font_access_manager.cc index 00ef53c2230..dfb23551c9e 100644 --- a/chromium/content/browser/font_access/font_access_manager.cc +++ b/chromium/content/browser/font_access/font_access_manager.cc @@ -63,7 +63,7 @@ void FontAccessManager::BindReceiver( receivers_.Add(this, std::move(receiver), { - .frame_id = frame_id, + /*.frame_id =*/ frame_id, }); } diff --git a/chromium/content/browser/font_access/font_enumeration_cache.cc b/chromium/content/browser/font_access/font_enumeration_cache.cc index bfe739cde8e..52d8692147b 100644 --- a/chromium/content/browser/font_access/font_enumeration_cache.cc +++ b/chromium/content/browser/font_access/font_enumeration_cache.cc @@ -71,7 +71,7 @@ FontEnumerationData FontEnumerationCache::GetFontEnumerationData() { } DCHECK(initialized_); - return {.status = data_.status, .font_data = data_.font_data.Duplicate()}; + return {/*.status =*/ data_.status, /*.font_data =*/ data_.font_data.Duplicate()}; } void FontEnumerationCache::BuildEnumerationCache( diff --git a/chromium/content/browser/media/media_license_database.cc b/chromium/content/browser/media/media_license_database.cc index 3967e89c0fd..504a72a80c0 100644 --- a/chromium/content/browser/media/media_license_database.cc +++ b/chromium/content/browser/media/media_license_database.cc @@ -25,9 +25,9 @@ MediaLicenseDatabase::MediaLicenseDatabase(const base::FilePath& path) // bytes) and that we'll typically only be pulling one file at a time // (playback), specify a large page size to allow inner nodes can pack // many keys, to keep the index B-tree flat. - db_(sql::DatabaseOptions{.exclusive_locking = true, - .page_size = 32768, - .cache_size = 8}) {} + db_(sql::DatabaseOptions(/*.exclusive_locking =*/ true, + /*.page_size =*/ 32768, + /*.cache_size =*/ 8)) {} bool MediaLicenseDatabase::OpenFile(const media::CdmType& cdm_type, const std::string& file_name) { diff --git a/chromium/content/browser/preloading/prefetch/prefetch_canary_checker.h b/chromium/content/browser/preloading/prefetch/prefetch_canary_checker.h index a06aa6dfa10..49fc0887354 100644 --- a/chromium/content/browser/preloading/prefetch/prefetch_canary_checker.h +++ b/chromium/content/browser/preloading/prefetch/prefetch_canary_checker.h @@ -68,14 +68,14 @@ class CONTENT_EXPORT PrefetchCanaryChecker { // Backoff policy to use to compute how long we should wait between the end // of last retry and start of next retry. net::BackoffEntry::Policy backoff_policy = { - .num_errors_to_ignore = 0, - .initial_delay_ms = 100, - .multiply_factor = 2, - .jitter_factor = 0.2, + /*.num_errors_to_ignore =*/ 0, + /*.initial_delay_ms =*/ 100, + /*.multiply_factor =*/ 2, + /*.jitter_factor =*/ 0.2, // No maximum backoff. - .maximum_backoff_ms = -1, - .entry_lifetime_ms = -1, - .always_use_initial_delay = false, + /*.maximum_backoff_ms =*/ -1, + /*.entry_lifetime_ms =*/ -1, + /*.always_use_initial_delay =*/ false, }; }; diff --git a/chromium/content/browser/preloading/speculation_rules/speculation_host_impl.cc b/chromium/content/browser/preloading/speculation_rules/speculation_host_impl.cc index cde3a76525b..a4ad5e51f79 100644 --- a/chromium/content/browser/preloading/speculation_rules/speculation_host_impl.cc +++ b/chromium/content/browser/preloading/speculation_rules/speculation_host_impl.cc @@ -363,9 +363,9 @@ void SpeculationHostImpl::ProcessCandidatesForPrerender( // have the same URL but its `target_browsing_context_name_hint` is // different. In the current implementation, only the first rule is // triggered. - started_prerenders_.insert(end, {.url = it->url, - .referrer = referrer, - .prerender_host_id = prerender_host_id}); + started_prerenders_.insert(end, {/*.url =*/ it->url, + /*.referrer =*/ referrer, + /*.prerender_host_id =*/ prerender_host_id}); // Start to observe PrerenderHost to get the information about FinalStatus. observers_.push_back(std::make_unique<PrerenderHostObserver>( diff --git a/chromium/content/browser/private_aggregation/private_aggregation_budget_storage.cc b/chromium/content/browser/private_aggregation/private_aggregation_budget_storage.cc index 270a17f1d9d..972aa49077c 100644 --- a/chromium/content/browser/private_aggregation/private_aggregation_budget_storage.cc +++ b/chromium/content/browser/private_aggregation/private_aggregation_budget_storage.cc @@ -89,9 +89,9 @@ PrivateAggregationBudgetStorage::PrivateAggregationBudgetStorage( kFlushDelay), db_task_runner_(std::move(db_task_runner)), db_(std::make_unique<sql::Database>( - sql::DatabaseOptions{.exclusive_locking = true, - .page_size = 4096, - .cache_size = 32})) {} + sql::DatabaseOptions(/* .exclusive_locking = */true, + /*.page_size = */ 4096, + /*.cache_size = */32))) {} PrivateAggregationBudgetStorage::~PrivateAggregationBudgetStorage() { Shutdown(); diff --git a/chromium/content/browser/private_aggregation/private_aggregation_host.cc b/chromium/content/browser/private_aggregation/private_aggregation_host.cc index 84bc62bb956..2de5274bd36 100644 --- a/chromium/content/browser/private_aggregation/private_aggregation_host.cc +++ b/chromium/content/browser/private_aggregation/private_aggregation_host.cc @@ -79,9 +79,9 @@ bool PrivateAggregationHost::BindNewReceiver( } receiver_set_.Add( this, std::move(pending_receiver), - ReceiverContext{.worklet_origin = std::move(worklet_origin), - .top_frame_origin = std::move(top_frame_origin), - .api_for_budgeting = api_for_budgeting}); + ReceiverContext{/*.worklet_origin =*/ std::move(worklet_origin), + /*.top_frame_origin =*/ std::move(top_frame_origin), + /*.api_for_budgeting =*/ api_for_budgeting}); return true; } diff --git a/chromium/content/browser/renderer_host/media/media_stream_dispatcher_host.cc b/chromium/content/browser/renderer_host/media/media_stream_dispatcher_host.cc index c5edf50a372..73363670165 100644 --- a/chromium/content/browser/renderer_host/media/media_stream_dispatcher_host.cc +++ b/chromium/content/browser/renderer_host/media/media_stream_dispatcher_host.cc @@ -355,13 +355,13 @@ MediaStreamDispatcherHost::GenerateStreamsChecksOnUIThread( // TODO(crbug.com/1342071): Add tests for |request_all_screens| being true. if (request_all_screens && !CheckRequestAllScreensAllowed(render_process_id, render_frame_id)) { - return {.request_allowed = false, - .salt_and_origin = MediaDeviceSaltAndOrigin()}; + return {/*.request_allowed =*/ false, + /*.salt_and_origin =*/ MediaDeviceSaltAndOrigin()}; } return { - .request_allowed = true, - .salt_and_origin = std::move(generate_salt_and_origin_callback).Run()}; + /*.request_allowed =*/ true, + /*.salt_and_origin =*/ std::move(generate_salt_and_origin_callback).Run()}; } const mojo::Remote<blink::mojom::MediaStreamDeviceObserver>& diff --git a/chromium/content/browser/shared_storage/shared_storage_worklet_host.cc b/chromium/content/browser/shared_storage/shared_storage_worklet_host.cc index 3622150489e..d0f6c71166a 100644 --- a/chromium/content/browser/shared_storage/shared_storage_worklet_host.cc +++ b/chromium/content/browser/shared_storage/shared_storage_worklet_host.cc @@ -65,8 +65,8 @@ SharedStorageURNMappingResult CalculateSharedStorageURNMappingResult( return SharedStorageURNMappingResult( mapped_url, - SharedStorageBudgetMetadata{.origin = shared_storage_origin, - .budget_to_charge = budget_to_charge}, + SharedStorageBudgetMetadata{/*.origin =*/ shared_storage_origin, + /*.budget_to_charge =*/ budget_to_charge}, urls_with_metadata[index]->reporting_metadata); } diff --git a/chromium/content/renderer/v8_value_converter_impl.cc b/chromium/content/renderer/v8_value_converter_impl.cc index cff2484a1b3..c16fb99da92 100644 --- a/chromium/content/renderer/v8_value_converter_impl.cc +++ b/chromium/content/renderer/v8_value_converter_impl.cc @@ -280,9 +280,9 @@ v8::Local<v8::Value> V8ValueConverterImpl::ToV8ValueImpl( } }; - return value.Visit(Visitor{.converter = this, - .isolate = isolate, - .creation_context = creation_context}); + return value.Visit(Visitor{/*.converter =*/ this, + /*.isolate =*/ isolate, + /*.creation_context =*/ creation_context}); } v8::Local<v8::Value> V8ValueConverterImpl::ToV8Array( diff --git a/chromium/device/fido/aoa/android_accessory_discovery.cc b/chromium/device/fido/aoa/android_accessory_discovery.cc index 8a1b67c91be..3c80e6fad9a 100644 --- a/chromium/device/fido/aoa/android_accessory_discovery.cc +++ b/chromium/device/fido/aoa/android_accessory_discovery.cc @@ -149,11 +149,11 @@ FindAccessoryInterface(const device::mojom::UsbDeviceInfoPtr& device_info) { } return AndroidAccessoryDiscovery::InterfaceInfo{ - .configuration = config->configuration_value, - .interface = interface->interface_number, - .in_endpoint = *in_endpoint_num, - .out_endpoint = *out_endpoint_num, - .guid = device_info->guid, + /* .configuration = */ config->configuration_value, + /* .interface = */ interface->interface_number, + /* .in_endpoint = */ *in_endpoint_num, + /* .out_endpoint = */ *out_endpoint_num, + /* .guid = */ device_info->guid, }; } } diff --git a/chromium/device/fido/credential_management_handler.cc b/chromium/device/fido/credential_management_handler.cc index 16961ed09ee..dcce96e3c77 100644 --- a/chromium/device/fido/credential_management_handler.cc +++ b/chromium/device/fido/credential_management_handler.cc @@ -106,9 +106,9 @@ void CredentialManagementHandler::OnRetriesResponse( } state_ = State::kWaitingForPIN; get_pin_callback_.Run( - {.min_pin_length = authenticator_->CurrentMinPINLength(), - .pin_retries = response->retries, - .supports_update_user_information = + {/*.min_pin_length =*/ authenticator_->CurrentMinPINLength(), + /*.pin_retries =*/ response->retries, +// .supports_update_user_information = authenticator_->SupportsUpdateUserInformation()}, base::BindOnce(&CredentialManagementHandler::OnHavePIN, weak_factory_.GetWeakPtr())); diff --git a/chromium/device/fido/get_assertion_request_handler.cc b/chromium/device/fido/get_assertion_request_handler.cc index f3bd22eaf4b..7e94536d7b8 100644 --- a/chromium/device/fido/get_assertion_request_handler.cc +++ b/chromium/device/fido/get_assertion_request_handler.cc @@ -493,10 +493,10 @@ void GetAssertionRequestHandler::CollectPIN(pin::PINEntryReason reason, int attempts, ProvidePINCallback provide_pin_cb) { DCHECK_EQ(state_, State::kWaitingForToken); - observer()->CollectPIN({.reason = reason, - .error = error, - .min_pin_length = min_pin_length, - .attempts = attempts}, + observer()->CollectPIN({/*.reason =*/ reason, + /*.error =*/ error, + /*.min_pin_length =*/ min_pin_length, + /*.attempts =*/ attempts}, std::move(provide_pin_cb)); } diff --git a/chromium/device/fido/make_credential_request_handler.cc b/chromium/device/fido/make_credential_request_handler.cc index f57b8ebaecc..b410ed87718 100644 --- a/chromium/device/fido/make_credential_request_handler.cc +++ b/chromium/device/fido/make_credential_request_handler.cc @@ -619,10 +619,10 @@ void MakeCredentialRequestHandler::CollectPIN( int attempts, ProvidePINCallback provide_pin_cb) { DCHECK_EQ(state_, State::kWaitingForToken); - observer()->CollectPIN({.reason = reason, - .error = error, - .min_pin_length = min_pin_length, - .attempts = attempts}, + observer()->CollectPIN({/*.reason =*/ reason, + /*.error =*/ error, + /*.min_pin_length =*/ min_pin_length, + /*.attempts =*/ attempts}, std::move(provide_pin_cb)); } diff --git a/chromium/device/fido/win/authenticator.cc b/chromium/device/fido/win/authenticator.cc index 7b9227532ef..e2a43b3eacc 100644 --- a/chromium/device/fido/win/authenticator.cc +++ b/chromium/device/fido/win/authenticator.cc @@ -97,10 +97,10 @@ void WinWebAuthnApiAuthenticator::EnumeratePlatformCredentials( return {}; } - WEBAUTHN_GET_CREDENTIALS_OPTIONS options{ - .dwVersion = WEBAUTHN_GET_CREDENTIALS_OPTIONS_VERSION_1, - .pwszRpId = nullptr, - .bBrowserInPrivateMode = false}; + WEBAUTHN_GET_CREDENTIALS_OPTIONS options{}; + options.dwVersion = WEBAUTHN_GET_CREDENTIALS_OPTIONS_VERSION_1; + options.pwszRpId = nullptr; + options.bBrowserInPrivateMode = false; PWEBAUTHN_CREDENTIAL_DETAILS_LIST credentials = nullptr; HRESULT hresult = @@ -266,11 +266,11 @@ void WinWebAuthnApiAuthenticator::GetCredentialInformationForRequest( } FIDO_LOG(DEBUG) << "Silently discovering credentials for " << request.rp_id; std::u16string rp_id = base::UTF8ToUTF16(request.rp_id); - WEBAUTHN_GET_CREDENTIALS_OPTIONS options{ - .dwVersion = WEBAUTHN_GET_CREDENTIALS_OPTIONS_VERSION_1, - .pwszRpId = base::as_wcstr(rp_id), + WEBAUTHN_GET_CREDENTIALS_OPTIONS options{}; + options.dwVersion = WEBAUTHN_GET_CREDENTIALS_OPTIONS_VERSION_1; + options.pwszRpId = base::as_wcstr(rp_id); // TODO(nsatragno): plumb browser private mode status in. - .bBrowserInPrivateMode = false}; + options.bBrowserInPrivateMode = false; PWEBAUTHN_CREDENTIAL_DETAILS_LIST credentials = nullptr; HRESULT hresult = win_api_->GetPlatformCredentialList(&options, &credentials); std::unique_ptr<WEBAUTHN_CREDENTIAL_DETAILS_LIST, diff --git a/chromium/device/fido/win/fake_webauthn_api.cc b/chromium/device/fido/win/fake_webauthn_api.cc index 9726410fa5b..68458805793 100644 --- a/chromium/device/fido/win/fake_webauthn_api.cc +++ b/chromium/device/fido/win/fake_webauthn_api.cc @@ -282,36 +282,32 @@ HRESULT FakeWinWebAuthnApi::GetPlatformCredentialList( base::UTF8ToUTF16(registration.second.user->name.value_or("")); credential.user_display_name = base::UTF8ToUTF16(registration.second.user->display_name.value_or("")); - credential.rp = { - .dwVersion = WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION, - .pwszId = base::as_wcstr(credential.rp_id), - .pwszName = base::as_wcstr(credential.rp_name), - }; - credential.user = { - .dwVersion = WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION, - .cbId = static_cast<DWORD>(credential.user_id.size()), - .pbId = credential.user_id.data(), - .pwszName = base::as_wcstr(credential.user_name), - .pwszDisplayName = base::as_wcstr(credential.user_display_name), - }; - credential.details = { - .dwVersion = WEBAUTHN_CREDENTIAL_DETAILS_VERSION_1, - .cbCredentialID = static_cast<DWORD>(credential.credential_id.size()), - .pbCredentialID = credential.credential_id.data(), - .pRpInformation = &credential.rp, - .pUserInformation = &credential.user, - .bRemovable = true, - }; + credential.rp = {}; + credential.rp.dwVersion = WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION; + credential.rp.pwszId = base::as_wcstr(credential.rp_id); + credential.rp.pwszName = base::as_wcstr(credential.rp_name); + credential.user = {}; + credential.user.dwVersion = WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION; + credential.user.cbId = static_cast<DWORD>(credential.user_id.size()); + credential.user.pbId = credential.user_id.data(); + credential.user.pwszName = base::as_wcstr(credential.user_name); + credential.user.pwszDisplayName = base::as_wcstr(credential.user_display_name); + credential.details = {}; + credential.details.dwVersion = WEBAUTHN_CREDENTIAL_DETAILS_VERSION_1; + credential.details.cbCredentialID = static_cast<DWORD>(credential.credential_id.size()); + credential.details.pbCredentialID = credential.credential_id.data(); + credential.details.pRpInformation = &credential.rp; + credential.details.pUserInformation = &credential.user; + credential.details.bRemovable = true; } for (auto& credential : credential_list.credentials) { credential_list.win_credentials.push_back(&credential->details); } - credential_list.credential_details_list = { - .cCredentialDetails = - static_cast<DWORD>(credential_list.win_credentials.size()), - .ppCredentialDetails = credential_list.win_credentials.data(), - }; + credential_list.credential_details_list = {}; + credential_list.credential_details_list.cCredentialDetails = + static_cast<DWORD>(credential_list.win_credentials.size()); + credential_list.credential_details_list.ppCredentialDetails = credential_list.win_credentials.data(); *credentials = &credential_list.credential_details_list; return credential_list.credentials.empty() ? NTE_NOT_FOUND : S_OK; } diff --git a/chromium/device/gamepad/wgi_gamepad_device.cc b/chromium/device/gamepad/wgi_gamepad_device.cc index 0d30e19c413..aafc833a2cb 100644 --- a/chromium/device/gamepad/wgi_gamepad_device.cc +++ b/chromium/device/gamepad/wgi_gamepad_device.cc @@ -17,10 +17,10 @@ WgiGamepadDevice::~WgiGamepadDevice() = default; void WgiGamepadDevice::SetVibration(mojom::GamepadEffectParametersPtr params) { ABI::Windows::Gaming::Input::GamepadVibration vibration = { - .LeftMotor = params->strong_magnitude, - .RightMotor = params->weak_magnitude, - .LeftTrigger = params->left_trigger, - .RightTrigger = params->right_trigger}; + /*.LeftMotor =*/ params->strong_magnitude, + /*.RightMotor =*/ params->weak_magnitude, + /*.LeftTrigger =*/ params->left_trigger, + /*.RightTrigger =*/ params->right_trigger}; HRESULT hr = gamepad_->put_Vibration(vibration); DCHECK(SUCCEEDED(hr)); } diff --git a/chromium/gpu/command_buffer/service/dawn_instance.cc b/chromium/gpu/command_buffer/service/dawn_instance.cc index f5dadaeb0e9..1062cdaca09 100644 --- a/chromium/gpu/command_buffer/service/dawn_instance.cc +++ b/chromium/gpu/command_buffer/service/dawn_instance.cc @@ -39,17 +39,14 @@ std::unique_ptr<DawnInstance> DawnInstance::Create( } const char* dawn_search_path_c_str = dawn_search_path.c_str(); - WGPUDawnInstanceDescriptor dawn_instance_desc = { - .chain = - { - .sType = WGPUSType_DawnInstanceDescriptor, - }, - .additionalRuntimeSearchPathsCount = dawn_search_path.empty() ? 0u : 1u, - .additionalRuntimeSearchPaths = &dawn_search_path_c_str, - }; - WGPUInstanceDescriptor instance_desc = { - .nextInChain = &dawn_instance_desc.chain, - }; + WGPUDawnInstanceDescriptor dawn_instance_desc = {}; + dawn_instance_desc.chain = {}; + dawn_instance_desc.chain.sType = WGPUSType_DawnInstanceDescriptor; + dawn_instance_desc.additionalRuntimeSearchPathsCount = dawn_search_path.empty() ? 0u : 1u; + dawn_instance_desc.additionalRuntimeSearchPaths = &dawn_search_path_c_str; + + WGPUInstanceDescriptor instance_desc = {}; + instance_desc.nextInChain = &dawn_instance_desc.chain; auto instance = std::make_unique<DawnInstance>(&instance_desc); instance->SetPlatform(platform); @@ -70,4 +67,4 @@ std::unique_ptr<DawnInstance> DawnInstance::Create( return instance; } -} // namespace gpu::webgpu
\ No newline at end of file +} // namespace gpu::webgpu diff --git a/chromium/gpu/command_buffer/service/raster_decoder.cc b/chromium/gpu/command_buffer/service/raster_decoder.cc index d2ac0ac7090..5ec69959c20 100644 --- a/chromium/gpu/command_buffer/service/raster_decoder.cc +++ b/chromium/gpu/command_buffer/service/raster_decoder.cc @@ -747,10 +747,9 @@ class RasterDecoderImpl final : public RasterDecoder, // This will ensure that vulkan memory allocated on gpu main thread will be // cleaned up. if (!signal_semaphores.empty() || is_drdc_enabled_) { - GrFlushInfo flush_info = { - .fNumSemaphores = signal_semaphores.size(), - .fSignalSemaphores = signal_semaphores.data(), - }; + GrFlushInfo flush_info = {}; + flush_info.fNumSemaphores = signal_semaphores.size(); + flush_info.fSignalSemaphores = signal_semaphores.data(); gpu::AddVulkanCleanupTaskForSkiaFlush( shared_context_state_->vk_context_provider(), &flush_info); @@ -1099,8 +1098,8 @@ void RasterDecoderImpl::Destroy(bool have_context) { // Make sure we flush any pending skia work on this context. if (sk_surface_) { GrFlushInfo flush_info = { - .fNumSemaphores = end_semaphores_.size(), - .fSignalSemaphores = end_semaphores_.data(), + end_semaphores_.size(), + end_semaphores_.data(), }; AddVulkanCleanupTaskForSkiaFlush( shared_context_state_->vk_context_provider(), &flush_info); @@ -2675,10 +2674,10 @@ void RasterDecoderImpl::DoReadbackYUVImagePixelsINTERNAL( } if (!end_semaphores.empty()) { - GrFlushInfo flush_info = { - .fNumSemaphores = end_semaphores.size(), - .fSignalSemaphores = end_semaphores.data(), - }; + GrFlushInfo flush_info = {}; + flush_info.fNumSemaphores = end_semaphores.size(); + flush_info.fSignalSemaphores = end_semaphores.data(); + AddVulkanCleanupTaskForSkiaFlush( shared_context_state_->vk_context_provider(), &flush_info); auto flush_result = shared_context_state_->gr_context()->flush(flush_info); diff --git a/chromium/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc b/chromium/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc index 00cb3945396..a0de594a757 100644 --- a/chromium/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc +++ b/chromium/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc @@ -807,10 +807,12 @@ bool ExternalVkImageBacking::WritePixelsWithCallback( DCHECK(stride == 0 || size().height() * stride <= data_size); VkBufferCreateInfo buffer_create_info = { - .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - .size = data_size, - .usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - .sharingMode = VK_SHARING_MODE_EXCLUSIVE, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + nullptr, + 0, + data_size, + VK_BUFFER_USAGE_TRANSFER_SRC_BIT, + VK_SHARING_MODE_EXCLUSIVE, }; VmaAllocator allocator = @@ -908,12 +910,11 @@ bool ExternalVkImageBacking::ReadPixelsWithCallback( ReadBufferCallback callback) { DCHECK(stride == 0 || size().height() * stride <= data_size); - VkBufferCreateInfo buffer_create_info = { - .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - .size = data_size, - .usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT, - .sharingMode = VK_SHARING_MODE_EXCLUSIVE, - }; + VkBufferCreateInfo buffer_create_info = {}; + buffer_create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; + buffer_create_info.size = data_size; + buffer_create_info.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; + buffer_create_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; VmaAllocator allocator = context_state()->vk_context_provider()->GetDeviceQueue()->vma_allocator(); @@ -1010,8 +1011,8 @@ bool ExternalVkImageBacking::UploadToVkImage(const SkPixmap& pixmap) { GrBackendSemaphore end_access_backend_semaphore; end_access_backend_semaphore.initVulkan(vk_end_access_semaphore); GrFlushInfo flush_info = { - .fNumSemaphores = 1, - .fSignalSemaphores = &end_access_backend_semaphore, + /* .fNumSemaphores = */ 1, + /* .fSignalSemaphores = */ &end_access_backend_semaphore, }; gr_context->flush(flush_info); diff --git a/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc b/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc index 3a661b32764..c68e31654eb 100644 --- a/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/chromium/gpu/command_buffer/service/webgpu_decoder_impl.cc @@ -554,26 +554,24 @@ class WebGPUDecoderImpl final : public WebGPUDecoder { // src/dst). // We also need RenderAttachment usage for clears, and TextureBinding for // copyTextureForBrowser. - WGPUDawnTextureInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnTextureInternalUsageDescriptor}, - .internalUsage = + WGPUDawnTextureInternalUsageDescriptor internal_usage_desc = {}; + internal_usage_desc.chain.sType = WGPUSType_DawnTextureInternalUsageDescriptor; + internal_usage_desc.internalUsage = static_cast<WGPUTextureUsageFlags>(WGPUTextureUsage_CopyDst) | static_cast<WGPUTextureUsageFlags>(WGPUTextureUsage_CopySrc) | static_cast<WGPUTextureUsageFlags>( WGPUTextureUsage_RenderAttachment) | static_cast<WGPUTextureUsageFlags>( - WGPUTextureUsage_TextureBinding), - }; - WGPUTextureDescriptor texture_desc = { - .nextInChain = &internal_usage_desc.chain, - .usage = static_cast<WGPUTextureUsageFlags>(usage), - .dimension = WGPUTextureDimension_2D, - .size = {static_cast<uint32_t>(representation_->size().width()), - static_cast<uint32_t>(representation_->size().height()), 1}, - .format = viz::ToWGPUFormat(representation_->format()), - .mipLevelCount = 1, - .sampleCount = 1, - }; + WGPUTextureUsage_TextureBinding); + WGPUTextureDescriptor texture_desc = {}; + texture_desc.nextInChain = &internal_usage_desc.chain; + texture_desc.usage = static_cast<WGPUTextureUsageFlags>(usage); + texture_desc.dimension = WGPUTextureDimension_2D; + texture_desc.size = {static_cast<uint32_t>(representation_->size().width()), + static_cast<uint32_t>(representation_->size().height()), 1}; + texture_desc.format = viz::ToWGPUFormat(representation_->format()); + texture_desc.mipLevelCount = 1; + texture_desc.sampleCount = 1; procs_.deviceReference(device_); texture_ = procs_.deviceCreateTexture(device, &texture_desc); @@ -677,11 +675,10 @@ class WebGPUDecoderImpl final : public WebGPUDecoder { // Create a staging buffer to hold pixel data which will be uploaded into // a texture. - WGPUBufferDescriptor buffer_desc = { - .usage = WGPUBufferUsage_CopySrc, - .size = buffer_size, - .mappedAtCreation = true, - }; + WGPUBufferDescriptor buffer_desc = {}; + buffer_desc.usage = WGPUBufferUsage_CopySrc; + buffer_desc.size = buffer_size; + buffer_desc.mappedAtCreation = true; WGPUBuffer buffer = procs_.deviceCreateBuffer(device_, &buffer_desc); void* dst_pointer = procs_.bufferGetMappedRange(buffer, 0, WGPU_WHOLE_MAP_SIZE); @@ -694,26 +691,23 @@ class WebGPUDecoderImpl final : public WebGPUDecoder { procs_.bufferUnmap(buffer); // Copy from the staging WGPUBuffer into the WGPUTexture. - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; + WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {}; + internal_usage_desc.chain.sType = WGPUSType_DawnEncoderInternalUsageDescriptor; + internal_usage_desc.useInternalUsages = true; WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, + /*.nextInChain =*/ &internal_usage_desc.chain, }; WGPUCommandEncoder encoder = procs_.deviceCreateCommandEncoder(device_, &command_encoder_desc); - WGPUImageCopyBuffer buffer_copy = { - .layout = - { - .bytesPerRow = bytes_per_row, - .rowsPerImage = WGPU_COPY_STRIDE_UNDEFINED, - }, - .buffer = buffer, - }; - WGPUImageCopyTexture texture_copy = { - .texture = texture_, - }; + + WGPUImageCopyBuffer buffer_copy = {}; + buffer_copy.layout.bytesPerRow = bytes_per_row; + buffer_copy.layout.rowsPerImage = WGPU_COPY_STRIDE_UNDEFINED; + buffer_copy.buffer = buffer; + + WGPUImageCopyTexture texture_copy = {}; + texture_copy.texture = texture_; + WGPUExtent3D extent = { static_cast<uint32_t>(representation_->size().width()), static_cast<uint32_t>(representation_->size().height()), 1}; @@ -742,34 +736,31 @@ class WebGPUDecoderImpl final : public WebGPUDecoder { } // Create a staging buffer to read back from the texture. - WGPUBufferDescriptor buffer_desc = { - .usage = WGPUBufferUsage_CopyDst | WGPUBufferUsage_MapRead, - .size = buffer_size, - }; + WGPUBufferDescriptor buffer_desc = {}; + buffer_desc.usage = WGPUBufferUsage_CopyDst | WGPUBufferUsage_MapRead; + buffer_desc.size = buffer_size; + WGPUBuffer buffer = procs_.deviceCreateBuffer(device_, &buffer_desc); - WGPUImageCopyTexture texture_copy = { - .texture = texture_, - }; - WGPUImageCopyBuffer buffer_copy = { - .layout = - { - .bytesPerRow = bytes_per_row, - .rowsPerImage = WGPU_COPY_STRIDE_UNDEFINED, - }, - .buffer = buffer, - }; + WGPUImageCopyTexture texture_copy = {}; + texture_copy.texture = texture_; + + WGPUImageCopyBuffer buffer_copy = {}; + buffer_copy.layout.bytesPerRow = bytes_per_row; + buffer_copy.layout.rowsPerImage = WGPU_COPY_STRIDE_UNDEFINED; + buffer_copy.buffer = buffer; + WGPUExtent3D extent = { static_cast<uint32_t>(representation_->size().width()), static_cast<uint32_t>(representation_->size().height()), 1}; // Copy from the texture into the staging buffer. - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; + WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {}; + internal_usage_desc.chain.sType = WGPUSType_DawnEncoderInternalUsageDescriptor; + internal_usage_desc.useInternalUsages = true; + WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, + /*.nextInChain =*/ &internal_usage_desc.chain, }; WGPUCommandEncoder encoder = procs_.deviceCreateCommandEncoder(device_, &command_encoder_desc); @@ -861,8 +852,8 @@ class WebGPUDecoderImpl final : public WebGPUDecoder { return; GrFlushInfo flush_info = { - .fNumSemaphores = semaphores.size(), - .fSignalSemaphores = semaphores.data(), + /*.fNumSemaphores =*/ semaphores.size(), + /*.fSignalSemaphores =*/ semaphores.data(), }; // Note: this is a no-op if vk_context_provider is null. AddVulkanCleanupTaskForSkiaFlush( @@ -1939,12 +1930,12 @@ error::Error WebGPUDecoderImpl::HandleDissociateMailboxForPresent( render_pass_descriptor.colorAttachmentCount = 1; render_pass_descriptor.colorAttachments = &color_attachment; - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; + WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {}; + internal_usage_desc.chain.sType = WGPUSType_DawnEncoderInternalUsageDescriptor; + internal_usage_desc.useInternalUsages = true; + WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, + /*.nextInChain =*/ &internal_usage_desc.chain, }; WGPUCommandEncoder encoder = procs.deviceCreateCommandEncoder(device, &command_encoder_desc); diff --git a/chromium/gpu/vulkan/vma_wrapper.cc b/chromium/gpu/vulkan/vma_wrapper.cc index 7fb71414db3..2d36714aa98 100644 --- a/chromium/gpu/vulkan/vma_wrapper.cc +++ b/chromium/gpu/vulkan/vma_wrapper.cc @@ -45,20 +45,19 @@ VkResult CreateAllocator(VkPhysicalDevice physical_device, }; static_assert(kVulkanRequiredApiVersion >= VK_API_VERSION_1_1, ""); - VmaAllocatorCreateInfo allocator_info = { - .physicalDevice = physical_device, - .device = device, + VmaAllocatorCreateInfo allocator_info{}; + allocator_info.physicalDevice = physical_device; + allocator_info.device = device; // 4MB was picked for the size here by looking at memory usage of Android // apps and runs of DM. It seems to be a good compromise of not wasting // unused allocated space and not making too many small allocations. The // AMD allocator will start making blocks at 1/8 the max size and builds // up block size as needed before capping at the max set here. - .preferredLargeHeapBlockSize = 4 * 1024 * 1024, - .pHeapSizeLimit = heap_size_limit, - .pVulkanFunctions = &functions, - .instance = instance, - .vulkanApiVersion = kVulkanRequiredApiVersion, - }; + allocator_info.preferredLargeHeapBlockSize = 4 * 1024 * 1024; + allocator_info.pHeapSizeLimit = heap_size_limit; + allocator_info.pVulkanFunctions = &functions; + allocator_info.instance = instance; + allocator_info.vulkanApiVersion = kVulkanRequiredApiVersion; // If DrDc is not enabled, use below flag which improves performance since // internal mutex will not be used. @@ -117,10 +116,9 @@ VkResult CreateBuffer(VmaAllocator allocator, VkMemoryPropertyFlags preferred_flags, VkBuffer* buffer, VmaAllocation* allocation) { - VmaAllocationCreateInfo allocation_create_info = { - .requiredFlags = required_flags, - .preferredFlags = preferred_flags, - }; + VmaAllocationCreateInfo allocation_create_info{}; + allocation_create_info.requiredFlags = required_flags; + allocation_create_info.preferredFlags = preferred_flags; return vmaCreateBuffer(allocator, buffer_create_info, &allocation_create_info, buffer, allocation, nullptr); diff --git a/chromium/gpu/vulkan/vulkan_command_buffer.cc b/chromium/gpu/vulkan/vulkan_command_buffer.cc index fbab16255ca..f47e4f33fb7 100644 --- a/chromium/gpu/vulkan/vulkan_command_buffer.cc +++ b/chromium/gpu/vulkan/vulkan_command_buffer.cc @@ -105,12 +105,12 @@ bool VulkanCommandBuffer::Initialize() { VkDevice device = device_queue_->GetVulkanDevice(); VkCommandBufferAllocateInfo command_buffer_info = { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, - .pNext = nullptr, - .commandPool = command_pool_->handle(), - .level = primary_ ? VK_COMMAND_BUFFER_LEVEL_PRIMARY - : VK_COMMAND_BUFFER_LEVEL_SECONDARY, - .commandBufferCount = 1, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, + nullptr, + command_pool_->handle(), + primary_ ? VK_COMMAND_BUFFER_LEVEL_PRIMARY + : VK_COMMAND_BUFFER_LEVEL_SECONDARY, + 1, }; DCHECK_EQ(static_cast<VkCommandBuffer>(VK_NULL_HANDLE), command_buffer_); diff --git a/chromium/gpu/vulkan/vulkan_fence_helper.cc b/chromium/gpu/vulkan/vulkan_fence_helper.cc index 443e1a60107..2b063f4a82f 100644 --- a/chromium/gpu/vulkan/vulkan_fence_helper.cc +++ b/chromium/gpu/vulkan/vulkan_fence_helper.cc @@ -34,9 +34,9 @@ void VulkanFenceHelper::Destroy() { // TODO(ericrk): Handle recycling fences. VkResult VulkanFenceHelper::GetFence(VkFence* fence) { VkFenceCreateInfo create_info{ - .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, - .pNext = nullptr, - .flags = 0, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, + nullptr, + 0, }; return vkCreateFence(device_queue_->GetVulkanDevice(), &create_info, nullptr /* pAllocator */, fence); diff --git a/chromium/gpu/vulkan/vulkan_image.cc b/chromium/gpu/vulkan/vulkan_image.cc index cc2dac68792..9ccce729aea 100644 --- a/chromium/gpu/vulkan/vulkan_image.cc +++ b/chromium/gpu/vulkan/vulkan_image.cc @@ -153,9 +153,10 @@ void VulkanImage::Destroy() { base::ScopedFD VulkanImage::GetMemoryFd( VkExternalMemoryHandleTypeFlagBits handle_type) { VkMemoryGetFdInfoKHR get_fd_info = { - .sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR, - .memory = device_memory_, - .handleType = handle_type, + VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR, + nullptr, + device_memory_, + handle_type, }; @@ -185,24 +186,23 @@ bool VulkanImage::Initialize(VulkanDeviceQueue* device_queue, DCHECK(device_memory_ == VK_NULL_HANDLE); device_queue_ = device_queue; - create_info_ = { - .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, - .pNext = vk_image_create_info_next, - .flags = flags, - .imageType = VK_IMAGE_TYPE_2D, - .format = format, - .extent = {static_cast<uint32_t>(size.width()), - static_cast<uint32_t>(size.height()), 1}, - .mipLevels = 1, - .arrayLayers = 1, - .samples = VK_SAMPLE_COUNT_1_BIT, - .tiling = image_tiling, - .usage = usage, - .sharingMode = VK_SHARING_MODE_EXCLUSIVE, - .queueFamilyIndexCount = 0, - .pQueueFamilyIndices = nullptr, - .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, - }; + create_info_ = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + create_info_.pNext = vk_image_create_info_next; + create_info_.flags = flags; + create_info_.imageType = VK_IMAGE_TYPE_2D; + create_info_.format = format; + create_info_.extent = {static_cast<uint32_t>(size.width()), + static_cast<uint32_t>(size.height()), 1}; + create_info_.mipLevels = 1; + create_info_.arrayLayers = 1; + create_info_.samples = VK_SAMPLE_COUNT_1_BIT; + create_info_.tiling = image_tiling; + create_info_.usage = usage; + create_info_.sharingMode = VK_SHARING_MODE_EXCLUSIVE; + create_info_.queueFamilyIndexCount = 0; + create_info_.pQueueFamilyIndices = nullptr; + create_info_.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + VkDevice vk_device = device_queue->GetVulkanDevice(); VkResult result = vkCreateImage(vk_device, &create_info_, nullptr /* pAllocator */, &image_); @@ -230,9 +230,9 @@ bool VulkanImage::Initialize(VulkanDeviceQueue* device_queue, // Some vulkan implementations require dedicated memory for sharing memory // object between vulkan instances. VkMemoryDedicatedAllocateInfoKHR dedicated_memory_info = { - .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR, - .pNext = vk_memory_allocation_info_next, - .image = image_, + VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR, + vk_memory_allocation_info_next, + image_, }; auto index = @@ -246,10 +246,10 @@ bool VulkanImage::Initialize(VulkanDeviceQueue* device_queue, memory_type_index_ = index.value(); VkMemoryAllocateInfo memory_allocate_info = { - .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - .pNext = &dedicated_memory_info, - .allocationSize = device_size_, - .memoryTypeIndex = memory_type_index_, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + &dedicated_memory_info, + device_size_, + memory_type_index_, }; result = vkAllocateMemory(vk_device, &memory_allocate_info, @@ -276,11 +276,11 @@ bool VulkanImage::Initialize(VulkanDeviceQueue* device_queue, if (image_tiling != VK_IMAGE_TILING_LINEAR) return true; - const VkImageSubresource image_subresource = { - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .mipLevel = 0, - .arrayLayer = 0, - }; + VkImageSubresource image_subresource; + image_subresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + image_subresource.mipLevel = 0; + image_subresource.arrayLayer = 0; + vkGetImageSubresourceLayout(device_queue_->GetVulkanDevice(), image_, &image_subresource, &layouts_[0]); @@ -306,17 +306,19 @@ bool VulkanImage::InitializeWithExternalMemory( #endif VkPhysicalDeviceImageFormatInfo2 format_info_2 = { - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, - .format = format, - .type = VK_IMAGE_TYPE_2D, - .tiling = image_tiling, - .usage = usage, - .flags = flags, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, + nullptr, + format, + VK_IMAGE_TYPE_2D, + image_tiling, + usage, + flags, }; VkPhysicalDeviceExternalImageFormatInfo external_info = { - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, - .handleType = kHandleType, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, + nullptr, + kHandleType, }; format_info_2.pNext = &external_info; @@ -335,10 +337,10 @@ bool VulkanImage::InitializeWithExternalMemory( #endif VkImageFormatProperties2 image_format_properties_2 = { - .sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, }; VkExternalImageFormatProperties external_image_format_properties = { - .sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, }; image_format_properties_2.pNext = &external_image_format_properties; @@ -366,15 +368,15 @@ bool VulkanImage::InitializeWithExternalMemory( DCHECK(handle_types_ & kHandleType); VkExternalMemoryImageCreateInfoKHR external_image_create_info = { - .sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR, - .pNext = image_create_info_next, - .handleTypes = handle_types_, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR, + image_create_info_next, + handle_types_, }; VkExportMemoryAllocateInfoKHR external_memory_allocate_info = { - .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, - .pNext = memory_allocation_info_next, - .handleTypes = handle_types_, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, + memory_allocation_info_next, + handle_types_, }; return Initialize(device_queue, size, format, usage, flags, image_tiling, diff --git a/chromium/gpu/vulkan/vulkan_image_win.cc b/chromium/gpu/vulkan/vulkan_image_win.cc index d7406c1cfb2..d4ae7ff5f0e 100644 --- a/chromium/gpu/vulkan/vulkan_image_win.cc +++ b/chromium/gpu/vulkan/vulkan_image_win.cc @@ -25,11 +25,9 @@ bool VulkanImage::InitializeFromGpuMemoryBufferHandle( base::win::ScopedHandle VulkanImage::GetMemoryHandle( VkExternalMemoryHandleTypeFlagBits handle_type) { - VkMemoryGetWin32HandleInfoKHR get_handle_info = { - .sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR, - .memory = device_memory_, - .handleType = handle_type, - }; + VkMemoryGetWin32HandleInfoKHR get_handle_info = {VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR}; + get_handle_info.memory = device_memory_; + get_handle_info.handleType = handle_type; VkDevice device = device_queue_->GetVulkanDevice(); diff --git a/chromium/gpu/vulkan/vulkan_instance.cc b/chromium/gpu/vulkan/vulkan_instance.cc index 83ad189a7a7..a9c44158688 100644 --- a/chromium/gpu/vulkan/vulkan_instance.cc +++ b/chromium/gpu/vulkan/vulkan_instance.cc @@ -402,14 +402,11 @@ bool VulkanInstance::CollectDeviceInfo(VkPhysicalDevice physical_device) { // non-null. static_assert(kVulkanRequiredApiVersion >= VK_API_VERSION_1_1, ""); if (info.properties.apiVersion >= kVulkanRequiredApiVersion) { - info.driver_properties = VkPhysicalDeviceDriverProperties{ - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, - }; - - VkPhysicalDeviceProperties2 properties2 = { - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - .pNext = &info.driver_properties, - }; + info.driver_properties = VkPhysicalDeviceDriverProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES}; + + VkPhysicalDeviceProperties2 properties2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; + properties2.pNext = &info.driver_properties; + vkGetPhysicalDeviceProperties2(device, &properties2); VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcr_conversion_features = diff --git a/chromium/gpu/vulkan/vulkan_swap_chain.cc b/chromium/gpu/vulkan/vulkan_swap_chain.cc index 1cc82c2f3c1..8cb5e591fda 100644 --- a/chromium/gpu/vulkan/vulkan_swap_chain.cc +++ b/chromium/gpu/vulkan/vulkan_swap_chain.cc @@ -172,24 +172,22 @@ bool VulkanSwapChain::InitializeSwapChain( VkDevice device = device_queue_->GetVulkanDevice(); VkResult result = VK_SUCCESS; - VkSwapchainCreateInfoKHR swap_chain_create_info = { - .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, - .flags = 0, - .surface = surface, - .minImageCount = min_image_count, - .imageFormat = surface_format.format, - .imageColorSpace = surface_format.colorSpace, - .imageExtent = {static_cast<uint32_t>(image_size.width()), - static_cast<uint32_t>(image_size.height())}, - .imageArrayLayers = 1, - .imageUsage = image_usage_flags, - .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, - .preTransform = pre_transform, - .compositeAlpha = composite_alpha, - .presentMode = VK_PRESENT_MODE_FIFO_KHR, - .clipped = VK_TRUE, - .oldSwapchain = VK_NULL_HANDLE, - }; + VkSwapchainCreateInfoKHR swap_chain_create_info = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR }; + swap_chain_create_info.flags = 0; + swap_chain_create_info.surface = surface; + swap_chain_create_info.minImageCount = min_image_count; + swap_chain_create_info.imageFormat = surface_format.format; + swap_chain_create_info.imageColorSpace = surface_format.colorSpace; + swap_chain_create_info.imageExtent = {static_cast<uint32_t>(image_size.width()), + static_cast<uint32_t>(image_size.height())}; + swap_chain_create_info.imageArrayLayers = 1; + swap_chain_create_info.imageUsage = image_usage_flags; + swap_chain_create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; + swap_chain_create_info.preTransform = pre_transform; + swap_chain_create_info.compositeAlpha = composite_alpha; + swap_chain_create_info.presentMode = VK_PRESENT_MODE_FIFO_KHR; + swap_chain_create_info.clipped = VK_TRUE; + swap_chain_create_info.oldSwapchain = VK_NULL_HANDLE; if (LIKELY(old_swap_chain)) { base::AutoLock auto_lock(old_swap_chain->lock_); @@ -363,32 +361,28 @@ bool VulkanSwapChain::PresentBuffer(const gfx::Rect& rect) { DCHECK(current_image_data.present_semaphore != VK_NULL_HANDLE); VkRectLayerKHR rect_layer = { - .offset = {rect.x(), rect.y()}, - .extent = {static_cast<uint32_t>(rect.width()), - static_cast<uint32_t>(rect.height())}, - .layer = 0, + /*.offset =*/ {rect.x(), rect.y()}, + /*.extent =*/ {static_cast<uint32_t>(rect.width()), + static_cast<uint32_t>(rect.height())}, + /*.layer =*/ 0 }; VkPresentRegionKHR present_region = { - .rectangleCount = 1, - .pRectangles = &rect_layer, - }; - - VkPresentRegionsKHR present_regions = { - .sType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR, - .swapchainCount = 1, - .pRegions = &present_region, + /* .rectangleCount = */ 1, + /* .pRectangles = */ &rect_layer, }; - VkPresentInfoKHR present_info = { - .sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, - .pNext = is_incremental_present_supported_ ? &present_regions : nullptr, - .waitSemaphoreCount = 1, - .pWaitSemaphores = ¤t_image_data.present_semaphore, - .swapchainCount = 1, - .pSwapchains = &swap_chain_, - .pImageIndices = &acquired_image_.value(), - }; + VkPresentRegionsKHR present_regions = { VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR }; + present_regions.swapchainCount = 1; + present_regions.pRegions = &present_region; + + VkPresentInfoKHR present_info = { VK_STRUCTURE_TYPE_PRESENT_INFO_KHR }; + present_info.pNext = is_incremental_present_supported_ ? &present_regions : nullptr; + present_info.waitSemaphoreCount = 1; + present_info.pWaitSemaphores = ¤t_image_data.present_semaphore; + present_info.swapchainCount = 1; + present_info.pSwapchains = &swap_chain_; + present_info.pImageIndices = &acquired_image_.value(); VkQueue queue = device_queue_->GetVulkanQueue(); auto result = [&](){ diff --git a/chromium/gpu/vulkan/vulkan_util.cc b/chromium/gpu/vulkan/vulkan_util.cc index 5028fc28c9f..147ba251632 100644 --- a/chromium/gpu/vulkan/vulkan_util.cc +++ b/chromium/gpu/vulkan/vulkan_util.cc @@ -103,15 +103,11 @@ bool SubmitWaitVkSemaphore(VkQueue vk_queue, VkSemaphore CreateExternalVkSemaphore( VkDevice vk_device, VkExternalSemaphoreHandleTypeFlags handle_types) { - VkExportSemaphoreCreateInfo export_info = { - .sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, - .handleTypes = handle_types, - }; - - VkSemaphoreCreateInfo sem_info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, - .pNext = &export_info, - }; + VkExportSemaphoreCreateInfo export_info = {VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO}; + export_info.handleTypes = handle_types; + + VkSemaphoreCreateInfo sem_info = {VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO}; + sem_info.pNext = &export_info; VkSemaphore semaphore = VK_NULL_HANDLE; VkResult result = diff --git a/chromium/gpu/vulkan/vulkan_util_win32.cc b/chromium/gpu/vulkan/vulkan_util_win32.cc index b52d0d6a253..f89c6dd31da 100644 --- a/chromium/gpu/vulkan/vulkan_util_win32.cc +++ b/chromium/gpu/vulkan/vulkan_util_win32.cc @@ -27,12 +27,11 @@ VkSemaphore ImportVkSemaphoreHandle(VkDevice vk_device, return VK_NULL_HANDLE; auto win32_handle = handle.TakeHandle(); - VkImportSemaphoreWin32HandleInfoKHR import = { - .sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR, - .semaphore = semaphore, - .handleType = handle_type, - .handle = win32_handle.Get(), - }; + VkImportSemaphoreWin32HandleInfoKHR import = {VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR}; + import.semaphore = semaphore; + import.handleType = handle_type; + import.handle = win32_handle.Get(); + result = vkImportSemaphoreWin32HandleKHR(vk_device, &import); if (result != VK_SUCCESS) { vkDestroySemaphore(vk_device, semaphore, nullptr); @@ -49,11 +48,9 @@ SemaphoreHandle GetVkSemaphoreHandle( VkDevice vk_device, VkSemaphore vk_semaphore, VkExternalSemaphoreHandleTypeFlagBits handle_type) { - VkSemaphoreGetWin32HandleInfoKHR info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR, - .semaphore = vk_semaphore, - .handleType = handle_type, - }; + VkSemaphoreGetWin32HandleInfoKHR info = {VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR}; + info.semaphore = vk_semaphore; + info.handleType = handle_type; HANDLE handle = nullptr; VkResult result = vkGetSemaphoreWin32HandleKHR(vk_device, &info, &handle); diff --git a/chromium/gpu/vulkan/win32/vulkan_surface_win32.cc b/chromium/gpu/vulkan/win32/vulkan_surface_win32.cc index 68826bf5c5b..1b1cdb46b96 100644 --- a/chromium/gpu/vulkan/win32/vulkan_surface_win32.cc +++ b/chromium/gpu/vulkan/win32/vulkan_surface_win32.cc @@ -194,12 +194,12 @@ std::unique_ptr<VulkanSurfaceWin32> VulkanSurfaceWin32::Create( event.Wait(); VkSurfaceKHR surface; - VkWin32SurfaceCreateInfoKHR surface_create_info = { - .sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, - .hinstance = reinterpret_cast<HINSTANCE>( - GetWindowLongPtr(window->hwnd(), GWLP_HINSTANCE)), - .hwnd = window->hwnd(), - }; + VkWin32SurfaceCreateInfoKHR surface_create_info{}; + surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; + surface_create_info.hinstance = reinterpret_cast<HINSTANCE>( + GetWindowLongPtr(window->hwnd(), GWLP_HINSTANCE)); + surface_create_info.hwnd = window->hwnd(); + VkResult result = vkCreateWin32SurfaceKHR(vk_instance, &surface_create_info, nullptr, &surface); if (VK_SUCCESS != result) { diff --git a/chromium/media/capture/video/win/gpu_memory_buffer_tracker.cc b/chromium/media/capture/video/win/gpu_memory_buffer_tracker.cc index 56f7aa84d17..7dec7991e1f 100644 --- a/chromium/media/capture/video/win/gpu_memory_buffer_tracker.cc +++ b/chromium/media/capture/video/win/gpu_memory_buffer_tracker.cc @@ -24,18 +24,18 @@ namespace { base::win::ScopedHandle CreateNV12Texture(ID3D11Device* d3d11_device, const gfx::Size& size) { const DXGI_FORMAT dxgi_format = DXGI_FORMAT_NV12; - D3D11_TEXTURE2D_DESC desc = { - .Width = static_cast<UINT>(size.width()), - .Height = static_cast<UINT>(size.height()), - .MipLevels = 1, - .ArraySize = 1, - .Format = dxgi_format, - .SampleDesc = {1, 0}, - .Usage = D3D11_USAGE_DEFAULT, - .BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, - .CPUAccessFlags = 0, - .MiscFlags = D3D11_RESOURCE_MISC_SHARED_NTHANDLE | - D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX}; + D3D11_TEXTURE2D_DESC desc{}; + desc.Width = static_cast<UINT>(size.width()); + desc.Height = static_cast<UINT>(size.height()); + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = dxgi_format; + desc.SampleDesc = {1, 0}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_NTHANDLE | + D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX; Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture; diff --git a/chromium/media/formats/hls/items.cc b/chromium/media/formats/hls/items.cc index 88229136428..9e0126a3860 100644 --- a/chromium/media/formats/hls/items.cc +++ b/chromium/media/formats/hls/items.cc @@ -77,7 +77,7 @@ ParseStatus::Or<GetNextLineItemResult> GetNextLineItem( // If not empty, tag, or comment, it must be a URI. // This line may contain leading, trailing, or interior whitespace, // but that's the URI parser's responsibility. - return GetNextLineItemResult{UriItem{.content = line}}; + return GetNextLineItemResult{UriItem{/*.content =*/ line}}; } } diff --git a/chromium/media/formats/hls/media_playlist.cc b/chromium/media/formats/hls/media_playlist.cc index 5f5ce5d3a84..8b39f71e280 100644 --- a/chromium/media/formats/hls/media_playlist.cc +++ b/chromium/media/formats/hls/media_playlist.cc @@ -420,7 +420,7 @@ ParseStatus::Or<scoped_refptr<MediaPlaylist>> MediaPlaylist::Parse( absl::optional<PartialSegmentInfo> partial_segment_info; if (part_inf_tag.has_value()) { partial_segment_info = MediaPlaylist::PartialSegmentInfo{ - .target_duration = part_inf_tag->target_duration}; + /*.target_duration =*/ part_inf_tag->target_duration}; // Since the combination of partial segments should be equivalent to their // parent segment, the partial segment target duration should not exceed the @@ -516,22 +516,22 @@ ParseStatus::Or<scoped_refptr<MediaPlaylist>> MediaPlaylist::Parse( return base::MakeRefCounted<MediaPlaylist>( base::PassKey<MediaPlaylist>(), - CtorArgs{.uri = std::move(uri), - .version = version, - .independent_segments = independent_segments, - .target_duration = target_duration, - .partial_segment_info = std::move(partial_segment_info), - .segments = std::move(segments), - .total_duration = total_duration, - .playlist_type = playlist_type, - .end_list = end_list_tag.has_value(), - .i_frames_only = i_frames_only_tag.has_value(), - .has_media_sequence_tag = media_sequence_tag.has_value(), - .can_skip_dateranges = can_skip_dateranges, - .can_block_reload = can_block_reload, - .skip_boundary = skip_boundary, - .hold_back_distance = hold_back_distance, - .part_hold_back_distance = part_hold_back_distance}); + CtorArgs{/*.uri =*/ std::move(uri), + /*.version =*/ version, + /*.independent_segments =*/ independent_segments, + /*.target_duration =*/ target_duration, + /*.partial_segment_info =*/ std::move(partial_segment_info), + /*.segments =*/ std::move(segments), + /*.total_duration =*/ total_duration, + /*.playlist_type =*/ playlist_type, + /*.end_list =*/ end_list_tag.has_value(), + /*.i_frames_only =*/ i_frames_only_tag.has_value(), + /*.has_media_sequence_tag =*/ media_sequence_tag.has_value(), + /*.can_skip_dateranges =*/ can_skip_dateranges, + /*.can_block_reload =*/ can_block_reload, + /*.skip_boundary =*/ skip_boundary, + /*.hold_back_distance =*/ hold_back_distance, + /*.part_hold_back_distance =*/ part_hold_back_distance}); } MediaPlaylist::MediaPlaylist(base::PassKey<MediaPlaylist>, CtorArgs args) diff --git a/chromium/media/formats/hls/playlist.cc b/chromium/media/formats/hls/playlist.cc index 87df468c2d2..f966319200e 100644 --- a/chromium/media/formats/hls/playlist.cc +++ b/chromium/media/formats/hls/playlist.cc @@ -91,12 +91,12 @@ ParseStatus::Or<Playlist::Identification> Playlist::IdentifyPlaylist( return Identification{ // If the playlist did not contain a version tag, version is implicitly // `kDefaultVersion`. - .version = version_tag ? version_tag->version : kDefaultVersion, + /*.version =*/ version_tag ? version_tag->version : kDefaultVersion, // Media playlists must contain the EXT-X-TARGETDURATION tag, so if we // never encountered a media playlist tag it must be an (empty) // multivariant playlist. - .kind = +// .kind = playlist_kind ? playlist_kind.value() : Kind::kMultivariantPlaylist, }; } diff --git a/chromium/media/formats/hls/source_string.cc b/chromium/media/formats/hls/source_string.cc index fd584317322..5a6d9faf439 100644 --- a/chromium/media/formats/hls/source_string.cc +++ b/chromium/media/formats/hls/source_string.cc @@ -53,7 +53,7 @@ ResolvedSourceString ResolvedSourceString::CreateForTesting( base::StringPiece str) { return ResolvedSourceString::CreateForTesting( line, column, str, - ResolvedSourceStringState{.contains_substitutions = false}); + ResolvedSourceStringState{/*.contains_substitutions =*/ false}); } // static @@ -99,7 +99,7 @@ template <> ResolvedSourceString SourceString::SkipVariableSubstitution() const { return ResolvedSourceString( Line(), Column(), Str(), - ResolvedSourceStringState{.contains_substitutions = false}); + ResolvedSourceStringState{/*.contains_substitutions =*/ false}); } template <typename ResolutionState> diff --git a/chromium/media/formats/hls/tags.cc b/chromium/media/formats/hls/tags.cc index cc9bcb9aa63..cc531e4c54b 100644 --- a/chromium/media/formats/hls/tags.cc +++ b/chromium/media/formats/hls/tags.cc @@ -327,12 +327,12 @@ ParseStatus::Or<M3uTag> M3uTag::Parse(TagItem tag) { // static XDefineTag XDefineTag::CreateDefinition(types::VariableName name, base::StringPiece value) { - return XDefineTag{.name = name, .value = value}; + return XDefineTag{/*.name =*/ name, /*.value =*/ value}; } // static XDefineTag XDefineTag::CreateImport(types::VariableName name) { - return XDefineTag{.name = name, .value = absl::nullopt}; + return XDefineTag{/*.name =*/ name, /*.value =*/ absl::nullopt}; } // static @@ -700,19 +700,19 @@ ParseStatus::Or<XMediaTag> XMediaTag::Parse( } return XMediaTag(XMediaTag::CtorArgs{ - .type = type, - .uri = uri, - .instream_id = instream_id, - .group_id = group_id.value(), - .language = language, - .associated_language = assoc_language, - .name = name.value(), - .stable_rendition_id = std::move(stable_rendition_id), - .is_default = is_default, - .autoselect = autoselect, - .forced = forced, - .characteristics = std::move(characteristics), - .channels = std::move(channels), + /*.type =*/ type, + /*.uri =*/ uri, + /*.instream_id =*/ instream_id, + /*.group_id =*/ group_id.value(), + /*.language =*/ language, + /*.associated_language =*/ assoc_language, + /*.name =*/ name.value(), + /*.stable_rendition_id =*/ std::move(stable_rendition_id), + /*.is_default = */is_default, + /*.autoselect =*/ autoselect, + /*.forced =*/ forced, + /*.characteristics =*/ std::move(characteristics), + /*.channels =*/ std::move(channels), }); } @@ -880,7 +880,7 @@ ParseStatus::Or<InfTag> InfTag::Parse(TagItem tag) { return ParseStatusCode::kValueOverflowsTimeDelta; } - return InfTag{.duration = duration, .title = title_str}; + return InfTag{/*.duration =*/ duration, /*.title =*/ title_str}; } // static @@ -902,7 +902,7 @@ ParseStatus::Or<XByteRangeTag> XByteRangeTag::Parse(TagItem tag) { .AddCause(std::move(range).error()); } - return XByteRangeTag{.range = std::move(range).value()}; + return XByteRangeTag{/*.range =*/ std::move(range).value()}; } // static @@ -979,7 +979,7 @@ ParseStatus::Or<XMapTag> XMapTag::Parse( byte_range = std::move(result).value(); } - return XMapTag{.uri = uri.value(), .byte_range = byte_range}; + return XMapTag{/*.uri =*/ uri.value(), /*.byte_range =*/ byte_range}; } // static @@ -1070,11 +1070,11 @@ ParseStatus::Or<XPartTag> XPartTag::Parse( } } - return XPartTag{.uri = uri.value(), - .duration = duration, - .byte_range = byte_range, - .independent = independent, - .gap = gap}; + return XPartTag{/*.uri =*/ uri.value(), + /*.duration =*/ duration, + /*.byte_range =*/ byte_range, + /*.independent =*/ independent, + /*.gap =*/ gap}; } // static @@ -1115,7 +1115,7 @@ ParseStatus::Or<XPartInfTag> XPartInfTag::Parse(TagItem tag) { return ParseStatusCode::kMalformedTag; } - return XPartInfTag{.target_duration = part_target}; + return XPartInfTag{/*.target_duration =*/ part_target}; } // static @@ -1128,10 +1128,10 @@ ParseStatus::Or<XPlaylistTypeTag> XPlaylistTypeTag::Parse(TagItem tag) { } if (tag.GetContent()->Str() == "EVENT") { - return XPlaylistTypeTag{.type = PlaylistType::kEvent}; + return XPlaylistTypeTag{/*.type =*/ PlaylistType::kEvent}; } if (tag.GetContent()->Str() == "VOD") { - return XPlaylistTypeTag{.type = PlaylistType::kVOD}; + return XPlaylistTypeTag{/*.type =*/ PlaylistType::kVOD}; } return ParseStatusCode::kUnknownPlaylistType; @@ -1236,11 +1236,11 @@ ParseStatus::Or<XServerControlTag> XServerControlTag::Parse(TagItem tag) { } return XServerControlTag{ - .skip_boundary = can_skip_until, - .can_skip_dateranges = can_skip_dateranges, - .hold_back = hold_back, - .part_hold_back = part_hold_back, - .can_block_reload = can_block_reload, + /*.skip_boundary =*/ can_skip_until, + /*.can_skip_dateranges =*/ can_skip_dateranges, + /*.hold_back =*/ hold_back, + /*.part_hold_back =*/ part_hold_back, + /*.can_block_reload =*/ can_block_reload, }; } @@ -1263,7 +1263,7 @@ ParseStatus::Or<XTargetDurationTag> XTargetDurationTag::Parse(TagItem tag) { return ParseStatusCode::kValueOverflowsTimeDelta; } - return XTargetDurationTag{.duration = duration}; + return XTargetDurationTag{/*.duration =*/ duration}; } } // namespace media::hls diff --git a/chromium/media/formats/hls/types.cc b/chromium/media/formats/hls/types.cc index f8165c79674..80b810ba48f 100644 --- a/chromium/media/formats/hls/types.cc +++ b/chromium/media/formats/hls/types.cc @@ -201,8 +201,8 @@ ParseStatus::Or<DecimalResolution> DecimalResolution::Parse( } } - return DecimalResolution{.width = std::move(width).value(), - .height = std::move(height).value()}; + return DecimalResolution{/*.width =*/ std::move(width).value(), + /*.height =*/ std::move(height).value()}; } // static @@ -231,8 +231,8 @@ ParseStatus::Or<ByteRangeExpression> ByteRangeExpression::Parse( offset = std::move(offset_result).value(); } - return ByteRangeExpression{.length = std::move(length).value(), - .offset = offset}; + return ByteRangeExpression{/*.length =*/ std::move(length).value(), + /*.offset =*/ offset}; } // static @@ -343,7 +343,7 @@ ParseStatus::Or<AttributeListIterator::Item> AttributeListIterator::Next() { } remaining_content_ = content; - return Item{.name = name.value(), .value = value.value()}; + return Item{/*.name =*/ name.value(), /*.value =*/ value.value()}; } AttributeMap::AttributeMap(base::span<Item> sorted_items) diff --git a/chromium/media/formats/hls/variable_dictionary.cc b/chromium/media/formats/hls/variable_dictionary.cc index 3e339bfabae..9f6fe6d6c04 100644 --- a/chromium/media/formats/hls/variable_dictionary.cc +++ b/chromium/media/formats/hls/variable_dictionary.cc @@ -52,10 +52,10 @@ GetNextVariableResult GetNextVariable(const SourceString input) { auto var_name = std::move(var_name_result).value(); return GetNextVariableResult{ - .head = head, .tail = std::make_pair(var_name, remaining_input)}; + /*.head =*/ head, /*.tail =*/ std::make_pair(var_name, remaining_input)}; } - return GetNextVariableResult{.head = input, .tail = absl::nullopt}; + return GetNextVariableResult{/*.head =*/ input, /*.tail =*/ absl::nullopt}; } } // namespace @@ -99,7 +99,7 @@ ParseStatus::Or<ResolvedSourceString> VariableDictionary::Resolve( if (!next_var.tail) { return ResolvedSourceString::Create( {}, input.Line(), input.Column(), input.Str(), - ResolvedSourceStringState{.contains_substitutions = false}); + ResolvedSourceStringState{/*.contains_substitutions =*/ false}); } // If there was a variable reference, but it consisted of the entire input @@ -113,7 +113,7 @@ ParseStatus::Or<ResolvedSourceString> VariableDictionary::Resolve( return ResolvedSourceString::Create( {}, input.Line(), input.Column(), *value, - ResolvedSourceStringState{.contains_substitutions = true}); + ResolvedSourceStringState{/*.contains_substitutions =*/ true}); } auto& string_buf = buffer.strings_.emplace_back(); @@ -139,7 +139,7 @@ ParseStatus::Or<ResolvedSourceString> VariableDictionary::Resolve( return ResolvedSourceString::Create( {}, input.Line(), input.Column(), string_buf, - ResolvedSourceStringState{.contains_substitutions = true}); + ResolvedSourceStringState{/*.contains_substitutions =*/ true}); } } // namespace media::hls diff --git a/chromium/media/gpu/windows/d3d11_vp9_accelerator.cc b/chromium/media/gpu/windows/d3d11_vp9_accelerator.cc index 2054e2418ff..4f92b840032 100644 --- a/chromium/media/gpu/windows/d3d11_vp9_accelerator.cc +++ b/chromium/media/gpu/windows/d3d11_vp9_accelerator.cc @@ -31,7 +31,7 @@ CreateSubsampleMappingBlock(const std::vector<SubsampleEntry>& from) { std::vector<D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK> to(from.size()); for (const auto& entry : from) { D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK subsample = { - .ClearSize = entry.clear_bytes, .EncryptedSize = entry.cypher_bytes}; + entry.clear_bytes, entry.cypher_bytes}; to.push_back(subsample); } return to; diff --git a/chromium/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc b/chromium/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc index c5f63ed903f..a3f37819c30 100644 --- a/chromium/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc +++ b/chromium/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc @@ -1550,15 +1550,15 @@ HRESULT MediaFoundationVideoEncodeAccelerator::InitializeD3DVideoProcessing( } // Input/output framerates are dummy values for passthrough. - D3D11_VIDEO_PROCESSOR_CONTENT_DESC vp_desc = { - .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE, - .InputFrameRate = {60, 1}, - .InputWidth = input_desc.Width, - .InputHeight = input_desc.Height, - .OutputFrameRate = {60, 1}, - .OutputWidth = static_cast<UINT>(input_visible_size_.width()), - .OutputHeight = static_cast<UINT>(input_visible_size_.height()), - .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL}; + D3D11_VIDEO_PROCESSOR_CONTENT_DESC vp_desc{}; + vp_desc.InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE; + vp_desc.InputFrameRate = {60, 1}; + vp_desc.InputWidth = input_desc.Width; + vp_desc.InputHeight = input_desc.Height; + vp_desc.OutputFrameRate = {60, 1}; + vp_desc.OutputWidth = static_cast<UINT>(input_visible_size_.width()); + vp_desc.OutputHeight = static_cast<UINT>(input_visible_size_.height()); + vp_desc.Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL; Microsoft::WRL::ComPtr<ID3D11Device> texture_device; input_texture->GetDevice(&texture_device); @@ -1587,17 +1587,17 @@ HRESULT MediaFoundationVideoEncodeAccelerator::InitializeD3DVideoProcessing( video_context->VideoProcessorSetStreamAutoProcessingMode( video_processor.Get(), 0, FALSE); - D3D11_TEXTURE2D_DESC scaled_desc = { - .Width = static_cast<UINT>(input_visible_size_.width()), - .Height = static_cast<UINT>(input_visible_size_.height()), - .MipLevels = 1, - .ArraySize = 1, - .Format = DXGI_FORMAT_NV12, - .SampleDesc = {1, 0}, - .Usage = D3D11_USAGE_DEFAULT, - .BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, - .CPUAccessFlags = 0, - .MiscFlags = 0}; + D3D11_TEXTURE2D_DESC scaled_desc{}; + scaled_desc.Width = static_cast<UINT>(input_visible_size_.width()); + scaled_desc.Height = static_cast<UINT>(input_visible_size_.height()); + scaled_desc.MipLevels = 1; + scaled_desc.ArraySize = 1; + scaled_desc.Format = DXGI_FORMAT_NV12; + scaled_desc.SampleDesc = {1, 0}; + scaled_desc.Usage = D3D11_USAGE_DEFAULT; + scaled_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; + scaled_desc.CPUAccessFlags = 0; + scaled_desc.MiscFlags = 0; Microsoft::WRL::ComPtr<ID3D11Texture2D> scaled_d3d11_texture; hr = texture_device->CreateTexture2D(&scaled_desc, nullptr, &scaled_d3d11_texture); @@ -1670,12 +1670,13 @@ HRESULT MediaFoundationVideoEncodeAccelerator::PerformD3DScaling( &input_view); RETURN_ON_HR_FAILURE(hr, "CreateVideoProcessorInputView failed", hr); - D3D11_VIDEO_PROCESSOR_STREAM stream = {.Enable = true, - .OutputIndex = 0, - .InputFrameOrField = 0, - .PastFrames = 0, - .FutureFrames = 0, - .pInputSurface = input_view.Get()}; + D3D11_VIDEO_PROCESSOR_STREAM stream{}; + stream.Enable = true; + stream.OutputIndex = 0; + stream.InputFrameOrField = 0; + stream.PastFrames = 0; + stream.FutureFrames = 0; + stream.pInputSurface = input_view.Get(); D3D11_TEXTURE2D_DESC input_texture_desc = {}; input_texture->GetDesc(&input_texture_desc); diff --git a/chromium/media/renderers/paint_canvas_video_renderer.cc b/chromium/media/renderers/paint_canvas_video_renderer.cc index 6c74cca5050..592a16261bb 100644 --- a/chromium/media/renderers/paint_canvas_video_renderer.cc +++ b/chromium/media/renderers/paint_canvas_video_renderer.cc @@ -395,13 +395,13 @@ void ConvertVideoFrameToRGBPixelsTask(const VideoFrame* video_frame, // Note: Unlike |data|, stride does not need to be adjusted by the // visible rect and sample size. Adding the full frame stride to a // pixel on row N and column M will wrap to column M on row N + 1. - .stride = video_frame->stride(plane), + /*.stride = */video_frame->stride(plane), - .data = video_frame->visible_data(plane) + + /*.data = */video_frame->visible_data(plane) + video_frame->stride(plane) * (chunk_start * rows_per_chunk) / VideoFrame::SampleSize(format, plane).height()}; } else { - plane_meta[plane] = {.stride = 0, .data = nullptr}; + plane_meta[plane] = {/*.stride =*/ 0, /*.data =*/ nullptr}; } } diff --git a/chromium/mojo/core/core_ipcz.cc b/chromium/mojo/core/core_ipcz.cc index 3ca2b31cab4..2babce67c66 100644 --- a/chromium/mojo/core/core_ipcz.cc +++ b/chromium/mojo/core/core_ipcz.cc @@ -433,8 +433,8 @@ MojoResult MojoCreateDataPipeIpcz(const MojoCreateDataPipeOptions* options, // Mojo Core defaults to 64 kB capacity and 1-byte elements, and many callers // assume these defaults. constexpr uint32_t kDefaultCapacity = 64 * 1024; - DataPipe::Config config = {.element_size = 1, - .byte_capacity = kDefaultCapacity}; + DataPipe::Config config = {/*.element_size =*/ 1, + /*.byte_capacity =*/ kDefaultCapacity}; if (options) { config.element_size = options->element_num_bytes; if (options->capacity_num_bytes) { @@ -858,7 +858,7 @@ MojoResult MojoQueryQuotaIpcz(MojoHandle handle, const MojoQueryQuotaOptions* options, uint64_t* current_limit, uint64_t* current_usage) { - IpczPortalStatus status = {.size = sizeof(status)}; + IpczPortalStatus status = {/*.size =*/ sizeof(status)}; const IpczResult result = GetIpczAPI().QueryPortalStatus(handle, IPCZ_NO_FLAGS, nullptr, &status); DCHECK_EQ(result, IPCZ_RESULT_OK); diff --git a/chromium/mojo/core/embedder/embedder.cc b/chromium/mojo/core/embedder/embedder.cc index e1287322d57..4d764a34281 100644 --- a/chromium/mojo/core/embedder/embedder.cc +++ b/chromium/mojo/core/embedder/embedder.cc @@ -95,8 +95,8 @@ void Init(const Configuration& configuration) { internal::g_configuration = configuration; if (IsMojoIpczEnabled()) { CHECK(InitializeIpczNodeForProcess({ - .is_broker = configuration.is_broker_process, - .use_local_shared_memory_allocation = + /*.is_broker =*/ configuration.is_broker_process, +// .use_local_shared_memory_allocation = configuration.is_broker_process || configuration.force_direct_shared_memory_allocation, })); diff --git a/chromium/mojo/core/ipcz_api.cc b/chromium/mojo/core/ipcz_api.cc index 156dade7601..e5c7461ea06 100644 --- a/chromium/mojo/core/ipcz_api.cc +++ b/chromium/mojo/core/ipcz_api.cc @@ -22,8 +22,8 @@ class IpczAPIInitializer { }; IpczHandle g_node = IPCZ_INVALID_HANDLE; -IpczNodeOptions g_options = {.is_broker = false, - .use_local_shared_memory_allocation = false}; +IpczNodeOptions g_options = {/*.is_broker =*/ false, + /*.use_local_shared_memory_allocation =*/ false}; } // namespace diff --git a/chromium/mojo/core/ipcz_driver/data_pipe.cc b/chromium/mojo/core/ipcz_driver/data_pipe.cc index 98c9c97775b..27a1aa19b12 100644 --- a/chromium/mojo/core/ipcz_driver/data_pipe.cc +++ b/chromium/mojo/core/ipcz_driver/data_pipe.cc @@ -76,9 +76,9 @@ DataPipe::PortalWrapper::~PortalWrapper() { DataPipe::DataPipe(const Config& config) : element_size_(config.element_size), limits_({ - .size = sizeof(IpczPutLimits), - .max_queued_parcels = std::numeric_limits<size_t>::max(), - .max_queued_bytes = config.byte_capacity, + /*.size =*/ sizeof(IpczPutLimits), + /*.max_queued_parcels =*/ std::numeric_limits<size_t>::max(), + /*.max_queued_bytes =*/ config.byte_capacity, }) { DCHECK_GT(element_size_, 0u); DCHECK_LE(element_size_, std::numeric_limits<uint32_t>::max()); @@ -99,7 +99,7 @@ DataPipe::Pair DataPipe::CreatePair(const Config& config) { Pair pair; pair.consumer = base::MakeRefCounted<DataPipe>( - Config{.element_size = config.element_size, .byte_capacity = 0}); + Config{/*.element_size =*/ config.element_size, /*.byte_capacity =*/ 0}); pair.consumer->AdoptPortal(consumer); pair.producer = base::MakeRefCounted<DataPipe>(config); @@ -123,7 +123,7 @@ void DataPipe::AdoptPortal(IpczHandle portal) { // If there are any parcels ready to read now, treat them as if they're new // data. If we're wrong the only side effect is that an observer may attempt // a single redundant read of the pipe. - IpczPortalStatus status = {.size = sizeof(status)}; + IpczPortalStatus status = {/*.size =*/ sizeof(status)}; GetIpczAPI().QueryPortalStatus(wrapper->handle(), IPCZ_NO_FLAGS, nullptr, &status); if (status.num_local_bytes > 0) { @@ -196,8 +196,8 @@ IpczResult DataPipe::BeginWriteData(void*& data, allow_partial ? IPCZ_BEGIN_PUT_ALLOW_PARTIAL : IPCZ_NO_FLAGS; const IpczBeginPutOptions begin_put_options = { - .size = sizeof(begin_put_options), - .limits = &limits_, + /*.size =*/ sizeof(begin_put_options), + /*.limits =*/ &limits_, }; // Several MojoBeginWriteData() callers supply an input size of zero and @@ -279,7 +279,7 @@ IpczResult DataPipe::ReadData(void* elements, } IpczHandle portal; - IpczPortalStatus status = {.size = sizeof(status)}; + IpczPortalStatus status = {/*.size =*/ sizeof(status)}; { base::AutoLock lock(lock_); if (!portal_) { @@ -449,8 +449,8 @@ scoped_refptr<DataPipe> DataPipe::Deserialize( } return base::MakeRefCounted<DataPipe>( - Config{.element_size = header.element_size, - .byte_capacity = header.byte_capacity}); + Config{/*.element_size =*/ header.element_size, + /*.byte_capacity =*/ header.byte_capacity}); } void DataPipe::WatchForNewData() { @@ -477,8 +477,8 @@ void DataPipe::WatchForNewData() { AddRef(); const IpczTrapConditions conditions = { - .size = sizeof(conditions), - .flags = IPCZ_TRAP_NEW_LOCAL_PARCEL, + /*.size =*/ sizeof(conditions), + /*.flags =*/ IPCZ_TRAP_NEW_LOCAL_PARCEL, }; const uintptr_t context = reinterpret_cast<uintptr_t>(this); const IpczResult result = diff --git a/chromium/mojo/core/ipcz_driver/invitation.cc b/chromium/mojo/core/ipcz_driver/invitation.cc index 8ac36f8aa28..0f0f9864b71 100644 --- a/chromium/mojo/core/ipcz_driver/invitation.cc +++ b/chromium/mojo/core/ipcz_driver/invitation.cc @@ -116,10 +116,10 @@ void Invitation::InvokeDefaultProcessErrorHandler(const std::string& error) { } const MojoProcessErrorDetails details{ - .struct_size = sizeof(details), - .error_message_length = base::checked_cast<uint32_t>(error.size()), - .error_message = error.c_str(), - .flags = MOJO_PROCESS_ERROR_FLAG_NONE, + /*.struct_size =*/ sizeof(details), + /*.error_message_length = */base::checked_cast<uint32_t>(error.size()), + /*.error_message =*/ error.c_str(), + /*.flags =*/ MOJO_PROCESS_ERROR_FLAG_NONE, }; g_default_process_error_handler(&details); } @@ -203,8 +203,8 @@ MojoResult Invitation::Send( } IpczDriverHandle transport = CreateTransportForMojoEndpoint( - {.source = config.is_broker ? Transport::kBroker : Transport::kNonBroker, - .destination = is_isolated ? Transport::kBroker : Transport::kNonBroker}, + {/*.source =*/ config.is_broker ? Transport::kBroker : Transport::kNonBroker, + /*.destination =*/ is_isolated ? Transport::kBroker : Transport::kNonBroker}, *transport_endpoint, /*leak_channel_on_shutdown=*/false, std::move(remote_process), error_handler, error_handler_context); @@ -294,8 +294,8 @@ MojoHandle Invitation::Accept( // application-provided attachments begin at index 1. IpczHandle portals[kMaxAttachments + 1]; IpczDriverHandle transport = CreateTransportForMojoEndpoint( - {.source = is_isolated ? Transport::kBroker : Transport::kNonBroker, - .destination = Transport::kBroker}, + {/*.source =*/ is_isolated ? Transport::kBroker : Transport::kNonBroker, + /*.destination =*/ Transport::kBroker}, *transport_endpoint, leak_transport); if (transport == IPCZ_INVALID_DRIVER_HANDLE) { return IPCZ_INVALID_DRIVER_HANDLE; diff --git a/chromium/mojo/core/ipcz_driver/mojo_trap.cc b/chromium/mojo/core/ipcz_driver/mojo_trap.cc index 33267745567..7545edc0044 100644 --- a/chromium/mojo/core/ipcz_driver/mojo_trap.cc +++ b/chromium/mojo/core/ipcz_driver/mojo_trap.cc @@ -172,7 +172,7 @@ struct MojoTrap::Trigger : public base::RefCountedThreadSafe<Trigger> { const scoped_refptr<DataPipe> data_pipe; const MojoHandleSignals signals; const uintptr_t trigger_context; - IpczTrapConditions conditions = {.size = sizeof(conditions), .flags = 0}; + IpczTrapConditions conditions = {/*.size =*/ sizeof(conditions), /*.flags =*/ 0}; // Access to all fields below is effectively guarded by the owning MojoTrap's // `lock_`. @@ -243,8 +243,8 @@ MojoResult MojoTrap::AddTrigger(MojoHandle handle, // added here. trigger->AddRef(); IpczTrapConditions removal_conditions = { - .size = sizeof(removal_conditions), - .flags = IPCZ_TRAP_REMOVED, + /*.size =*/ sizeof(removal_conditions), + /*.flags =*/ IPCZ_TRAP_REMOVED, }; IpczResult result = GetIpczAPI().Trap( handle, &removal_conditions, &TrapRemovalEventHandler, @@ -266,7 +266,7 @@ MojoResult MojoTrap::AddTrigger(MojoHandle handle, armed_ = false; pending_mojo_events_->emplace_back( - MojoTrapEvent{.struct_size = sizeof(MojoTrapEvent)}); + MojoTrapEvent{/*.struct_size =*/ sizeof(MojoTrapEvent)}); MojoTrapEvent& event = pending_mojo_events_->back(); TranslateIpczToMojoEvent(signals, trigger_context, data_pipe, flags, status, &event); @@ -439,7 +439,7 @@ void MojoTrap::HandleEvent(const IpczTrapEvent& event) { armed_ = false; pending_mojo_events_->emplace_back( - MojoTrapEvent{.struct_size = sizeof(MojoTrapEvent)}); + MojoTrapEvent{/*.struct_size =*/ sizeof(MojoTrapEvent)}); MojoTrapEvent& mojo_event = pending_mojo_events_->back(); TranslateIpczToMojoEvent(trigger->signals, trigger->trigger_context, trigger->data_pipe.get(), event.condition_flags, @@ -531,11 +531,11 @@ void MojoTrap::MaybeEnqueueTriggerRemoval(Trigger& trigger) { } trigger.removed = true; pending_mojo_events_->push_back(MojoTrapEvent{ - .struct_size = sizeof(MojoTrapEvent), - .flags = MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL, - .trigger_context = trigger.trigger_context, - .result = MOJO_RESULT_CANCELLED, - .signals_state = {.satisfied_signals = 0, .satisfiable_signals = 0}, + /*.struct_size =*/ sizeof(MojoTrapEvent), + /*.flags =*/ MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL, + /*.trigger_context =*/ trigger.trigger_context, + /*.result =*/ MOJO_RESULT_CANCELLED, + /*.signals_state =*/ {/*.satisfied_signals =*/ 0, /*.satisfiable_signals =*/ 0}, }); } diff --git a/chromium/mojo/core/ipcz_driver/transport.cc b/chromium/mojo/core/ipcz_driver/transport.cc index 5ff1f72fe37..1418abf612a 100644 --- a/chromium/mojo/core/ipcz_driver/transport.cc +++ b/chromium/mojo/core/ipcz_driver/transport.cc @@ -181,9 +181,9 @@ scoped_refptr<Transport> Transport::Create(EndpointTypes endpoint_types, std::pair<scoped_refptr<Transport>, scoped_refptr<Transport>> Transport::CreatePair(EndpointType first_type, EndpointType second_type) { PlatformChannel channel; - auto one = Create({.source = first_type, .destination = second_type}, + auto one = Create({/*.source =*/ first_type, /*.destination =*/ second_type}, channel.TakeLocalEndpoint()); - auto two = Create({.source = second_type, .destination = first_type}, + auto two = Create({/*.source =*/ second_type, /*.destination =*/ first_type}, channel.TakeRemoteEndpoint()); return {one, two}; } @@ -191,10 +191,10 @@ Transport::CreatePair(EndpointType first_type, EndpointType second_type) { Transport::~Transport() { if (error_handler_) { const MojoProcessErrorDetails details{ - .struct_size = sizeof(details), - .error_message_length = 0, - .error_message = nullptr, - .flags = MOJO_PROCESS_ERROR_FLAG_DISCONNECTED, + /*.struct_size =*/ sizeof(details), + /*.error_message_length =*/ 0, + /*.error_message =*/ nullptr, + /*.flags =*/ MOJO_PROCESS_ERROR_FLAG_DISCONNECTED, }; error_handler_(error_handler_context_, &details); } @@ -219,11 +219,11 @@ void Transport::ReportBadActivity(const std::string& error_message) { } const MojoProcessErrorDetails details{ - .struct_size = sizeof(details), - .error_message_length = + /*.struct_size =*/ sizeof(details), +// .error_message_length = base::checked_cast<uint32_t>(error_message.size()), - .error_message = error_message.c_str(), - .flags = MOJO_PROCESS_ERROR_FLAG_NONE, + /*.error_message =*/ error_message.c_str(), + /*.flags =*/ MOJO_PROCESS_ERROR_FLAG_NONE, }; error_handler_(error_handler_context_, &details); } @@ -571,8 +571,8 @@ scoped_refptr<Transport> Transport::Deserialize( from_transport.remote_process().IsValid()) { process = from_transport.remote_process().Duplicate(); } - return Create({.source = from_transport.source_type(), - .destination = header.destination_type}, + return Create({/*.source =*/ from_transport.source_type(), + /*.destination =*/ header.destination_type}, PlatformChannelEndpoint(std::move(handles[0])), std::move(process)); } diff --git a/chromium/mojo/core/ports/node.cc b/chromium/mojo/core/ports/node.cc index e15f1d124c9..3759f6c945d 100644 --- a/chromium/mojo/core/ports/node.cc +++ b/chromium/mojo/core/ports/node.cc @@ -598,7 +598,8 @@ int Node::MergePorts(const PortRef& port_ref, const PortName& destination_port_name) { PortName new_port_name; Event::PortDescriptor new_port_descriptor; - PendingUpdatePreviousPeer pending_update_event{.from_port = port_ref.name()}; + PendingUpdatePreviousPeer pending_update_event = {}; + pending_update_event.from_port = port_ref.name(); { // Must be held for ConvertToProxy. PortLocker::AssertNoPortsLockedOnCurrentThread(); @@ -1328,19 +1329,19 @@ int Node::MergePortsInternal(const PortRef& port0_ref, } pending_update_events[0] = { - .receiver = port0->peer_node_name, - .port = port0->peer_port_name, - .from_port = port0_ref.name(), - .sequence_num = port0->next_control_sequence_num_to_send++, - .new_prev_node = name_, - .new_prev_port = port1_ref.name()}; + /*.receiver =*/ port0->peer_node_name, + /*.port =*/ port0->peer_port_name, + /*.from_port =*/ port0_ref.name(), + /*.sequence_num =*/ port0->next_control_sequence_num_to_send++, + /*.new_prev_node =*/ name_, + /*.new_prev_port =*/ port1_ref.name()}; pending_update_events[1] = { - .receiver = port1->peer_node_name, - .port = port1->peer_port_name, - .from_port = port1_ref.name(), - .sequence_num = port1->next_control_sequence_num_to_send++, - .new_prev_node = name_, - .new_prev_port = port0_ref.name()}; + /*.receiver =*/ port1->peer_node_name, + /*.port =*/ port1->peer_port_name, + /*.from_port =*/ port1_ref.name(), + /*.sequence_num =*/ port1->next_control_sequence_num_to_send++, + /*.new_prev_node =*/ name_, + /*.new_prev_port =*/ port0_ref.name()}; // Swap the ports' peer information and switch them both to proxying mode. SwapPortPeers(port0_ref.name(), port0, port1_ref.name(), port1); @@ -1620,8 +1621,8 @@ int Node::PrepareToForwardUserMessage(const PortRef& forwarding_port_ref, Event::PortDescriptor* port_descriptors = message->port_descriptors(); for (size_t i = 0; i < message->num_ports(); ++i) { auto* port = locker.GetPort(attached_port_refs[i]); - PendingUpdatePreviousPeer update_event = { - .from_port = attached_port_refs[i].name()}; + PendingUpdatePreviousPeer update_event = {}; + update_event.from_port = attached_port_refs[i].name(); ConvertToProxy(port, target_node_name, message->ports() + i, port_descriptors + i, &update_event); peer_update_events.push(update_event); @@ -1809,12 +1810,12 @@ void Node::TryRemoveProxy(const PortRef& port_ref) { } // Tell the peer_node to accept messages from prev_node from now. pending_update_event = { - .receiver = port->peer_node_name, - .port = port->peer_port_name, - .from_port = port_ref.name(), - .sequence_num = port->next_control_sequence_num_to_send++, - .new_prev_node = port->prev_node_name, - .new_prev_port = port->prev_port_name}; + /*.receiver =*/ port->peer_node_name, + /*.port =*/ port->peer_port_name, + /*.from_port =*/ port_ref.name(), + /*.sequence_num =*/ port->next_control_sequence_num_to_send++, + /*.new_prev_node =*/ port->prev_node_name, + /*.new_prev_port =*/ port->prev_port_name}; } else { DVLOG(2) << "Cannot remove port " << port_ref.name() << "@" << name_ << " now; waiting for more messages"; diff --git a/chromium/mojo/public/cpp/platform/named_platform_channel.cc b/chromium/mojo/public/cpp/platform/named_platform_channel.cc index 70f1ecb0743..24d190ee9e8 100644 --- a/chromium/mojo/public/cpp/platform/named_platform_channel.cc +++ b/chromium/mojo/public/cpp/platform/named_platform_channel.cc @@ -46,7 +46,7 @@ void NamedPlatformChannel::PassServerNameOnCommandLine( PlatformChannelEndpoint NamedPlatformChannel::ConnectToServer( const ServerName& server_name) { DCHECK(!server_name.empty()); - Options options = {.server_name = server_name}; + Options options = {/*.server_name =*/ server_name}; return CreateClientEndpoint(options); } diff --git a/chromium/mojo/public/cpp/platform/platform_handle_internal.h b/chromium/mojo/public/cpp/platform/platform_handle_internal.h index 9b727c9797e..4134b35375a 100644 --- a/chromium/mojo/public/cpp/platform/platform_handle_internal.h +++ b/chromium/mojo/public/cpp/platform/platform_handle_internal.h @@ -19,8 +19,8 @@ class PlatformHandleInternal { public: static MojoSharedBufferGuid MarshalUnguessableToken( const base::UnguessableToken& token) { - return {.high = token.GetHighForSerialization(), - .low = token.GetLowForSerialization()}; + return {/*.high =*/ token.GetHighForSerialization(), + /*.low =*/ token.GetLowForSerialization()}; } static base::UnguessableToken UnmarshalUnguessableToken( const MojoSharedBufferGuid* guid) { diff --git a/chromium/pdf/pdf_view_web_plugin.cc b/chromium/pdf/pdf_view_web_plugin.cc index cdedca1425d..ad40c2912a5 100644 --- a/chromium/pdf/pdf_view_web_plugin.cc +++ b/chromium/pdf/pdf_view_web_plugin.cc @@ -1057,7 +1057,7 @@ PdfViewWebPlugin::SearchString(const char16_t* string, int match_index; int match_length; while (searcher.NextMatchResult(match_index, match_length)) - results.push_back({.start_index = match_index, .length = match_length}); + results.push_back({/*.start_index =*/ match_index, /*.length =*/ match_length}); return results; } @@ -2285,7 +2285,7 @@ void PdfViewWebPlugin::HandleLoadPreviewPageMessage( int src_page_index = ExtractPrintPreviewPageIndex(url); DCHECK_GE(src_page_index, 0); - preview_pages_info_.push({.url = url, .dest_page_index = dest_page_index}); + preview_pages_info_.push({/*.url =*/ url, /*.dest_page_index =*/ dest_page_index}); LoadAvailablePreviewPage(); } diff --git a/chromium/printing/printing_context.cc b/chromium/printing/printing_context.cc index 3a9e75c229f..c6fa9801a16 100644 --- a/chromium/printing/printing_context.cc +++ b/chromium/printing/printing_context.cc @@ -178,16 +178,14 @@ mojom::ResultCode PrintingContext::UpdatePrintSettings( DCHECK(open_in_external_preview || printer_type == mojom::PrinterType::kLocal); - PrinterSettings printer_settings { + PrinterSettings printer_settings {}; #if BUILDFLAG(IS_MAC) - .external_preview = open_in_external_preview, + printer_settings.external_preview = open_in_external_preview; #endif - .show_system_dialog = - job_settings.FindBool(kSettingShowSystemDialog).value_or(false), + printer_settings.show_system_dialog = job_settings.FindBool(kSettingShowSystemDialog).value_or(false); #if BUILDFLAG(IS_WIN) - .page_count = job_settings.FindInt(kSettingPreviewPageCount).value_or(0) + printer_settings.page_count = job_settings.FindInt(kSettingPreviewPageCount).value_or(0); #endif - }; return UpdatePrinterSettings(printer_settings); } 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; } diff --git a/chromium/sql/database.cc b/chromium/sql/database.cc index f87b0c8b6f0..084b33b3467 100644 --- a/chromium/sql/database.cc +++ b/chromium/sql/database.cc @@ -302,7 +302,7 @@ void DatabaseDiagnostics::WriteIntoTrace( // DatabaseOptions::explicit_locking needs to be set to false for historical // reasons. -Database::Database() : Database({.exclusive_locking = false}) {} +Database::Database() : Database(DatabaseOptions(/*.exclusive_locking =*/ false)) {} Database::Database(DatabaseOptions options) : options_(options), mmap_disabled_(!enable_mmap_by_default_) { @@ -975,16 +975,13 @@ bool Database::Raze() { return false; } - sql::Database null_db(sql::DatabaseOptions{ - .exclusive_locking = true, - .page_size = options_.page_size, - .cache_size = 0, - .enable_foreign_keys_discouraged = - options_.enable_foreign_keys_discouraged, - .enable_views_discouraged = options_.enable_views_discouraged, - .enable_virtual_tables_discouraged = - options_.enable_virtual_tables_discouraged, - }); + sql::DatabaseOptions options(true, options_.page_size, 0); + options.enable_foreign_keys_discouraged = + options_.enable_foreign_keys_discouraged; + options.enable_views_discouraged = options_.enable_views_discouraged; + options.enable_virtual_tables_discouraged = + options_.enable_virtual_tables_discouraged; + sql::Database null_db(std::move(options)); if (!null_db.OpenInMemory()) { DLOG(DCHECK) << "Unable to open in-memory database."; return false; diff --git a/chromium/sql/database.h b/chromium/sql/database.h index b13355d8b39..dae2656d5ae 100644 --- a/chromium/sql/database.h +++ b/chromium/sql/database.h @@ -65,7 +65,9 @@ struct COMPONENT_EXPORT(SQL) DatabaseOptions { // // Guaranteed to match SQLITE_DEFAULT_PAGE_SIZE. static constexpr int kDefaultPageSize = 4096; - + DatabaseOptions(bool el, int ps = kDefaultPageSize, int cs = 0, bool mastd = false, bool evd = false, bool evtd = false) noexcept : + exclusive_locking(el), page_size(ps), cache_size(cs), mmap_alt_status_discouraged(mastd), + enable_views_discouraged(evd), enable_virtual_tables_discouraged(evtd) {} // If true, the database can only be opened by one process at a time. // // SQLite supports a locking protocol that allows multiple processes to safely diff --git a/chromium/sql/recovery.cc b/chromium/sql/recovery.cc index b25c2e23efd..7e68f860e81 100644 --- a/chromium/sql/recovery.cc +++ b/chromium/sql/recovery.cc @@ -73,10 +73,11 @@ void Recovery::Rollback(std::unique_ptr<Recovery> r) { Recovery::Recovery(Database* connection) : db_(connection), recover_db_({ - .exclusive_locking = false, - .page_size = db_->page_size(), + /*.exclusive_locking =*/ false, + /*.page_size =*/ db_->page_size(), + 0, false, false, // The interface to the recovery module is a virtual table. - .enable_virtual_tables_discouraged = true, + /*.enable_virtual_tables_discouraged =*/ true }) { // Files with I/O errors cannot be safely memory-mapped. recover_db_.set_mmap_disabled(); diff --git a/chromium/storage/browser/database/database_tracker.cc b/chromium/storage/browser/database/database_tracker.cc index af845fb4a87..947f5966516 100644 --- a/chromium/storage/browser/database/database_tracker.cc +++ b/chromium/storage/browser/database/database_tracker.cc @@ -109,11 +109,11 @@ DatabaseTracker::DatabaseTracker( db_dir_(is_incognito_ ? profile_path_.Append(kIncognitoDatabaseDirectoryName) : profile_path_.Append(kDatabaseDirectoryName)), - db_(std::make_unique<sql::Database>(sql::DatabaseOptions{ - .exclusive_locking = true, - .page_size = 4096, - .cache_size = 500, - })), + db_(std::make_unique<sql::Database>(sql::DatabaseOptions( + /*.exclusive_locking =*/ true, + /*.page_size =*/ 4096, + /*.cache_size =*/ 500 + ))), special_storage_policy_(std::move(special_storage_policy)), quota_manager_proxy_(std::move(quota_manager_proxy)), task_runner_(base::ThreadPool::CreateSequencedTaskRunner( diff --git a/chromium/storage/browser/quota/quota_database.cc b/chromium/storage/browser/quota/quota_database.cc index 93f7e9943dc..de35652ad0d 100644 --- a/chromium/storage/browser/quota/quota_database.cc +++ b/chromium/storage/browser/quota/quota_database.cc @@ -893,15 +893,9 @@ QuotaError QuotaDatabase::EnsureOpened() { if (is_disabled_) return QuotaError::kDatabaseError; - db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{ - .exclusive_locking = true, - // The quota database is a critical storage component. If it's corrupted, - // all client-side storage APIs fail, because they don't know where their - // data is stored. - .flush_to_media = true, - .page_size = 4096, - .cache_size = 500, - }); + sql::DatabaseOptions options(true, 4096, 500); + options.flush_to_media = true; + db_ = std::make_unique<sql::Database>(std::move(options)); meta_table_ = std::make_unique<sql::MetaTable>(); db_->set_histogram_tag("Quota"); diff --git a/chromium/third_party/blink/common/privacy_budget/aggregating_sample_collector.cc b/chromium/third_party/blink/common/privacy_budget/aggregating_sample_collector.cc index ad317dd19a4..9374ad7c13d 100644 --- a/chromium/third_party/blink/common/privacy_budget/aggregating_sample_collector.cc +++ b/chromium/third_party/blink/common/privacy_budget/aggregating_sample_collector.cc @@ -156,7 +156,7 @@ void AggregatingSampleCollector::TryAcceptSingleSample( per_surface_samples_.emplace( new_sample.surface, - Samples{.samples = {{new_sample.value}}, .total_value_count = 1}); + Samples{/*.samples =*/ {{new_sample.value}}, false, /*.total_value_count =*/ 1}); } else { Samples& sample_set = samples_for_surface_it->second; ++sample_set.total_value_count; diff --git a/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc b/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc index fd4e4fa9488..e2b72043fc4 100644 --- a/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc +++ b/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc @@ -581,17 +581,17 @@ MediaStreamTrack* V8ScriptValueDeserializerForModules::ReadMediaStreamTrack() { return MediaStreamTrack::FromTransferredState( GetScriptState(), MediaStreamTrack::TransferredValues{ - .track_impl_subtype = DeserializeTrackImplSubtype(track_impl_subtype), - .session_id = session_id, - .transfer_id = transfer_id, - .kind = kind, - .id = id, - .label = label, - .enabled = static_cast<bool>(enabled), - .muted = static_cast<bool>(muted), - .content_hint = DeserializeContentHint(contentHint), - .ready_state = DeserializeReadyState(readyState), - .crop_version = crop_version}); + /*.track_impl_subtype =*/ DeserializeTrackImplSubtype(track_impl_subtype), + /*.session_id =*/ session_id, + /*.transfer_id =*/ transfer_id, + /*.kind =*/ kind, + /*.id =*/ id, + /*.label =*/ label, + /*.enabled =*/ static_cast<bool>(enabled), + /*.muted =*/ static_cast<bool>(muted), + /*.content_hint =*/ DeserializeContentHint(contentHint), + /*.ready_state =*/ DeserializeReadyState(readyState), + /*.crop_version =*/ crop_version}); } CropTarget* V8ScriptValueDeserializerForModules::ReadCropTarget() { diff --git a/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc b/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc index a04f58782b8..1624e0ca770 100644 --- a/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc +++ b/chromium/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc @@ -725,8 +725,8 @@ bool V8ScriptValueSerializerForModules::WriteMediaSourceHandle( DCHECK(media_source_attachment_provider); attachments.push_back(MediaSourceHandleAttachment::HandleInternals{ - .attachment_provider = std::move(media_source_attachment_provider), - .internal_blob_url = handle->GetInternalBlobURL()}); + /*.attachment_provider =*/ std::move(media_source_attachment_provider), + /*.internal_blob_url =*/ handle->GetInternalBlobURL()}); handle->mark_serialized(); const uint32_t index = static_cast<uint32_t>(attachments.size() - 1); diff --git a/chromium/third_party/blink/renderer/core/animation/animatable.cc b/chromium/third_party/blink/renderer/core/animation/animatable.cc index 1b64fd6ae8e..709fe243fb7 100644 --- a/chromium/third_party/blink/renderer/core/animation/animatable.cc +++ b/chromium/third_party/blink/renderer/core/animation/animatable.cc @@ -139,7 +139,7 @@ HeapVector<Member<Animation>> Animatable::getAnimations( GetAnimationsOptions* options) { bool use_subtree = options && options->subtree(); return GetAnimationsInternal( - GetAnimationsOptionsResolved{.use_subtree = use_subtree}); + GetAnimationsOptionsResolved{/*.use_subtree =*/ use_subtree}); } HeapVector<Member<Animation>> Animatable::GetAnimationsInternal( diff --git a/chromium/third_party/blink/renderer/core/dom/element.cc b/chromium/third_party/blink/renderer/core/dom/element.cc index ca2e20d6dd7..18046470865 100644 --- a/chromium/third_party/blink/renderer/core/dom/element.cc +++ b/chromium/third_party/blink/renderer/core/dom/element.cc @@ -2739,7 +2739,7 @@ void Element::HidePopUpInternal(HidePopupFocusBehavior focus_behavior, HeapVector<Member<Animation>> previous_animations; if (!force_hide) { previous_animations = GetAnimationsInternal( - GetAnimationsOptionsResolved{.use_subtree = true}); + GetAnimationsOptionsResolved{/*.use_subtree =*/ true}); } GetPopupData()->setInvoker(nullptr); @@ -2775,7 +2775,7 @@ void Element::HidePopUpInternal(HidePopupFocusBehavior focus_behavior, // can start. HeapHashSet<Member<EventTarget>> animations; for (const auto& animation : GetAnimationsInternal( - GetAnimationsOptionsResolved{.use_subtree = true})) { + GetAnimationsOptionsResolved{/*.use_subtree =*/ true})) { animations.insert(animation); } animations.RemoveAll(previous_animations); diff --git a/chromium/third_party/blink/renderer/core/frame/attribution_src_loader.cc b/chromium/third_party/blink/renderer/core/frame/attribution_src_loader.cc index fc6eef57ca6..0ee47a630fd 100644 --- a/chromium/third_party/blink/renderer/core/frame/attribution_src_loader.cc +++ b/chromium/third_party/blink/renderer/core/frame/attribution_src_loader.cc @@ -252,7 +252,7 @@ absl::optional<Impression> AttributionSrcLoader::RegisterNavigation( return absl::nullopt; DCHECK(client->attribution_src_token()); - return blink::Impression{.attribution_src_token = + return blink::Impression{/*.attribution_src_token =*/ *client->attribution_src_token()}; } diff --git a/chromium/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/chromium/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc index d8c265a2c8b..514dd74645e 100644 --- a/chromium/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ b/chromium/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc @@ -3006,8 +3006,8 @@ class ReportTimeSwapPromise : public cc::SwapPromise { DidNotSwapAction action = DidNotSwapAction::BREAK_PROMISE; WebFrameWidgetImpl::PromiseCallbacks promise_callbacks_on_failure = { - .swap_time_callback = std::move(promise_callbacks_.swap_time_callback), - .presentation_time_callback = + /*.swap_time_callback =*/ std::move(promise_callbacks_.swap_time_callback), + /*.presentation_time_callback =*/ std::move(promise_callbacks_.presentation_time_callback)}; #if BUILDFLAG(IS_MAC) @@ -3131,14 +3131,16 @@ void WebFrameWidgetImpl::NotifySwapAndPresentationTimeForTesting( void WebFrameWidgetImpl::NotifyPresentationTimeInBlink( base::OnceCallback<void(base::TimeTicks)> presentation_callback) { - NotifySwapAndPresentationTime( - {.presentation_time_callback = std::move(presentation_callback)}); + NotifySwapAndPresentationTime({ + /*.swap_time_callback =*/ base::OnceCallback<void(base::TimeTicks)>(), + /*.presentation_time_callback =*/ std::move(presentation_callback)}); } void WebFrameWidgetImpl::NotifyPresentationTime( base::OnceCallback<void(base::TimeTicks)> presentation_callback) { - NotifySwapAndPresentationTime( - {.presentation_time_callback = std::move(presentation_callback)}); + NotifySwapAndPresentationTime({ + /*.swap_time_callback =*/ base::OnceCallback<void(base::TimeTicks)>(), + /*.presentation_time_callback =*/ std::move(presentation_callback)}); } #if BUILDFLAG(IS_MAC) diff --git a/chromium/third_party/blink/renderer/core/html/forms/html_form_control_element.cc b/chromium/third_party/blink/renderer/core/html/forms/html_form_control_element.cc index a89e711ed5c..70f28a07bf0 100644 --- a/chromium/third_party/blink/renderer/core/html/forms/html_form_control_element.cc +++ b/chromium/third_party/blink/renderer/core/html/forms/html_form_control_element.cc @@ -332,9 +332,9 @@ bool HTMLFormControlElement::IsSuccessfulSubmitButton() const { // values match, the behavior is to toggle. HTMLFormControlElement::PopupTargetElement HTMLFormControlElement::popupTargetElement() const { - const PopupTargetElement no_element{.element = nullptr, - .action = PopupTriggerAction::kNone, - .attribute_name = g_null_name}; + const PopupTargetElement no_element{/*.element =*/ nullptr, + /*.action =*/ PopupTriggerAction::kNone, + /*.attribute_name =*/ g_null_name}; if (!RuntimeEnabledFeatures::HTMLPopupAttributeEnabled( GetDocument().GetExecutionContext()) || !IsInTreeScope() || @@ -367,9 +367,9 @@ HTMLFormControlElement::popupTargetElement() const { Element* popup_element = GetTreeScope().getElementById(idref); if (!popup_element || !popup_element->HasPopupAttribute()) return no_element; - return PopupTargetElement{.element = popup_element, - .action = action, - .attribute_name = attribute_name}; + return PopupTargetElement{/*.element =*/ popup_element, + /*.action =*/ action, + /*.attribute_name =*/ attribute_name}; } void HTMLFormControlElement::DefaultEventHandler(Event& event) { diff --git a/chromium/third_party/blink/renderer/core/html/parser/background_html_scanner.cc b/chromium/third_party/blink/renderer/core/html/parser/background_html_scanner.cc index 50e24032b67..66d08f0ac45 100644 --- a/chromium/third_party/blink/renderer/core/html/parser/background_html_scanner.cc +++ b/chromium/third_party/blink/renderer/core/html/parser/background_html_scanner.cc @@ -194,12 +194,12 @@ BackgroundHTMLScanner::ScriptTokenScanner::Create( return std::make_unique<ScriptTokenScanner>( parser, - OptimizationParams{.task_runner = GetCompileTaskRunner(), - .min_size = GetMinimumScriptSize(), - .enabled = precompile_scripts}, - OptimizationParams{.task_runner = GetTokenizeTaskRunner(), - .min_size = GetMinimumCSSSize(), - .enabled = pretokenize_css}); + OptimizationParams{/*.task_runner =*/ GetCompileTaskRunner(), + /*.min_size =*/ GetMinimumScriptSize(), + /*.enabled =*/ precompile_scripts}, + OptimizationParams{/*.task_runner =*/ GetTokenizeTaskRunner(), + /*.min_size =*/ GetMinimumCSSSize(), + /*.enabled =*/ pretokenize_css}); } BackgroundHTMLScanner::ScriptTokenScanner::ScriptTokenScanner( diff --git a/chromium/third_party/blink/renderer/core/html/parser/background_html_token_producer.cc b/chromium/third_party/blink/renderer/core/html/parser/background_html_token_producer.cc index b073b27d202..08a1feacc74 100644 --- a/chromium/third_party/blink/renderer/core/html/parser/background_html_token_producer.cc +++ b/chromium/third_party/blink/renderer/core/html/parser/background_html_token_producer.cc @@ -169,8 +169,8 @@ void BackgroundHTMLTokenProducer::RunTokenizeLoopOnTaskRunner() { if (!in_progress_token_data_.has_value()) { in_progress_token_data_.emplace(InProgressTokenData{ - .string_length_at_start_of_token = input_.length(), - .line_count_at_start_of_token = input_.CurrentLine().ZeroBasedInt()}); + /*.string_length_at_start_of_token =*/ input_.length(), + /*.line_count_at_start_of_token =*/ input_.CurrentLine().ZeroBasedInt()}); } if (!tokenizer_->NextToken(input_, *token_)) { // Let main thread know reached end of current input. diff --git a/chromium/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc b/chromium/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc index 04722bdc57a..33b256a8d28 100644 --- a/chromium/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc +++ b/chromium/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc @@ -977,9 +977,9 @@ void TokenPreloadScanner::ScanCommon( token.GetAttributeItem(html_names::kContentAttr); if (content_attribute) { meta_ch_values.push_back( - MetaCHValue{.value = content_attribute->GetValue(), - .type = network::MetaCHType::HttpEquivAcceptCH, - .is_doc_preloader = + MetaCHValue{/*.value =*/ content_attribute->GetValue(), + /*.type =*/ network::MetaCHType::HttpEquivAcceptCH, +// .is_doc_preloader = scanner_type_ == ScannerType::kMainDocument}); } } else if (EqualIgnoringASCIICase(equiv_attribute_value, @@ -990,9 +990,9 @@ void TokenPreloadScanner::ScanCommon( token.GetAttributeItem(html_names::kContentAttr); if (content_attribute) { meta_ch_values.push_back( - MetaCHValue{.value = content_attribute->GetValue(), - .type = network::MetaCHType::HttpEquivDelegateCH, - .is_doc_preloader = + MetaCHValue{/*.value =*/ content_attribute->GetValue(), + /*.type =*/ network::MetaCHType::HttpEquivDelegateCH, +// .is_doc_preloader = scanner_type_ == ScannerType::kMainDocument}); } } diff --git a/chromium/third_party/blink/renderer/core/html/parser/text_resource_decoder.cc b/chromium/third_party/blink/renderer/core/html/parser/text_resource_decoder.cc index cfc99a4c0db..957e6b3ba9d 100644 --- a/chromium/third_party/blink/renderer/core/html/parser/text_resource_decoder.cc +++ b/chromium/third_party/blink/renderer/core/html/parser/text_resource_decoder.cc @@ -489,9 +489,9 @@ String TextResourceDecoder::Flush() { WebEncodingData TextResourceDecoder::GetEncodingData() const { return WebEncodingData{ - .encoding = String(encoding_.GetName()), - .was_detected_heuristically = EncodingWasDetectedHeuristically(), - .saw_decoding_error = SawError()}; + /*.encoding =*/ String(encoding_.GetName()), + /*.was_detected_heuristically =*/ EncodingWasDetectedHeuristically(), + /*.saw_decoding_error =*/ SawError()}; } } // namespace blink diff --git a/chromium/third_party/blink/renderer/core/input/scroll_manager.cc b/chromium/third_party/blink/renderer/core/input/scroll_manager.cc index c1f2ac4840b..98d6b77d1ca 100644 --- a/chromium/third_party/blink/renderer/core/input/scroll_manager.cc +++ b/chromium/third_party/blink/renderer/core/input/scroll_manager.cc @@ -58,12 +58,11 @@ cc::SnapFlingController::GestureScrollType ToGestureScrollType( cc::SnapFlingController::GestureScrollUpdateInfo GetGestureScrollUpdateInfo( const WebGestureEvent& event) { - return { - .delta = gfx::Vector2dF(-event.data.scroll_update.delta_x, - -event.data.scroll_update.delta_y), - .is_in_inertial_phase = event.data.scroll_update.inertial_phase == - WebGestureEvent::InertialPhaseState::kMomentum, - .event_time = event.TimeStamp()}; + return {gfx::Vector2dF(-event.data.scroll_update.delta_x, + -event.data.scroll_update.delta_y), + event.data.scroll_update.inertial_phase == + WebGestureEvent::InertialPhaseState::kMomentum, + event.TimeStamp()}; } } // namespace diff --git a/chromium/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc b/chromium/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc index e6cc3d65a31..fcf0b8b958b 100644 --- a/chromium/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc +++ b/chromium/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc @@ -553,17 +553,17 @@ void MobileFriendlinessChecker::MaybeRecompute() { void MobileFriendlinessChecker::ComputeNow() { frame_view_->DidChangeMobileFriendliness(MobileFriendliness{ - .viewport_device_width = viewport_device_width_, - .viewport_initial_scale_x10 = viewport_initial_scale_x10_, - .viewport_hardcoded_width = viewport_hardcoded_width_, - .allow_user_zoom = allow_user_zoom_, - .small_text_ratio = area_sizes_.SmallTextRatio(), - .text_content_outside_viewport_percentage = + /*.viewport_device_width =*/ viewport_device_width_, + /*.viewport_initial_scale_x10 =*/ viewport_initial_scale_x10_, + /*.viewport_hardcoded_width =*/ viewport_hardcoded_width_, + /*.allow_user_zoom =*/ allow_user_zoom_, + /*.small_text_ratio =*/ area_sizes_.SmallTextRatio(), + /*.text_content_outside_viewport_percentage =*/ area_sizes_.TextContentsOutsideViewportPercentage( // Use SizeF when computing the area to avoid integer overflow. gfx::SizeF(frame_view_->GetPage()->GetVisualViewport().Size()) .GetArea()), - .bad_tap_targets_ratio = ComputeBadTapTargetsRatio()}); + /*.bad_tap_targets_ratio = */ComputeBadTapTargetsRatio()}); last_evaluated_ = base::TimeTicks::Now(); } diff --git a/chromium/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc b/chromium/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc index 004bb845ce9..cbd06822d17 100644 --- a/chromium/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc +++ b/chromium/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc @@ -316,8 +316,8 @@ void OriginTrialContext::AddTokenFromExternalScript( const Vector<scoped_refptr<SecurityOrigin>>& external_origins) { Vector<OriginInfo> script_origins; for (const scoped_refptr<SecurityOrigin>& origin : external_origins) { - OriginInfo origin_info = {.origin = origin, - .is_secure = origin->IsPotentiallyTrustworthy()}; + OriginInfo origin_info = {/*.origin =*/ origin, + /*.is_secure =*/ origin->IsPotentiallyTrustworthy()}; DVLOG(1) << "AddTokenFromExternalScript: " << origin->ToString() << ", secure = " << origin_info.is_secure; script_origins.push_back(origin_info); @@ -700,6 +700,6 @@ bool OriginTrialContext::IsSecureContext() { } OriginTrialContext::OriginInfo OriginTrialContext::GetCurrentOriginInfo() { - return {.origin = GetSecurityOrigin(), .is_secure = IsSecureContext()}; + return {/*.origin =*/ GetSecurityOrigin(), /*.is_secure =*/ IsSecureContext()}; } } // namespace blink diff --git a/chromium/third_party/blink/renderer/modules/font_access/font_access.cc b/chromium/third_party/blink/renderer/modules/font_access/font_access.cc index 3f520dd3e9a..d72647f4b41 100644 --- a/chromium/third_party/blink/renderer/modules/font_access/font_access.cc +++ b/chromium/third_party/blink/renderer/modules/font_access/font_access.cc @@ -159,12 +159,11 @@ void FontAccess::DidGetEnumerationResponse( selection_utf8.end()) continue; - auto entry = FontEnumerationEntry{ - .postscript_name = String::FromUTF8(element.postscript_name().c_str()), - .full_name = String::FromUTF8(element.full_name().c_str()), - .family = String::FromUTF8(element.family().c_str()), - .style = String::FromUTF8(element.style().c_str()), - }; + FontEnumerationEntry entry = {}; + entry.postscript_name = String::FromUTF8(element.postscript_name().c_str()); + entry.full_name = String::FromUTF8(element.full_name().c_str()); + entry.family = String::FromUTF8(element.family().c_str()); + entry.style = String::FromUTF8(element.style().c_str()); entries.push_back(FontMetadata::Create(std::move(entry))); } diff --git a/chromium/third_party/blink/renderer/modules/indexeddb/idb_object_store.cc b/chromium/third_party/blink/renderer/modules/indexeddb/idb_object_store.cc index 7b052ccc700..032e2c6e9a8 100644 --- a/chromium/third_party/blink/renderer/modules/indexeddb/idb_object_store.cc +++ b/chromium/third_party/blink/renderer/modules/indexeddb/idb_object_store.cc @@ -645,9 +645,9 @@ IDBRequest* IDBObjectStore::DoPut(ScriptState* script_state, if (clone.IsEmpty()) value_wrapper.Clone(script_state, &clone); index_keys.emplace_back(IDBIndexKeys{ - .id = it.key, - .keys = GenerateIndexKeysForValue(script_state->GetIsolate(), - Metadata(), *it.value, clone)}); + it.key, + GenerateIndexKeysForValue(script_state->GetIsolate(), + Metadata(), *it.value, clone)}); } // Records 1KB to 1GB. UMA_HISTOGRAM_COUNTS_1M( @@ -842,10 +842,10 @@ class IndexPopulator final : public NativeEventListener { Vector<IDBIndexKeys> index_keys; index_keys.ReserveInitialCapacity(1); index_keys.emplace_back(IDBIndexKeys{ - .id = IndexMetadata().id, - .keys = GenerateIndexKeysForValue(script_state_->GetIsolate(), - ObjectStoreMetadata(), - IndexMetadata(), value)}); + IndexMetadata().id, + GenerateIndexKeysForValue(script_state_->GetIsolate(), + ObjectStoreMetadata(), + IndexMetadata(), value)}); database_->Backend()->SetIndexKeys(transaction_id_, object_store_id_, IDBKey::Clone(primary_key), diff --git a/chromium/third_party/blink/renderer/modules/mediastream/media_devices.cc b/chromium/third_party/blink/renderer/modules/mediastream/media_devices.cc index b4008feaec1..243c1f1dca1 100644 --- a/chromium/third_party/blink/renderer/modules/mediastream/media_devices.cc +++ b/chromium/third_party/blink/renderer/modules/mediastream/media_devices.cc @@ -237,7 +237,7 @@ ScriptPromise MediaDevices::enumerateDevices(ScriptState* script_state, auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); ScriptPromise promise = resolver->Promise(); enumerate_device_requests_.Set( - resolver, RequestMetadata{.start_time = base::TimeTicks::Now()}); + resolver, RequestMetadata{/*.start_time =*/ base::TimeTicks::Now()}); LocalFrame* frame = LocalDOMWindow::From(script_state)->GetFrame(); GetDispatcherHost(frame).EnumerateDevices( diff --git a/chromium/third_party/blink/renderer/modules/mediastream/transferred_media_stream_track.cc b/chromium/third_party/blink/renderer/modules/mediastream/transferred_media_stream_track.cc index 1f0880785fa..82492435c0f 100644 --- a/chromium/third_party/blink/renderer/modules/mediastream/transferred_media_stream_track.cc +++ b/chromium/third_party/blink/renderer/modules/mediastream/transferred_media_stream_track.cc @@ -54,7 +54,7 @@ TransferredMediaStreamTrack::TransferredMediaStreamTrack( const TransferredValues& data) : transferred_component_( MakeGarbageCollected<TransferredMediaStreamComponent>( - TransferredMediaStreamComponent::TransferredValues{.id = + TransferredMediaStreamComponent::TransferredValues{/*.id =*/ data.id})), execution_context_(execution_context), data_(data) {} diff --git a/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph.cc b/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph.cc index 7423cde9b88..4a649dcdf53 100644 --- a/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph.cc +++ b/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph.cc @@ -77,8 +77,8 @@ bool MLGraph::ValidateAndInitializeResourcesInfo( } // Setup resource info for this output operand. output_resources_info_.insert( - name, ResourceInfo({.type = operand->Type(), - .byte_length = operand->ByteLength()})); + name, ResourceInfo({/*.type =*/ operand->Type(), + /*.byte_length =*/ operand->ByteLength()})); // Mark its dependent operator is visited. visited_operators.insert(operand->Operator()); // Enqueue its dependent operator. @@ -113,8 +113,8 @@ bool MLGraph::ValidateAndInitializeResourcesInfo( // Setup resource info for this input operand. input_resources_info_.insert( operand->Name(), - ResourceInfo({.type = operand->Type(), - .byte_length = operand->ByteLength()})); + ResourceInfo({/*.type =*/ operand->Type(), + /*.byte_length =*/ operand->ByteLength()})); break; case MLOperand::OperandKind::kConstant: // If the operand is a constant operand, there is no check needed. diff --git a/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc b/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc index dca8648a8fa..b2ed7b5b641 100644 --- a/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc +++ b/chromium/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc @@ -167,7 +167,7 @@ absl::optional<PaddingSizes> CalculatePaddingForAutoPad( !checked_padding_end.AssignIfValid(&padding_end)) { return absl::nullopt; } - return PaddingSizes({.begin = padding_begin, .end = padding_end}); + return PaddingSizes({/*.begin =*/ padding_begin, /*.end =*/ padding_end}); } // Calculate the output size for conv2d based on WebNN spec: @@ -353,8 +353,8 @@ absl::optional<FloatSize2D> ValidateAndCalculateConv2dOutputSizes( return absl::nullopt; } - return FloatSize2D({.height = float_output_height.value(), - .width = float_output_width.value()}); + return FloatSize2D({/*.height =*/ float_output_height.value(), + /*.width =*/ float_output_width.value()}); } MLOperand* BuildPool2d(MLGraphBuilder* builder, diff --git a/chromium/third_party/blink/renderer/modules/url_pattern/url_pattern_component.cc b/chromium/third_party/blink/renderer/modules/url_pattern/url_pattern_component.cc index 7cdc60088c2..08be6c1fb21 100644 --- a/chromium/third_party/blink/renderer/modules/url_pattern/url_pattern_component.cc +++ b/chromium/third_party/blink/renderer/modules/url_pattern/url_pattern_component.cc @@ -128,10 +128,11 @@ const liburlpattern::Options GetOptions( // The liburlpattern::Options to use for most component patterns. We // default to strict mode and most components have no concept of a delimiter // or prefix character. Case sensitivity is set via the external options. - Options value = {.delimiter_list = "", - .prefix_list = "", - .sensitive = !external_options.ignoreCase(), - .strict = true}; + Options value = {}; + value.delimiter_list = ""; + value.prefix_list = ""; + value.sensitive = !external_options.ignoreCase(); + value.strict = true; if (type == Component::Type::kHostname) { // Hostname patterns use a "." delimiter controlling how far a named group diff --git a/chromium/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc b/chromium/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc index f9d8f8e2d78..f38465a387d 100644 --- a/chromium/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc +++ b/chromium/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc @@ -40,62 +40,73 @@ // preserve existing behavior (see https://crbug.com/1313604). #define POPULATE_TEX_IMAGE_2D_PARAMS(params) \ params = { \ - .function_id = kTexImage2D, \ - .target = target, \ - .level = level, \ - .internalformat = internalformat, \ - .width = width, \ - .height = height, \ - .depth = 1, \ - .border = border, \ - .format = format, \ - .type = type, \ + /*.function_id =*/ kTexImage2D, \ + /*.target =*/ target, \ + /*.level =*/ level, \ + /*.internalformat =*/ internalformat, \ + /*.xoffset =*/ 0, \ + /*.yoffset =*/ 0, \ + /*.zoffset =*/ 0, \ + /*.width =*/ width, \ + /*.height =*/ height, \ + /*.depth =*/ 1, \ + /*.border =*/ border, \ + /*.format =*/ format, \ + /*.type =*/ type, \ }; \ GetCurrentUnpackState(params) #define POPULATE_TEX_SUB_IMAGE_2D_PARAMS(params) \ params = { \ - .function_id = kTexSubImage2D, \ - .target = target, \ - .level = level, \ - .xoffset = xoffset, \ - .yoffset = yoffset, \ - .width = width, \ - .height = height, \ - .depth = 1, \ - .format = format, \ - .type = type, \ + /*.function_id =*/ kTexSubImage2D, \ + /*.target =*/ target, \ + /*.level =*/ level, \ + /*.internalformat =*/ 0, \ + /*.xoffset =*/ xoffset, \ + /*.yoffset =*/ yoffset, \ + /*.zoffset =*/ 0, \ + /*.width =*/ width, \ + /*.height =*/ height, \ + /*.depth =*/ 1, \ + /*.border =*/ 0, \ + /*.format =*/ format, \ + /*.type =*/ type, \ }; \ GetCurrentUnpackState(params) #define POPULATE_TEX_IMAGE_3D_PARAMS(params) \ params = { \ - .function_id = kTexImage3D, \ - .target = target, \ - .level = level, \ - .internalformat = internalformat, \ - .width = width, \ - .height = height, \ - .depth = depth, \ - .border = border, \ - .format = format, \ - .type = type, \ + /*.function_id =*/ kTexImage3D, \ + /*.target =*/ target, \ + /*.level =*/ level, \ + /*.internalformat =*/ internalformat, \ + /*.xoffset =*/ 0, \ + /*.yoffset =*/ 0, \ + /*.zoffset =*/ 0, \ + /*.width =*/ width, \ + /*.height =*/ height, \ + /*.depth =*/ depth, \ + /*.border =*/ border, \ + /*.format =*/ format, \ + /*.type =*/ type, \ }; \ GetCurrentUnpackState(params) #define POPULATE_TEX_SUB_IMAGE_3D_PARAMS(params) \ params = { \ - .function_id = kTexSubImage3D, \ - .target = target, \ - .level = level, \ - .xoffset = xoffset, \ - .yoffset = yoffset, \ - .zoffset = zoffset, \ - .width = width, \ - .height = height, \ - .depth = depth, \ - .format = format, \ - .type = type, \ + /*.function_id =*/ kTexSubImage3D, \ + /*.target =*/ target, \ + /*.level =*/ level, \ + /*.internalformat =*/ 0, \ + /*.xoffset =*/ xoffset, \ + /*.yoffset =*/ yoffset, \ + /*.zoffset =*/ zoffset, \ + /*.width =*/ width, \ + /*.height =*/ height, \ + /*.depth =*/ depth, \ + /*.border =*/ 0, \ + /*.format =*/ format, \ + /*.type =*/ type, \ }; \ GetCurrentUnpackState(params) diff --git a/chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index 8fbce131d42..81b6d9a09d8 100644 --- a/chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc @@ -139,24 +139,37 @@ // depth (which are not present for all texImage2D functions). #define POPULATE_TEX_IMAGE_2D_PARAMS(params) \ params = { \ - .function_id = kTexImage2D, \ - .target = target, \ - .level = level, \ - .internalformat = internalformat, \ - .format = format, \ - .type = type, \ + /*.function_id =*/ kTexImage2D, \ + /*.target =*/ target, \ + /*.level =*/ level, \ + /*.internalformat =*/ internalformat, \ + /*.xoffset =*/ 0, \ + /*.yoffset =*/ 0, \ + /*.zoffset =*/ 0, \ + /*.width =*/ absl::nullopt, \ + /*.height =*/ absl::nullopt, \ + /*.depth =*/ absl::nullopt, \ + /*.border =*/ 0, \ + /*.format =*/ format, \ + /*.type =*/ type, \ }; \ GetCurrentUnpackState(params) #define POPULATE_TEX_SUB_IMAGE_2D_PARAMS(params) \ params = { \ - .function_id = kTexSubImage2D, \ - .target = target, \ - .level = level, \ - .xoffset = xoffset, \ - .yoffset = yoffset, \ - .format = format, \ - .type = type, \ + /*.function_id =*/ kTexSubImage2D, \ + /*.target =*/ target, \ + /*.level =*/ level, \ + /*.internalformat =*/ 0, \ + /*.xoffset =*/ xoffset, \ + /*.yoffset =*/ yoffset, \ + /*.zoffset =*/ 0, \ + /*.width =*/ absl::nullopt, \ + /*.height =*/ absl::nullopt, \ + /*.depth =*/ absl::nullopt, \ + /*.border =*/ 0, \ + /*.format =*/ format, \ + /*.type =*/ type, \ }; \ GetCurrentUnpackState(params) diff --git a/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc b/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc index 27a42563eab..41f675e881a 100644 --- a/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc +++ b/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc @@ -608,25 +608,24 @@ bool GPUCanvasContext::CopyTextureToResourceProvider( reservation.generation, WGPUTextureUsage_CopyDst | WGPUTextureUsage_RenderAttachment, reinterpret_cast<const GLbyte*>(&dst_mailbox)); - WGPUImageCopyTexture source = { - .nextInChain = nullptr, - .texture = texture, - .mipLevel = 0, - .origin = WGPUOrigin3D{0}, - .aspect = WGPUTextureAspect_All, - }; - WGPUImageCopyTexture destination = { - .nextInChain = nullptr, - .texture = reservation.texture, - .mipLevel = 0, - .origin = WGPUOrigin3D{0}, - .aspect = WGPUTextureAspect_All, - }; - WGPUExtent3D copy_size = { - .width = static_cast<uint32_t>(size.width()), - .height = static_cast<uint32_t>(size.height()), - .depthOrArrayLayers = 1, - }; + WGPUImageCopyTexture source = {}; + source.nextInChain = nullptr; + source.texture = texture; + source.mipLevel = 0; + source.origin = WGPUOrigin3D{0}; + source.aspect = WGPUTextureAspect_All; + + WGPUImageCopyTexture destination = {}; + destination.nextInChain = nullptr; + destination.texture = reservation.texture; + destination.mipLevel = 0; + destination.origin = WGPUOrigin3D{0}; + destination.aspect = WGPUTextureAspect_All; + + WGPUExtent3D copy_size = {}; + copy_size.width = static_cast<uint32_t>(size.width()); + copy_size.height = static_cast<uint32_t>(size.height()); + copy_size.depthOrArrayLayers = 1; if (alpha_mode_ == V8GPUCanvasAlphaMode::Enum::kOpaque) { // Issue a copyTextureForBrowser call with internal usage turned on. @@ -649,12 +648,11 @@ bool GPUCanvasContext::CopyTextureToResourceProvider( dstAlphaMode = WGPUAlphaMode_Opaque; break; } - WGPUCopyTextureForBrowserOptions options = { - .flipY = !resource_provider->IsOriginTopLeft(), - .srcAlphaMode = WGPUAlphaMode_Opaque, - .dstAlphaMode = dstAlphaMode, - .internalUsage = true, - }; + WGPUCopyTextureForBrowserOptions options = {}; + options.flipY = !resource_provider->IsOriginTopLeft(); + options.srcAlphaMode = WGPUAlphaMode_Opaque; + options.dstAlphaMode = dstAlphaMode; + options.internalUsage = true; GetProcs().queueCopyTextureForBrowser(device_->queue()->GetHandle(), &source, &destination, ©_size, @@ -663,13 +661,13 @@ bool GPUCanvasContext::CopyTextureToResourceProvider( } else { // Create a command encoder and call copyTextureToTexture for the image // copy. - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; - WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, - }; + WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {}; + internal_usage_desc.chain.sType = WGPUSType_DawnEncoderInternalUsageDescriptor; + internal_usage_desc.useInternalUsages = true; + + WGPUCommandEncoderDescriptor command_encoder_desc = {}; + command_encoder_desc.nextInChain = &internal_usage_desc.chain; + WGPUCommandEncoder command_encoder = GetProcs().deviceCreateCommandEncoder( device_->GetHandle(), &command_encoder_desc); GetProcs().commandEncoderCopyTextureToTexture(command_encoder, &source, diff --git a/chromium/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc b/chromium/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc index 5ce2b1bfc07..75b26148838 100644 --- a/chromium/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc +++ b/chromium/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc @@ -249,11 +249,11 @@ GPUExternalTexture* GPUExternalTexture::CreateImpl( WGPUTextureUsage::WGPUTextureUsage_TextureBinding, media_video_frame); - WGPUTextureViewDescriptor view_desc = { - .format = WGPUTextureFormat_R8Unorm, - .mipLevelCount = WGPU_MIP_LEVEL_COUNT_UNDEFINED, - .arrayLayerCount = WGPU_ARRAY_LAYER_COUNT_UNDEFINED, - .aspect = WGPUTextureAspect_Plane0Only}; + WGPUTextureViewDescriptor view_desc = {}; + view_desc.format = WGPUTextureFormat_R8Unorm; + view_desc.mipLevelCount = WGPU_MIP_LEVEL_COUNT_UNDEFINED; + view_desc.arrayLayerCount = WGPU_ARRAY_LAYER_COUNT_UNDEFINED; + view_desc.aspect = WGPUTextureAspect_Plane0Only; WGPUTextureView plane0 = device->GetProcs().textureCreateView( mailbox_texture->GetTexture(), &view_desc); view_desc.format = WGPUTextureFormat_RG8Unorm; diff --git a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc index 6ff96b738bc..07c2d324136 100644 --- a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc +++ b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc @@ -890,8 +890,9 @@ void ShapeResult::ApplySpacingImpl( } typename ShapeResultSpacing<TextContainerType>::ComputeSpacingParameters - parameters{.index = run_start_index + glyph_data.character_index, - .original_advance = glyph_data.advance}; + parameters; + parameters.index = run_start_index + glyph_data.character_index; + parameters.original_advance = glyph_data.advance; space = spacing.ComputeSpacing(parameters, offset); glyph_data.advance += space; total_space_for_run += space; diff --git a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h index ffe987b31d3..5bb96727722 100644 --- a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h +++ b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h @@ -66,7 +66,7 @@ class PLATFORM_EXPORT ShapeResultSpacing final { float original_advance = 0.0; }; float ComputeSpacing(unsigned index, float& offset) { - return ComputeSpacing(ComputeSpacingParameters{.index = index}, offset); + return ComputeSpacing(ComputeSpacingParameters{/*.index =*/ index}, offset); } float ComputeSpacing(const ComputeSpacingParameters& parameters, float& offset); diff --git a/chromium/third_party/blink/renderer/platform/geometry/calculation_expression_node.cc b/chromium/third_party/blink/renderer/platform/geometry/calculation_expression_node.cc index d9c593af8d3..1ffc5321ad7 100644 --- a/chromium/third_party/blink/renderer/platform/geometry/calculation_expression_node.cc +++ b/chromium/third_party/blink/renderer/platform/geometry/calculation_expression_node.cc @@ -358,7 +358,7 @@ scoped_refptr<const CalculationExpressionAnchorQueryNode> CalculationExpressionAnchorQueryNode::CreateAnchor(const AtomicString& name, AnchorValue side, const Length& fallback) { - AnchorQueryValue value = {.anchor_side = side}; + AnchorQueryValue value = {/*.anchor_side =*/ side}; return base::MakeRefCounted<CalculationExpressionAnchorQueryNode>( AnchorQueryType::kAnchor, name, value, /* percentage */ 0, fallback); } @@ -369,7 +369,7 @@ CalculationExpressionAnchorQueryNode::CreateAnchorPercentage( const AtomicString& name, float percentage, const Length& fallback) { - AnchorQueryValue value = {.anchor_side = AnchorValue::kPercentage}; + AnchorQueryValue value = {/*.anchor_side =*/ AnchorValue::kPercentage}; return base::MakeRefCounted<CalculationExpressionAnchorQueryNode>( AnchorQueryType::kAnchor, name, value, percentage, fallback); } @@ -379,7 +379,8 @@ scoped_refptr<const CalculationExpressionAnchorQueryNode> CalculationExpressionAnchorQueryNode::CreateAnchorSize(const AtomicString& name, AnchorSizeValue size, const Length& fallback) { - AnchorQueryValue value = {.anchor_size = size}; + AnchorQueryValue value = {}; + value.anchor_size = size; return base::MakeRefCounted<CalculationExpressionAnchorQueryNode>( AnchorQueryType::kAnchorSize, name, value, /* percentage */ 0, fallback); } diff --git a/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_texture_alpha_clearer.cc b/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_texture_alpha_clearer.cc index 1aa69620eb2..6b52e7cf355 100644 --- a/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_texture_alpha_clearer.cc +++ b/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_texture_alpha_clearer.cc @@ -17,9 +17,9 @@ WebGPUTextureAlphaClearer::WebGPUTextureAlphaClearer( procs.deviceReference(device_); - WGPUShaderModuleWGSLDescriptor wgsl_desc = { - .chain = {.sType = WGPUSType_ShaderModuleWGSLDescriptor}, - .source = R"( + WGPUShaderModuleWGSLDescriptor wgsl_desc = {}; + wgsl_desc.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor; + wgsl_desc.source = R"( @vertex fn vert_main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4<f32> { var pos = array<vec2<f32>, 3>( vec2<f32>(-1.0, -1.0), @@ -31,33 +31,30 @@ WebGPUTextureAlphaClearer::WebGPUTextureAlphaClearer( @fragment fn frag_main() -> @location(0) vec4<f32> { return vec4<f32>(1.0); } - )", - }; - WGPUShaderModuleDescriptor shader_module_desc = {.nextInChain = - &wgsl_desc.chain}; + )"; + + WGPUShaderModuleDescriptor shader_module_desc = {}; + shader_module_desc.nextInChain = &wgsl_desc.chain; WGPUShaderModule shader_module = procs.deviceCreateShaderModule(device_, &shader_module_desc); - WGPUColorTargetState color_target = { - .format = format, - .writeMask = WGPUColorWriteMask_Alpha, - }; - WGPUFragmentState fragment = { - .module = shader_module, - .entryPoint = "frag_main", - .targetCount = 1, - .targets = &color_target, - }; - WGPURenderPipelineDescriptor pipeline_desc = { - .vertex = - { - .module = shader_module, - .entryPoint = "vert_main", - }, - .primitive = {.topology = WGPUPrimitiveTopology_TriangleList}, - .multisample = {.count = 1, .mask = 0xFFFFFFFF}, - .fragment = &fragment, - }; + WGPUColorTargetState color_target = {}; + color_target.format = format; + color_target.writeMask = WGPUColorWriteMask_Alpha; + + WGPUFragmentState fragment = {}; + fragment.module = shader_module; + fragment.entryPoint = "frag_main"; + fragment.targetCount = 1; + fragment.targets = &color_target; + + WGPURenderPipelineDescriptor pipeline_desc = {}; + pipeline_desc.vertex.module = shader_module, + pipeline_desc.vertex.entryPoint = "vert_main"; + pipeline_desc.primitive.topology = WGPUPrimitiveTopology_TriangleList; + pipeline_desc.multisample.count = 1; + pipeline_desc.multisample.mask = 0xFFFFFFFF; + pipeline_desc.fragment = &fragment; alpha_to_one_pipeline_ = procs.deviceCreateRenderPipeline(device_, &pipeline_desc); procs.shaderModuleRelease(shader_module); @@ -79,25 +76,25 @@ void WebGPUTextureAlphaClearer::ClearAlpha(WGPUTexture texture) { WGPUTextureView attachment_view = procs.textureCreateView(texture, nullptr); - WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = { - .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor}, - .useInternalUsages = true, - }; - WGPUCommandEncoderDescriptor command_encoder_desc = { - .nextInChain = &internal_usage_desc.chain, - }; + WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {}; + internal_usage_desc.chain.sType = WGPUSType_DawnEncoderInternalUsageDescriptor; + internal_usage_desc.useInternalUsages = true; + + WGPUCommandEncoderDescriptor command_encoder_desc = {}; + command_encoder_desc.nextInChain = &internal_usage_desc.chain; + WGPUCommandEncoder command_encoder = procs.deviceCreateCommandEncoder(device_, &command_encoder_desc); - WGPURenderPassColorAttachment color_attachment = { - .view = attachment_view, - .loadOp = WGPULoadOp_Load, - .storeOp = WGPUStoreOp_Store, - }; - WGPURenderPassDescriptor render_pass_desc = { - .colorAttachmentCount = 1, - .colorAttachments = &color_attachment, - }; + WGPURenderPassColorAttachment color_attachment = {}; + color_attachment.view = attachment_view; + color_attachment.loadOp = WGPULoadOp_Load; + color_attachment.storeOp = WGPUStoreOp_Store; + + WGPURenderPassDescriptor render_pass_desc = {}; + render_pass_desc.colorAttachmentCount = 1; + render_pass_desc.colorAttachments = &color_attachment; + WGPURenderPassEncoder pass = procs.commandEncoderBeginRenderPass(command_encoder, &render_pass_desc); DCHECK(alpha_to_one_pipeline_); diff --git a/chromium/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader.cc b/chromium/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader.cc index 53ebd8e29fa..f9e4baacd95 100644 --- a/chromium/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader.cc +++ b/chromium/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader.cc @@ -248,12 +248,12 @@ class NavigationBodyLoader::OffThreadBodyReader : public BodyReader { // will consume the data, so no need to post another one. post_task = data_chunks_.empty(); data_chunks_.push_back( - DataChunk{.decoded_data = decoded_data, - .has_seen_end_of_data = has_seen_end_of_data_, - .has_error = has_error, - .encoded_data = std::move(encoded_data_copy), - .encoded_data_size = size, - .encoding_data = decoder_->GetEncodingData()}); + DataChunk{/*.decoded_data =*/ decoded_data, + /*.has_seen_end_of_data =*/ has_seen_end_of_data_, + /*.has_error =*/ has_error, + /*.encoded_data =*/ std::move(encoded_data_copy), + /*.encoded_data_size =*/ size, + /*.encoding_data =*/ decoder_->GetEncodingData()}); } if (post_task) { PostCrossThreadTask( diff --git a/chromium/third_party/blink/renderer/platform/media/key_system_config_selector.cc b/chromium/third_party/blink/renderer/platform/media/key_system_config_selector.cc index 05a0a6e40ad..6d3912533b0 100644 --- a/chromium/third_party/blink/renderer/platform/media/key_system_config_selector.cc +++ b/chromium/third_party/blink/renderer/platform/media/key_system_config_selector.cc @@ -77,9 +77,13 @@ EmeConfig::Rule GetDistinctiveIdentifierConfigRule( } if (support == EmeFeatureSupport::NOT_SUPPORTED || requirement == EmeFeatureRequirement::kNotAllowed) { - return EmeConfig{.identifier = EmeConfigRuleState::kNotAllowed}; + EmeConfig tmp = {}; + tmp.identifier = EmeConfigRuleState::kNotAllowed; + return tmp; } - return EmeConfig{.identifier = EmeConfigRuleState::kRequired}; + EmeConfig tmp = {}; + tmp.identifier = EmeConfigRuleState::kRequired; + return tmp; } EmeConfig::Rule GetPersistentStateConfigRule( @@ -121,9 +125,13 @@ EmeConfig::Rule GetPersistentStateConfigRule( } if (support == EmeFeatureSupport::NOT_SUPPORTED || requirement == EmeFeatureRequirement::kNotAllowed) { - return EmeConfig{.persistence = EmeConfigRuleState::kNotAllowed}; + EmeConfig tmp = {}; + tmp.persistence = EmeConfigRuleState::kNotAllowed; + return tmp; } - return EmeConfig{.persistence = EmeConfigRuleState::kRequired}; + EmeConfig tmp = {}; + tmp.persistence = EmeConfigRuleState::kRequired; + return tmp; } bool IsPersistentSessionType(WebEncryptedMediaSessionType sessionType) { @@ -643,8 +651,10 @@ KeySystemConfigSelector::GetSupportedConfiguration( // Identifiers are not allowed according to restrictions, set distinctive // identifier requirement to "not-allowed". + EmeConfig tmp = {}; + tmp.identifier = EmeConfigRuleState::kRequired; EmeConfig::Rule identifier_required = - EmeConfig{.identifier = EmeConfigRuleState::kRequired}; + std::move(tmp); if (distinctive_identifier == EmeFeatureRequirement::kOptional && !config_state->IsRuleSupported(identifier_required)) { distinctive_identifier = EmeFeatureRequirement::kNotAllowed; @@ -696,8 +706,10 @@ KeySystemConfigSelector::GetSupportedConfiguration( // 9. If persistent state requirement is "optional" and persisting state is // not allowed according to restrictions, set persistent state requirement // to "not-allowed". + EmeConfig tmp2 = {}; + tmp2.persistence = EmeConfigRuleState::kRequired; EmeConfig::Rule persistence_required = - EmeConfig{.persistence = EmeConfigRuleState::kRequired}; + std::move(tmp2); if (persistent_state == EmeFeatureRequirement::kOptional && !config_state->IsRuleSupported(persistence_required)) { persistent_state = EmeFeatureRequirement::kNotAllowed; diff --git a/chromium/third_party/ipcz/src/ipcz/atomic_queue_state.cc b/chromium/third_party/ipcz/src/ipcz/atomic_queue_state.cc index d2f2dc94fd1..0435c7fd7a9 100644 --- a/chromium/third_party/ipcz/src/ipcz/atomic_queue_state.cc +++ b/chromium/third_party/ipcz/src/ipcz/atomic_queue_state.cc @@ -16,10 +16,10 @@ AtomicQueueState::AtomicQueueState() noexcept = default; AtomicQueueState::QueryResult AtomicQueueState::Query( const MonitorSelection& monitors) { return { - .num_parcels_consumed = - num_parcels_consumed_.Query({.monitor = monitors.monitor_parcels}), - .num_bytes_consumed = - num_bytes_consumed_.Query({.monitor = monitors.monitor_bytes}), +// .num_parcels_consumed = + num_parcels_consumed_.Query({/*.monitor =*/ monitors.monitor_parcels}), +// .num_bytes_consumed = + num_bytes_consumed_.Query({/*.monitor =*/ monitors.monitor_bytes}), }; } diff --git a/chromium/third_party/ipcz/src/ipcz/block_allocator.cc b/chromium/third_party/ipcz/src/ipcz/block_allocator.cc index a826bd79d3f..4bb71d2e54c 100644 --- a/chromium/third_party/ipcz/src/ipcz/block_allocator.cc +++ b/chromium/third_party/ipcz/src/ipcz/block_allocator.cc @@ -198,7 +198,7 @@ bool BlockAllocator::TryUpdateFrontHeader(BlockHeader& last_known_header, // called within a tight retry loop. return block_header_at(kFrontBlockIndex) .compare_exchange_weak( - last_known_header, {.version = new_version, .next = relative_next}, + last_known_header, {/*.version =*/ new_version, /*.next =*/ relative_next}, std::memory_order_release, std::memory_order_relaxed); } @@ -210,7 +210,7 @@ BlockAllocator::FreeBlock::FreeBlock(int16_t index, AtomicBlockHeader& header) void BlockAllocator::FreeBlock::SetNextFreeBlock(int16_t next_free_block) { const int16_t relative_next = ForBaseIndex(index_).GetRelativeFromAbsoluteIndex(next_free_block); - header_.store({.version = 0, .next = relative_next}, + header_.store({/*.version =*/ 0, /*.next =*/ relative_next}, std::memory_order_release); } diff --git a/chromium/third_party/ipcz/src/ipcz/driver_memory.cc b/chromium/third_party/ipcz/src/ipcz/driver_memory.cc index 6dcf5c4dcc0..5eba40e3908 100644 --- a/chromium/third_party/ipcz/src/ipcz/driver_memory.cc +++ b/chromium/third_party/ipcz/src/ipcz/driver_memory.cc @@ -18,7 +18,7 @@ DriverMemory::DriverMemory() = default; DriverMemory::DriverMemory(DriverObject memory) : memory_(std::move(memory)) { if (memory_.is_valid()) { - IpczSharedMemoryInfo info = {.size = sizeof(info)}; + IpczSharedMemoryInfo info = {/*.size =*/ sizeof(info)}; IpczResult result = memory_.driver()->GetSharedMemoryInfo( memory_.handle(), IPCZ_NO_FLAGS, nullptr, &info); ABSL_ASSERT(result == IPCZ_RESULT_OK); diff --git a/chromium/third_party/ipcz/src/ipcz/message.cc b/chromium/third_party/ipcz/src/ipcz/message.cc index fea6a45fbd5..3f37349a50d 100644 --- a/chromium/third_party/ipcz/src/ipcz/message.cc +++ b/chromium/third_party/ipcz/src/ipcz/message.cc @@ -172,8 +172,8 @@ uint32_t Message::AppendDriverObject(DriverObject object) { internal::DriverObjectArrayData Message::AppendDriverObjects( absl::Span<DriverObject> objects) { const internal::DriverObjectArrayData data = { - .first_object_index = checked_cast<uint32_t>(driver_objects_.size()), - .num_objects = checked_cast<uint32_t>(objects.size()), + /*.first_object_index =*/ checked_cast<uint32_t>(driver_objects_.size()), + /*.num_objects =*/ checked_cast<uint32_t>(objects.size()), }; driver_objects_.reserve(driver_objects_.size() + objects.size()); for (auto& object : objects) { diff --git a/chromium/third_party/ipcz/src/ipcz/monitored_atomic.h b/chromium/third_party/ipcz/src/ipcz/monitored_atomic.h index b8ec5c4f316..f65723cedb4 100644 --- a/chromium/third_party/ipcz/src/ipcz/monitored_atomic.h +++ b/chromium/third_party/ipcz/src/ipcz/monitored_atomic.h @@ -49,7 +49,7 @@ class MonitoredAtomic { std::memory_order_release, std::memory_order_relaxed)) { } - return {.value = Unmonitored(value), .monitored = IsMonitored(value)}; + return {/*.value =*/ Unmonitored(value), /*.monitored =*/ IsMonitored(value)}; } // Stores a new underlying value, resetting the monitor bit if it was set. diff --git a/chromium/third_party/ipcz/src/ipcz/node.cc b/chromium/third_party/ipcz/src/ipcz/node.cc index f2fc29e5454..34c6990b281 100644 --- a/chromium/third_party/ipcz/src/ipcz/node.cc +++ b/chromium/third_party/ipcz/src/ipcz/node.cc @@ -363,8 +363,8 @@ void Node::AcceptIntroduction(NodeLink& from_node_link, auto [connection_it, inserted] = connections_.insert({name, { - .link = new_link, - .broker = WrapRefCounted(&from_node_link), + /*.link =*/ new_link, + /*.broker =*/ WrapRefCounted(&from_node_link), }}); if (!inserted) { // If both nodes race to request an introduction to each other, the diff --git a/chromium/third_party/ipcz/src/ipcz/node_connector.cc b/chromium/third_party/ipcz/src/ipcz/node_connector.cc index 41a64de551d..447c0bb09a7 100644 --- a/chromium/third_party/ipcz/src/ipcz/node_connector.cc +++ b/chromium/third_party/ipcz/src/ipcz/node_connector.cc @@ -77,7 +77,7 @@ class NodeConnectorForBrokerToNonBroker : public NodeConnector { Node::Type::kNormal, connect.params().protocol_version, transport_, NodeLinkMemory::Create(node_, std::move(link_memory_allocation_.mapping))); - AcceptConnection({.link = link}, connect.params().num_initial_portals); + AcceptConnection({/*.link =*/ link}, connect.params().num_initial_portals); return true; } @@ -135,7 +135,7 @@ class NodeConnectorForNonBrokerToBroker : public NodeConnector { node_->SetAllocationDelegate(new_link); } - AcceptConnection({.link = new_link, .broker = new_link}, + AcceptConnection({/*.link =*/ new_link, /*.broker =*/ new_link}, connect.params().num_initial_portals); return true; } @@ -183,7 +183,7 @@ class NodeConnectorForReferrer : public NodeConnector { uint32_t remote_num_initial_portals) { if (link_to_referred_node) { connector->AcceptConnection( - {.link = link_to_referred_node, .broker = broker}, + {/*.link =*/ link_to_referred_node, /*.broker =*/ broker}, remote_num_initial_portals); } else { connector->RejectConnection(); @@ -259,8 +259,8 @@ class NodeConnectorForReferredNonBroker : public NodeConnector { } node_->AddConnection(connect.params().broker_name, { - .link = broker_link, - .broker = broker_link, + /*.link =*/ broker_link, + /*.broker =*/ broker_link, }); const uint32_t referrer_protocol_version = std::min( @@ -271,7 +271,7 @@ class NodeConnectorForReferredNonBroker : public NodeConnector { referrer_protocol_version, std::move(referrer_transport), NodeLinkMemory::Create(node_, referrer_buffer.Map())); - AcceptConnection({.link = referrer_link, .broker = broker_link}, + AcceptConnection({/*.link =*/ referrer_link, /*.broker =*/ broker_link}, connect.params().num_initial_portals); referrer_link->Activate(); return true; @@ -326,7 +326,7 @@ class NodeConnectorForBrokerReferral : public NodeConnector { node_, LinkSide::kA, broker_name_, referred_node_name_, Node::Type::kNormal, protocol_version, transport_, NodeLinkMemory::Create(node_, std::move(link_memory_.mapping))); - AcceptConnection({.link = link_to_referree}, /*num_remote_portals=*/0); + AcceptConnection({/*.link =*/ link_to_referree}, /*num_remote_portals=*/0); // Now we can create a new link to introduce both clients -- the referrer // and the referree -- to each other. @@ -452,7 +452,7 @@ class NodeConnectorForBrokerToBroker : public NodeConnector { node_, this_side, local_name_, remote_name, Node::Type::kBroker, connect.params().protocol_version, transport_, NodeLinkMemory::Create(node_, std::move(primary_buffer_mapping))); - AcceptConnection({.link = link, .broker = link}, + AcceptConnection({/*.link =*/ link, /*.broker =*/ link}, connect.params().num_initial_portals); return true; } diff --git a/chromium/third_party/ipcz/src/ipcz/router.cc b/chromium/third_party/ipcz/src/ipcz/router.cc index ba698426f23..a7cc5c13181 100644 --- a/chromium/third_party/ipcz/src/ipcz/router.cc +++ b/chromium/third_party/ipcz/src/ipcz/router.cc @@ -61,7 +61,7 @@ void CollectParcelsToFlush(ParcelQueue& queue, return; } - ParcelToFlush& parcel = parcels.emplace_back(ParcelToFlush{.link = link}); + ParcelToFlush& parcel = parcels.emplace_back(ParcelToFlush{/*.link =*/ link}); const bool popped = queue.Pop(parcel.parcel); ABSL_ASSERT(popped); } @@ -101,7 +101,7 @@ void Router::QueryStatus(IpczPortalStatus& status) { absl::MutexLock lock(&mutex_); AtomicQueueState::QueryResult result; if (auto* state = GetPeerQueueState()) { - result = state->Query({.monitor_parcels = false, .monitor_bytes = false}); + result = state->Query({/*.monitor_parcels =*/ false, /*.monitor_bytes =*/ false}); } UpdateStatusForPeerQueueState(result); @@ -406,7 +406,7 @@ void Router::SnapshotPeerQueueState(const OperationContext& context) { // Start with a cheaper snapshot, which may be good enough. const AtomicQueueState::QueryResult state = - peer_state->Query({.monitor_parcels = false, .monitor_bytes = false}); + peer_state->Query({/*.monitor_parcels =*/ false, /*.monitor_bytes =*/ false}); UpdateStatusForPeerQueueState(state); traps_.UpdatePortalStatus(context, status_, TrapSet::UpdateReason::kRemoteActivity, dispatcher); @@ -426,8 +426,8 @@ void Router::SnapshotPeerQueueState(const OperationContext& context) { // requested monitoring, and the state isn't currently being monitored. Take // another snapshot, this time flipping any appropriate monitor bits. UpdateStatusForPeerQueueState(peer_state->Query({ - .monitor_parcels = traps_.need_remote_parcels(), - .monitor_bytes = traps_.need_remote_bytes(), + /*.monitor_parcels =*/ traps_.need_remote_parcels(), + /*.monitor_bytes =*/ traps_.need_remote_bytes(), })); traps_.UpdatePortalStatus(context, status_, TrapSet::UpdateReason::kRemoteActivity, dispatcher); @@ -606,7 +606,7 @@ IpczResult Router::Trap(const IpczTrapConditions& conditions, if (need_remote_parcels || need_remote_bytes) { if (AtomicQueueState* peer_state = GetPeerQueueState()) { const AtomicQueueState::QueryResult state = - peer_state->Query({.monitor_parcels = false, .monitor_bytes = false}); + peer_state->Query({/*.monitor_parcels =*/ false, /*.monitor_bytes =*/ false}); UpdateStatusForPeerQueueState(state); // If the status already meets some conditions and would block trap @@ -620,8 +620,8 @@ IpczResult Router::Trap(const IpczTrapConditions& conditions, if (!TrapSet::GetSatisfiedConditions(conditions, status_) && (monitor_parcels || monitor_bytes)) { UpdateStatusForPeerQueueState( - peer_state->Query({.monitor_parcels = need_remote_parcels, - .monitor_bytes = need_remote_bytes})); + peer_state->Query({/*.monitor_parcels =*/ need_remote_parcels, + /*.monitor_bytes =*/ need_remote_bytes})); } } else { status_.num_remote_parcels = @@ -1621,8 +1621,8 @@ bool Router::RefreshLocalQueueState() { } last_queue_update_ = AtomicQueueState::UpdateValue{ - .num_parcels_consumed = num_parcels_consumed, - .num_bytes_consumed = num_bytes_consumed, + /*.num_parcels_consumed =*/ num_parcels_consumed, + /*.num_bytes_consumed =*/ num_bytes_consumed, }; return state->Update(*last_queue_update_); } diff --git a/chromium/third_party/ipcz/src/ipcz/trap_event_dispatcher.cc b/chromium/third_party/ipcz/src/ipcz/trap_event_dispatcher.cc index aa08b95a722..7919985da75 100644 --- a/chromium/third_party/ipcz/src/ipcz/trap_event_dispatcher.cc +++ b/chromium/third_party/ipcz/src/ipcz/trap_event_dispatcher.cc @@ -22,10 +22,10 @@ void TrapEventDispatcher::DeferEvent(IpczTrapEventHandler handler, void TrapEventDispatcher::DispatchAll() { for (const Event& event : events_) { const IpczTrapEvent trap_event = { - .size = sizeof(trap_event), - .context = event.context, - .condition_flags = event.flags, - .status = &event.status, + /*.size =*/ sizeof(trap_event), + /*.context =*/ event.context, + /*.condition_flags =*/ event.flags, + /*.status =*/ &event.status, }; event.handler(&trap_event); } diff --git a/chromium/third_party/ipcz/src/ipcz/trap_set.h b/chromium/third_party/ipcz/src/ipcz/trap_set.h index a772796d416..d16b24fcdf7 100644 --- a/chromium/third_party/ipcz/src/ipcz/trap_set.h +++ b/chromium/third_party/ipcz/src/ipcz/trap_set.h @@ -112,7 +112,7 @@ class TrapSet { TrapList traps_; size_t num_traps_monitoring_remote_parcels_ = 0; size_t num_traps_monitoring_remote_bytes_ = 0; - IpczPortalStatus last_known_status_ = {.size = sizeof(last_known_status_)}; + IpczPortalStatus last_known_status_ = {/*.size =*/ sizeof(last_known_status_)}; }; } // namespace ipcz diff --git a/chromium/third_party/webrtc/api/video/frame_buffer.cc b/chromium/third_party/webrtc/api/video/frame_buffer.cc index 4cdf2212a60..b97bc42c10f 100644 --- a/chromium/third_party/webrtc/api/video/frame_buffer.cc +++ b/chromium/third_party/webrtc/api/video/frame_buffer.cc @@ -262,9 +262,9 @@ void FrameBuffer::FindNextAndLastDecodableTemporalUnit() { if (next_decodable_temporal_unit_) { decodable_temporal_units_info_ = { - .next_rtp_timestamp = +// .next_rtp_timestamp = GetTimestamp(next_decodable_temporal_unit_->first_frame), - .last_rtp_timestamp = last_decodable_temporal_unit_timestamp}; + /*.last_rtp_timestamp =*/ last_decodable_temporal_unit_timestamp}; } } diff --git a/chromium/third_party/webrtc/api/video_codecs/video_encoder_factory_template.h b/chromium/third_party/webrtc/api/video_codecs/video_encoder_factory_template.h index 643096dbbba..a21f5bf41c9 100644 --- a/chromium/third_party/webrtc/api/video_codecs/video_encoder_factory_template.h +++ b/chromium/third_party/webrtc/api/video_codecs/video_encoder_factory_template.h @@ -119,14 +119,14 @@ class VideoEncoderFactoryTemplate : public VideoEncoderFactory { const SdpVideoFormat& format, const absl::optional<std::string>& scalability_mode) const { if (IsFormatInList(format, V::SupportedFormats())) { - return {.is_supported = IsScalabilityModeSupported<V>(scalability_mode)}; + return {/*.is_supported =*/ IsScalabilityModeSupported<V>(scalability_mode)}; } if constexpr (sizeof...(Vs) > 0) { return QueryCodecSupportInternal<Vs...>(format, scalability_mode); } - return {.is_supported = false}; + return {/*.is_supported =*/ false}; } }; diff --git a/chromium/third_party/webrtc/media/base/video_adapter.cc b/chromium/third_party/webrtc/media/base/video_adapter.cc index 149071d1534..c5601c5d069 100644 --- a/chromium/third_party/webrtc/media/base/video_adapter.cc +++ b/chromium/third_party/webrtc/media/base/video_adapter.cc @@ -313,12 +313,12 @@ void VideoAdapter::OnOutputFormatRequest( const absl::optional<int>& max_fps) { webrtc::MutexLock lock(&mutex_); - OutputFormatRequest request = { - .target_landscape_aspect_ratio = target_landscape_aspect_ratio, - .max_landscape_pixel_count = max_landscape_pixel_count, - .target_portrait_aspect_ratio = target_portrait_aspect_ratio, - .max_portrait_pixel_count = max_portrait_pixel_count, - .max_fps = max_fps}; + OutputFormatRequest request = {}; + request.target_landscape_aspect_ratio = target_landscape_aspect_ratio; + request.max_landscape_pixel_count = max_landscape_pixel_count; + request.target_portrait_aspect_ratio = target_portrait_aspect_ratio; + request.max_portrait_pixel_count = max_portrait_pixel_count; + request.max_fps = max_fps; if (stashed_output_format_request_) { // Save the output format request for later use in case the encoder making diff --git a/chromium/third_party/webrtc/media/engine/internal_encoder_factory.cc b/chromium/third_party/webrtc/media/engine/internal_encoder_factory.cc index 4243f52481a..5c29d6c816a 100644 --- a/chromium/third_party/webrtc/media/engine/internal_encoder_factory.cc +++ b/chromium/third_party/webrtc/media/engine/internal_encoder_factory.cc @@ -84,7 +84,7 @@ VideoEncoderFactory::CodecSupport InternalEncoderFactory::QueryCodecSupport( auto original_format = MatchOriginalFormat(format); return original_format ? Factory().QueryCodecSupport(*original_format, scalability_mode) - : VideoEncoderFactory::CodecSupport{.is_supported = false}; + : VideoEncoderFactory::CodecSupport{/*.is_supported =*/ false}; } } // namespace webrtc diff --git a/chromium/third_party/webrtc/modules/pacing/pacing_controller.cc b/chromium/third_party/webrtc/modules/pacing/pacing_controller.cc index a926e325453..8844dbe07e4 100644 --- a/chromium/third_party/webrtc/modules/pacing/pacing_controller.cc +++ b/chromium/third_party/webrtc/modules/pacing/pacing_controller.cc @@ -102,11 +102,11 @@ PacingController::PacingController(Clock* clock, PacingController::~PacingController() = default; void PacingController::CreateProbeCluster(DataRate bitrate, int cluster_id) { - prober_.CreateProbeCluster({.at_time = CurrentTime(), - .target_data_rate = bitrate, - .target_duration = TimeDelta::Millis(15), - .target_probe_count = 5, - .id = cluster_id}); + prober_.CreateProbeCluster({/*.at_time =*/ CurrentTime(), + /*.target_data_rate =*/ bitrate, + /*.target_duration =*/ TimeDelta::Millis(15), + /*.target_probe_count =*/ 5, + /*.id =*/ cluster_id}); } void PacingController::CreateProbeClusters( diff --git a/chromium/third_party/webrtc/modules/pacing/prioritized_packet_queue.cc b/chromium/third_party/webrtc/modules/pacing/prioritized_packet_queue.cc index b3874a2324a..21d50b99918 100644 --- a/chromium/third_party/webrtc/modules/pacing/prioritized_packet_queue.cc +++ b/chromium/third_party/webrtc/modules/pacing/prioritized_packet_queue.cc @@ -118,9 +118,9 @@ void PrioritizedPacketQueue::Push(Timestamp enqueue_time, int prio_level = GetPriorityForType(packet_type); RTC_DCHECK_GE(prio_level, 0); RTC_DCHECK_LT(prio_level, kNumPriorityLevels); - QueuedPacket queued_packed = {.packet = std::move(packet), - .enqueue_time = enqueue_time, - .enqueue_time_iterator = enqueue_time_iterator}; + QueuedPacket queued_packed = {/*.packet =*/ std::move(packet), + /*.enqueue_time =*/ enqueue_time, + /*.enqueue_time_iterator =*/ enqueue_time_iterator}; // In order to figure out how much time a packet has spent in the queue // while not in a paused state, we subtract the total amount of time the // queue has been paused so far, and when the packet is popped we subtract diff --git a/chromium/third_party/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc b/chromium/third_party/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc index b83720d1a8f..1179f2e3b8b 100644 --- a/chromium/third_party/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc +++ b/chromium/third_party/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc @@ -86,9 +86,9 @@ void RemoteEstimatorProxy::IncomingPacket(int64_t arrival_time_ms, RTC_LOG(LS_WARNING) << "Arrival time out of bounds: " << arrival_time_ms; return; } - Packet packet = {.arrival_time = Timestamp::Millis(arrival_time_ms), - .size = DataSize::Bytes(header.headerLength + payload_size), - .ssrc = header.ssrc}; + Packet packet = {/*.arrival_time =*/ Timestamp::Millis(arrival_time_ms), + /*.size =*/ DataSize::Bytes(header.headerLength + payload_size), + /*.ssrc =*/ header.ssrc}; if (header.extension.hasTransportSequenceNumber) { packet.transport_sequence_number = header.extension.transportSequenceNumber; } diff --git a/chromium/third_party/webrtc/modules/rtp_rtcp/source/source_tracker.cc b/chromium/third_party/webrtc/modules/rtp_rtcp/source/source_tracker.cc index 7a5cbac77d9..20b4e71060f 100644 --- a/chromium/third_party/webrtc/modules/rtp_rtcp/source/source_tracker.cc +++ b/chromium/third_party/webrtc/modules/rtp_rtcp/source/source_tracker.cc @@ -72,9 +72,9 @@ std::vector<RtpSource> SourceTracker::GetSources() const { sources.emplace_back( entry.timestamp_ms, key.source, key.source_type, entry.rtp_timestamp, RtpSource::Extensions{ - .audio_level = entry.audio_level, - .absolute_capture_time = entry.absolute_capture_time, - .local_capture_clock_offset = entry.local_capture_clock_offset}); + /*.audio_level =*/ entry.audio_level, + /*.absolute_capture_time =*/ entry.absolute_capture_time, + /*.local_capture_clock_offset =*/ entry.local_capture_clock_offset}); } return sources; diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc index 4c27f4ce221..64b8604be53 100644 --- a/chromium/third_party/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc +++ b/chromium/third_party/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc @@ -1557,9 +1557,9 @@ void LibvpxVp9Encoder::UpdateReferenceBuffers(const vpx_codec_cx_pkt& pkt, vpx_svc_layer_id_t layer_id = {0}; libvpx_->codec_control(encoder_, VP9E_GET_SVC_LAYER_ID, &layer_id); - RefFrameBuffer frame_buf = {.pic_num = pic_num, - .spatial_layer_id = layer_id.spatial_layer_id, - .temporal_layer_id = layer_id.temporal_layer_id}; + RefFrameBuffer frame_buf = {/*.pic_num =*/ pic_num, + /*.spatial_layer_id =*/ layer_id.spatial_layer_id, + /*.temporal_layer_id =*/ layer_id.temporal_layer_id}; if (is_svc_) { vpx_svc_ref_frame_config_t enc_layer_conf = {{0}}; @@ -1915,14 +1915,14 @@ void LibvpxVp9Encoder::UpdatePerformanceFlags() { VideoCodecComplexity::kComplexityLow) { // For low tier devices, always use speed 9. Only disable upper // layer deblocking below QCIF. - params_by_resolution[0] = {.base_layer_speed = 9, - .high_layer_speed = 9, - .deblock_mode = 1, - .allow_denoising = true}; - params_by_resolution[352 * 288] = {.base_layer_speed = 9, - .high_layer_speed = 9, - .deblock_mode = 0, - .allow_denoising = true}; + params_by_resolution[0] = {/*.base_layer_speed =*/ 9, + /*.high_layer_speed =*/ 9, + /*.deblock_mode =*/ 1, + /*.allow_denoising =*/ true}; + params_by_resolution[352 * 288] = {/*.base_layer_speed =*/ 9, + /*.high_layer_speed =*/ 9, + /*.deblock_mode =*/ 0, + /*.allow_denoising =*/ true}; } else { params_by_resolution = performance_flags_.settings_by_resolution; } @@ -2014,27 +2014,27 @@ LibvpxVp9Encoder::GetDefaultPerformanceFlags() { // layer (get some coding gain at the cost of increased encoding complexity). // Set encoder Speed 5 for TL0, encoder Speed 8 for upper temporal layers, and // disable deblocking for upper-most temporal layers. - flags.settings_by_resolution[0] = {.base_layer_speed = 5, - .high_layer_speed = 8, - .deblock_mode = 1, - .allow_denoising = true}; + flags.settings_by_resolution[0] = {/*.base_layer_speed =*/ 5, + /*.high_layer_speed =*/ 8, + /*.deblock_mode =*/ 1, + /*.allow_denoising =*/ true}; // Use speed 7 for QCIF and above. // Set encoder Speed 7 for TL0, encoder Speed 8 for upper temporal layers, and // enable deblocking for all temporal layers. - flags.settings_by_resolution[352 * 288] = {.base_layer_speed = 7, - .high_layer_speed = 8, - .deblock_mode = 0, - .allow_denoising = true}; + flags.settings_by_resolution[352 * 288] = {/*.base_layer_speed =*/ 7, + /*.high_layer_speed =*/ 8, + /*.deblock_mode =*/ 0, + /*.allow_denoising =*/ true}; // For very high resolution (1080p and up), turn the speed all the way up // since this is very CPU intensive. Also disable denoising to save CPU, at // these resolutions denoising appear less effective and hopefully you also // have a less noisy video source at this point. - flags.settings_by_resolution[1920 * 1080] = {.base_layer_speed = 9, - .high_layer_speed = 9, - .deblock_mode = 0, - .allow_denoising = false}; + flags.settings_by_resolution[1920 * 1080] = {/*.base_layer_speed =*/ 9, + /*.high_layer_speed =*/ 9, + /*.deblock_mode =*/ 0, + /*.allow_denoising =*/ false}; #endif return flags; diff --git a/chromium/third_party/webrtc/modules/video_coding/rtp_vp8_ref_finder.cc b/chromium/third_party/webrtc/modules/video_coding/rtp_vp8_ref_finder.cc index 185756ce51c..a3d4cb0bbd5 100644 --- a/chromium/third_party/webrtc/modules/video_coding/rtp_vp8_ref_finder.cc +++ b/chromium/third_party/webrtc/modules/video_coding/rtp_vp8_ref_finder.cc @@ -35,7 +35,7 @@ RtpFrameReferenceFinder::ReturnVector RtpVp8RefFinder::ManageFrame( stashed_frames_.pop_back(); } stashed_frames_.push_front( - {.unwrapped_tl0 = unwrapped_tl0, .frame = std::move(frame)}); + {/*.unwrapped_tl0 =*/ unwrapped_tl0, /*.frame =*/ std::move(frame)}); return res; case kHandOff: res.push_back(std::move(frame)); diff --git a/chromium/third_party/webrtc/modules/video_coding/rtp_vp9_ref_finder.cc b/chromium/third_party/webrtc/modules/video_coding/rtp_vp9_ref_finder.cc index 175ed3464b6..ff196f72c0b 100644 --- a/chromium/third_party/webrtc/modules/video_coding/rtp_vp9_ref_finder.cc +++ b/chromium/third_party/webrtc/modules/video_coding/rtp_vp9_ref_finder.cc @@ -48,7 +48,7 @@ RtpFrameReferenceFinder::ReturnVector RtpVp9RefFinder::ManageFrame( } stashed_frames_.push_front( - {.unwrapped_tl0 = unwrapped_tl0, .frame = std::move(frame)}); + {/*.unwrapped_tl0 =*/ unwrapped_tl0, /*.frame =*/ std::move(frame)}); } } } diff --git a/chromium/third_party/webrtc/modules/video_coding/timing/timing.cc b/chromium/third_party/webrtc/modules/video_coding/timing/timing.cc index 0b61d5a35e9..e5bfe997e3a 100644 --- a/chromium/third_party/webrtc/modules/video_coding/timing/timing.cc +++ b/chromium/third_party/webrtc/modules/video_coding/timing/timing.cc @@ -253,8 +253,8 @@ TimeDelta VCMTiming::TargetDelayInternal() const { VideoFrame::RenderParameters VCMTiming::RenderParameters() const { MutexLock lock(&mutex_); - return {.use_low_latency_rendering = UseLowLatencyRendering(), - .max_composition_delay_in_frames = max_composition_delay_in_frames_}; + return {/*.use_low_latency_rendering =*/ UseLowLatencyRendering(), + /*.max_composition_delay_in_frames =*/ max_composition_delay_in_frames_}; } bool VCMTiming::UseLowLatencyRendering() const { @@ -268,14 +268,14 @@ bool VCMTiming::UseLowLatencyRendering() const { VCMTiming::VideoDelayTimings VCMTiming::GetTimings() const { MutexLock lock(&mutex_); - return VideoDelayTimings{.max_decode_duration = RequiredDecodeTime(), - .current_delay = current_delay_, - .target_delay = TargetDelayInternal(), - .jitter_buffer_delay = jitter_delay_, - .min_playout_delay = min_playout_delay_, - .max_playout_delay = max_playout_delay_, - .render_delay = render_delay_, - .num_decoded_frames = num_decoded_frames_}; + return VideoDelayTimings{/*.max_decode_duration =*/ RequiredDecodeTime(), + /*.current_delay =*/ current_delay_, + /*.target_delay =*/ TargetDelayInternal(), + /*.jitter_buffer_delay =*/ jitter_delay_, + /*.min_playout_delay =*/ min_playout_delay_, + /*.max_playout_delay =*/ max_playout_delay_, + /*.render_delay =*/ render_delay_, + /*.num_decoded_frames =*/ num_decoded_frames_}; } void VCMTiming::SetTimingFrameInfo(const TimingFrameInfo& info) { diff --git a/chromium/third_party/webrtc/net/dcsctp/tx/rr_send_queue.cc b/chromium/third_party/webrtc/net/dcsctp/tx/rr_send_queue.cc index b1812f0f8a3..c6c1aed5eba 100644 --- a/chromium/third_party/webrtc/net/dcsctp/tx/rr_send_queue.cc +++ b/chromium/third_party/webrtc/net/dcsctp/tx/rr_send_queue.cc @@ -358,15 +358,15 @@ void RRSendQueue::Add(TimeMs now, // message's lifetime, as the message is alive during its entire lifetime // (which may be zero). MessageAttributes attributes = { - .unordered = send_options.unordered, - .max_retransmissions = + /*.unordered =*/ send_options.unordered, +// .max_retransmissions = send_options.max_retransmissions.has_value() ? MaxRetransmits(send_options.max_retransmissions.value()) : MaxRetransmits::NoLimit(), - .expires_at = send_options.lifetime.has_value() + /*.expires_at =*/ send_options.lifetime.has_value() ? now + *send_options.lifetime + DurationMs(1) : TimeMs::InfiniteFuture(), - .lifecycle_id = send_options.lifecycle_id, + /*.lifecycle_id =*/ send_options.lifecycle_id, }; GetOrCreateStreamInfo(message.stream_id()) .Add(std::move(message), std::move(attributes)); diff --git a/chromium/third_party/webrtc/p2p/base/basic_ice_controller.cc b/chromium/third_party/webrtc/p2p/base/basic_ice_controller.cc index 55f187cb9af..8c541adab1c 100644 --- a/chromium/third_party/webrtc/p2p/base/basic_ice_controller.cc +++ b/chromium/third_party/webrtc/p2p/base/basic_ice_controller.cc @@ -464,8 +464,8 @@ BasicIceController::HandleInitialSelectDampening( } RTC_LOG(LS_INFO) << "delay initial selection up to " << min_delay << "ms"; - return {.connection = absl::nullopt, - .recheck_event = IceRecheckEvent( + return {/*.connection =*/ absl::nullopt, + /*.recheck_event =*/ IceRecheckEvent( IceSwitchReason::ICE_CONTROLLER_RECHECK, min_delay)}; } diff --git a/chromium/third_party/webrtc/p2p/base/p2p_transport_channel.cc b/chromium/third_party/webrtc/p2p/base/p2p_transport_channel.cc index c255e2402b0..952fbb0d726 100644 --- a/chromium/third_party/webrtc/p2p/base/p2p_transport_channel.cc +++ b/chromium/third_party/webrtc/p2p/base/p2p_transport_channel.cc @@ -1907,16 +1907,16 @@ rtc::NetworkRoute P2PTransportChannel::ConfigureNetworkRoute( const Connection* conn) { RTC_DCHECK_RUN_ON(network_thread_); return { - .connected = ReadyToSend(conn), - .local = CreateRouteEndpointFromCandidate( + /*.connected =*/ ReadyToSend(conn), + /*.local =*/ CreateRouteEndpointFromCandidate( /* local= */ true, conn->local_candidate(), /* uses_turn= */ conn->port()->Type() == RELAY_PORT_TYPE), - .remote = CreateRouteEndpointFromCandidate( + /*.remote =*/ CreateRouteEndpointFromCandidate( /* local= */ false, conn->remote_candidate(), /* uses_turn= */ conn->remote_candidate().type() == RELAY_PORT_TYPE), - .last_sent_packet_id = last_sent_packet_id_, - .packet_overhead = + /*.last_sent_packet_id =*/ last_sent_packet_id_, +// .packet_overhead = conn->local_candidate().address().ipaddr().overhead() + GetProtocolOverhead(conn->local_candidate().protocol())}; } diff --git a/chromium/third_party/webrtc/rtc_base/thread.cc b/chromium/third_party/webrtc/rtc_base/thread.cc index 18a79bc5188..f500e69d096 100644 --- a/chromium/third_party/webrtc/rtc_base/thread.cc +++ b/chromium/third_party/webrtc/rtc_base/thread.cc @@ -513,10 +513,10 @@ void Thread::PostDelayedHighPrecisionTask(absl::AnyInvocable<void() &&> task, int64_t run_time_ms = TimeAfter(delay_ms); { MutexLock lock(&mutex_); - delayed_messages_.push({.delay_ms = delay_ms, - .run_time_ms = run_time_ms, - .message_number = delayed_next_num_, - .functor = std::move(task)}); + delayed_messages_.push({/*.delay_ms =*/ delay_ms, + /*.run_time_ms =*/ run_time_ms, + /*.message_number =*/ delayed_next_num_, + /*.functor =*/ std::move(task)}); // If this message queue processes 1 message every millisecond for 50 days, // we will wrap this number. Even then, only messages with identical times // will be misordered, and then only briefly. This is probably ok. diff --git a/chromium/third_party/webrtc/system_wrappers/source/rtp_to_ntp_estimator.cc b/chromium/third_party/webrtc/system_wrappers/source/rtp_to_ntp_estimator.cc index ef5d9a7508b..b41633a495a 100644 --- a/chromium/third_party/webrtc/system_wrappers/source/rtp_to_ntp_estimator.cc +++ b/chromium/third_party/webrtc/system_wrappers/source/rtp_to_ntp_estimator.cc @@ -69,7 +69,7 @@ void RtpToNtpEstimator::UpdateParameters() { double k = covariance_xy / variance_x; double b = avg_y - k * avg_x; - params_ = {{.slope = k, .offset = b}}; + params_ = {{/*.slope =*/ k, /*.offset =*/ b}}; } RtpToNtpEstimator::UpdateResult RtpToNtpEstimator::UpdateMeasurements( @@ -78,7 +78,7 @@ RtpToNtpEstimator::UpdateResult RtpToNtpEstimator::UpdateMeasurements( int64_t unwrapped_rtp_timestamp = unwrapper_.Unwrap(rtp_timestamp); RtcpMeasurement new_measurement = { - .ntp_time = ntp, .unwrapped_rtp_timestamp = unwrapped_rtp_timestamp}; + /*.ntp_time =*/ ntp, /*.unwrapped_rtp_timestamp =*/ unwrapped_rtp_timestamp}; for (const RtcpMeasurement& measurement : measurements_) { // Use || since two equal timestamps will result in zero frequency. diff --git a/chromium/third_party/webrtc/video/config/encoder_stream_factory.cc b/chromium/third_party/webrtc/video/config/encoder_stream_factory.cc index fceadf09b4e..747049a7466 100644 --- a/chromium/third_party/webrtc/video/config/encoder_stream_factory.cc +++ b/chromium/third_party/webrtc/video/config/encoder_stream_factory.cc @@ -459,7 +459,7 @@ EncoderStreamFactory::GetLayerResolutionFromRequestedResolution( &out_height)) { RTC_LOG(LS_ERROR) << "AdaptFrameResolution returned false!"; } - return {.width = out_width, .height = out_height}; + return {/*.width =*/ out_width, /*.height =*/ out_height}; } } // namespace cricket diff --git a/chromium/third_party/webrtc/video/frame_decode_timing.cc b/chromium/third_party/webrtc/video/frame_decode_timing.cc index 58ecd41c9e2..fa09ee3fc47 100644 --- a/chromium/third_party/webrtc/video/frame_decode_timing.cc +++ b/chromium/third_party/webrtc/video/frame_decode_timing.cc @@ -53,8 +53,8 @@ FrameDecodeTiming::OnFrameBufferUpdated(uint32_t next_temporal_unit_rtp, << " with a max wait of " << max_wait_for_frame << " clamped to " << max_wait; Timestamp latest_decode_time = now + max_wait; - return FrameSchedule{.latest_decode_time = latest_decode_time, - .render_time = render_time}; + return FrameSchedule{/*.latest_decode_time =*/ latest_decode_time, + /*.render_time =*/ render_time}; } } // namespace webrtc diff --git a/chromium/third_party/webrtc/video/video_receive_stream2.cc b/chromium/third_party/webrtc/video/video_receive_stream2.cc index 1ad51ad6120..52f660291d6 100644 --- a/chromium/third_party/webrtc/video/video_receive_stream2.cc +++ b/chromium/third_party/webrtc/video/video_receive_stream2.cc @@ -918,9 +918,9 @@ VideoReceiveStream2::HandleEncodedFrameOnDecodeQueue( } return DecodeFrameResult{ - .force_request_key_frame = force_request_key_frame, - .decoded_frame_picture_id = std::move(decoded_frame_picture_id), - .keyframe_required = keyframe_required, + /*.force_request_key_frame =*/ force_request_key_frame, + /*.decoded_frame_picture_id =*/ std::move(decoded_frame_picture_id), + /*.keyframe_required =*/ keyframe_required, }; } diff --git a/chromium/third_party/webrtc/video/video_stream_buffer_controller.cc b/chromium/third_party/webrtc/video/video_stream_buffer_controller.cc index 046ff69cae3..afa2d76b38c 100644 --- a/chromium/third_party/webrtc/video/video_stream_buffer_controller.cc +++ b/chromium/third_party/webrtc/video/video_stream_buffer_controller.cc @@ -98,8 +98,8 @@ VideoStreamBufferController::VideoStreamBufferController( clock_, worker_queue, VideoReceiveStreamTimeoutTracker::Timeouts{ - .max_wait_for_keyframe = max_wait_for_keyframe, - .max_wait_for_frame = max_wait_for_frame}, + /*.max_wait_for_keyframe =*/ max_wait_for_keyframe, + /*.max_wait_for_frame =*/ max_wait_for_frame}, absl::bind_front(&VideoStreamBufferController::OnTimeout, this)), zero_playout_delay_max_decode_queue_size_( "max_decode_queue_size", @@ -167,8 +167,8 @@ void VideoStreamBufferController::UpdateRtt(int64_t max_rtt_ms) { void VideoStreamBufferController::SetMaxWaits(TimeDelta max_wait_for_keyframe, TimeDelta max_wait_for_frame) { RTC_DCHECK_RUN_ON(&worker_sequence_checker_); - timeout_tracker_.SetTimeouts({.max_wait_for_keyframe = max_wait_for_keyframe, - .max_wait_for_frame = max_wait_for_frame}); + timeout_tracker_.SetTimeouts({/*.max_wait_for_keyframe =*/ max_wait_for_keyframe, + /*.max_wait_for_frame =*/ max_wait_for_frame}); } void VideoStreamBufferController::StartNextDecode(bool keyframe_required) { diff --git a/chromium/third_party/zlib/google/zip.cc b/chromium/third_party/zlib/google/zip.cc index e1dcd3889ab..64b99e1f8c7 100644 --- a/chromium/third_party/zlib/google/zip.cc +++ b/chromium/third_party/zlib/google/zip.cc @@ -247,17 +247,21 @@ bool ZipWithFilterCallback(const base::FilePath& src_dir, const base::FilePath& dest_file, FilterCallback filter) { DCHECK(base::DirectoryExists(src_dir)); - return Zip({.src_dir = src_dir, - .dest_file = dest_file, - .filter_callback = std::move(filter)}); + ZipParams params; + params.src_dir = src_dir; + params.dest_file = dest_file; + params.filter_callback = std::move(filter); + return Zip(std::move(params)); } bool Zip(const base::FilePath& src_dir, const base::FilePath& dest_file, bool include_hidden_files) { - return Zip({.src_dir = src_dir, - .dest_file = dest_file, - .include_hidden_files = include_hidden_files}); + ZipParams params; + params.src_dir = src_dir; + params.dest_file = dest_file; + params.include_hidden_files = include_hidden_files; + return Zip(params); } #if defined(OS_POSIX) || defined(OS_FUCHSIA) @@ -265,9 +269,11 @@ bool ZipFiles(const base::FilePath& src_dir, Paths src_relative_paths, int dest_fd) { DCHECK(base::DirectoryExists(src_dir)); - return Zip({.src_dir = src_dir, - .dest_fd = dest_fd, - .src_files = src_relative_paths}); + ZipParams params; + params.src_dir = src_dir; + params.dest_fd = dest_fd; + params.src_files = src_relative_paths; + return Zip(params); } #endif // defined(OS_POSIX) || defined(OS_FUCHSIA) diff --git a/chromium/ui/gfx/paint_throbber.cc b/chromium/ui/gfx/paint_throbber.cc index a59f8f6b8d5..61d21a2287e 100644 --- a/chromium/ui/gfx/paint_throbber.cc +++ b/chromium/ui/gfx/paint_throbber.cc @@ -116,8 +116,8 @@ ThrobberSpinningState CalculateThrobberSpinningStateWithStartAngle( const int64_t rot_keyframe = (sweep_frame / 2) % 4; start_angle = start_angle + rot_keyframe * kMaxArcSize; return ThrobberSpinningState{ - .start_angle = static_cast<SkScalar>(start_angle), - .sweep_angle = static_cast<SkScalar>(sweep)}; + /*.start_angle =*/ static_cast<SkScalar>(start_angle), + /*.sweep_angle =*/ static_cast<SkScalar>(sweep)}; } void PaintThrobberSpinningWithState(Canvas* canvas, |