Commit d60db6a1 authored by cfredric's avatar cfredric Committed by Chromium LUCI CQ

Add braces to if statement in registration.cc

This makes no behavior change, since the if statement should only be
inserted if the `RegisterPnaclComponent` call has also been inserted.
However, it makes it clearer that there is no bug related to the missing
bracket and an unintentionally un-inserted statement. I.e., a bug of the
form:

if (condition)
# if SOME_FLAG
  conditional_stmt();
# endif

unconditional_stmt();

Note that in the above snippet, if SOME_FLAG is false, then
`unconditional_stmt` will unintentionally become conditional.

Again, the current code does not exhibit this bug, but at a quick
glance, that is not obvious.

Change-Id: Ibb41d390ae5be698421266ad494ea03dcb95532f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617462Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841545}
parent c56b8c98
...@@ -105,9 +105,12 @@ void RegisterComponentsForUpdate(bool is_off_the_record_profile, ...@@ -105,9 +105,12 @@ void RegisterComponentsForUpdate(bool is_off_the_record_profile,
// PNaCl on Chrome OS is on rootfs and there is no need to download it. But // PNaCl on Chrome OS is on rootfs and there is no need to download it. But
// Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component // Chrome4ChromeOS on Linux doesn't contain PNaCl so enable component
// installer when running on Linux. See crbug.com/422121 for more details. // installer when running on Linux. See crbug.com/422121 for more details.
if (!base::SysInfo::IsRunningOnChromeOS()) if (!base::SysInfo::IsRunningOnChromeOS()) {
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
RegisterPnaclComponent(cus); RegisterPnaclComponent(cus);
#if BUILDFLAG(IS_CHROMEOS_ASH)
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(ENABLE_NACL) && !defined(OS_ANDROID) #endif // BUILDFLAG(ENABLE_NACL) && !defined(OS_ANDROID)
RegisterSubresourceFilterComponent(cus); RegisterSubresourceFilterComponent(cus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment