Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeHealth] Apply modernize-concat-nested-namespaces #26498

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions chromium_src/base/test/scoped_feature_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "src/base/test/scoped_feature_list.cc"

namespace base {
namespace test {
namespace base::test {

void ScopedFeatureList::InitWithFeaturesAndDisable(
const FeatureRef& feature_to_disable,
Expand All @@ -19,5 +18,4 @@ void ScopedFeatureList::InitWithFeaturesAndDisable(
InitWithFeatures(enabled_features, all_disabled_features);
}

} // namespace test
} // namespace base
} // namespace base::test
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "src/base/trace_event/memory_infra_background_allowlist.cc"
#undef IsMemoryAllocatorDumpNameInAllowlist

namespace base {
namespace trace_event {
namespace base::trace_event {

bool IsMemoryAllocatorDumpNameInAllowlist(const std::string& name) {
if (name.starts_with(
Expand All @@ -21,5 +20,4 @@ bool IsMemoryAllocatorDumpNameInAllowlist(const std::string& name) {
return IsMemoryAllocatorDumpNameInAllowlist_ChromiumImpl(name);
}

} // namespace trace_event
} // namespace base
} // namespace base::trace_event
8 changes: 2 additions & 6 deletions chromium_src/chrome/browser/companion/core/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

#include "base/feature_override.h"

namespace companion {
namespace features {
namespace internal {
namespace companion::features::internal {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kCompanionEnabledByObservingExpsNavigations,
Expand All @@ -18,6 +16,4 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
{kSidePanelCompanion2, base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace internal
} // namespace features
} // namespace companion
} // namespace companion::features::internal
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@

#include "base/feature_override.h"

namespace autofill {
namespace features {
namespace autofill::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{test::kAutofillServerCommunication, base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace autofill
} // namespace autofill::features
6 changes: 2 additions & 4 deletions chromium_src/components/browsing_data/core/pref_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#include "src/components/browsing_data/core/pref_names.cc"
#undef RegisterBrowserUserPrefs

namespace browsing_data {
namespace prefs {
namespace browsing_data::prefs {

void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
RegisterBrowserUserPrefs_ChromiumImpl(registry);
Expand All @@ -27,5 +26,4 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(kDeleteBraveLeoHistoryOnExit, false);
}

} // namespace prefs
} // namespace browsing_data
} // namespace browsing_data::prefs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

#include "base/feature_override.h"

namespace history_clusters {
namespace features {
namespace history_clusters::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kOnDeviceClustering, base::FEATURE_DISABLED_BY_DEFAULT},
{kOnDeviceClusteringKeywordFiltering, base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace history_clusters
} // namespace history_clusters::features
6 changes: 2 additions & 4 deletions chromium_src/components/lens/lens_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

#include "base/feature_override.h"

namespace lens {
namespace features {
namespace lens::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kLensOverlay, base::FEATURE_DISABLED_BY_DEFAULT},
{kLensStandalone, base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace lens
} // namespace lens::features
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "base/feature_override.h"

namespace optimization_guide {
namespace features {
namespace optimization_guide::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kOptimizationGuideFetchingForSRP, base::FEATURE_DISABLED_BY_DEFAULT},
Expand All @@ -19,5 +18,4 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace optimization_guide
} // namespace optimization_guide::features
6 changes: 2 additions & 4 deletions chromium_src/components/permissions/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "base/feature_override.h"

namespace permissions {
namespace features {
namespace permissions::features {

// Enables the option of an automatic permission expiration time.
BASE_FEATURE(kPermissionLifetime,
Expand All @@ -25,5 +24,4 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{
base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace permissions
} // namespace permissions::features
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
#include "src/components/send_tab_to_self/entry_point_display_reason.cc"
#undef GetEntryPointDisplayReason

namespace send_tab_to_self {

namespace internal {
namespace send_tab_to_self::internal {

std::optional<EntryPointDisplayReason> GetEntryPointDisplayReason(
const GURL& url_to_share,
Expand All @@ -39,6 +37,4 @@ std::optional<EntryPointDisplayReason> GetEntryPointDisplayReason(
return reason;
}

} // namespace internal

} // namespace send_tab_to_self
} // namespace send_tab_to_self::internal
8 changes: 2 additions & 6 deletions chromium_src/components/sync/service/sync_internals_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
#include "src/components/sync/service/sync_internals_util.cc"
#undef ConstructAboutInformation

namespace syncer {

namespace sync_ui_util {
namespace syncer::sync_ui_util {

base::Value::Dict ConstructAboutInformation(
IncludeSensitiveData include_sensitive_data,
Expand Down Expand Up @@ -60,6 +58,4 @@ base::Value::Dict ConstructAboutInformation(
return about_info;
}

} // namespace sync_ui_util

} // namespace syncer
} // namespace syncer::sync_ui_util
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace test {
namespace base::test {
namespace {

// This trick substitutes TaskEnvironment to make the test
Expand All @@ -31,8 +30,7 @@ class TaskEnvironmentOptionalMockTime : public TaskEnvironment {
};

} // namespace
} // namespace test
} // namespace base
} // namespace base::test

#define TaskEnvironment TaskEnvironmentOptionalMockTime
#define ShouldReuploadOnceAfterLocalDeviceInfoTombstone \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
#include "components/grit/brave_components_resources.h"
#include "ui/base/resource/resource_bundle.h"

namespace translate {
namespace google_apis {
namespace translate::google_apis {
std::string GetAPIKey() {
return BUILDFLAG(BRAVE_SERVICES_KEY);
}
} // namespace google_apis
} // namespace translate
} // namespace translate::google_apis

#define TranslateScript ChromiumTranslateScript
#include "src/components/translate/core/browser/translate_script.cc"
Expand Down
6 changes: 2 additions & 4 deletions chromium_src/components/webapps/browser/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
#include "base/feature_override.h"
#include "build/build_config.h"

namespace webapps {
namespace features {
namespace webapps::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kWebAppsEnableMLModelForPromotion, base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace webapps
} // namespace webapps::features
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@

#include "content/browser/web_package/signed_exchange_utils.h"

namespace content {
namespace signed_exchange_utils {
namespace content::signed_exchange_utils {

bool IsSignedExchangeReportingForDistributorsEnabled() {
return false;
}

} // namespace signed_exchange_utils
} // namespace content
} // namespace content::signed_exchange_utils

#define IsSignedExchangeReportingForDistributorsEnabled \
IsSignedExchangeReportingForDistributorsEnabled_Chromium
Expand Down
6 changes: 2 additions & 4 deletions chromium_src/net/base/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
#include "base/feature_override.h"
#include "brave/net/dns/secure_dns_endpoints.h"

namespace net {
namespace features {
namespace net::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kEnableWebTransportDraft07, base::FEATURE_DISABLED_BY_DEFAULT},
Expand Down Expand Up @@ -84,5 +83,4 @@ const base::FeatureParam<bool> kBraveForgetFirstPartyStorageByDefault = {
&kBraveForgetFirstPartyStorage, "BraveForgetFirstPartyStorageByDefault",
false};

} // namespace features
} // namespace net
} // namespace net::features
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,7 @@ constexpr std::string_view kBraveHstsJson = R"brave_hsts_json({
]})brave_hsts_json";
} // namespace

namespace net {

namespace transport_security_state {
namespace net::transport_security_state {

bool ParseCertificatesFile(std::string_view certs_input,
Pinsets* pinsets,
Expand Down Expand Up @@ -898,6 +896,4 @@ bool ParseJSON(std::string_view hsts_json,
pinsets);
}

} // namespace transport_security_state

} // namespace net
} // namespace net::transport_security_state
6 changes: 2 additions & 4 deletions chromium_src/services/network/public/cpp/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

#include "base/feature_override.h"

namespace network {
namespace features {
namespace network::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
{kFledgePst, base::FEATURE_DISABLED_BY_DEFAULT},
{kPrivateStateTokens, base::FEATURE_DISABLED_BY_DEFAULT},
}});

} // namespace features
} // namespace network
} // namespace network::features
6 changes: 2 additions & 4 deletions chromium_src/third_party/blink/common/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "base/feature_override.h"

namespace blink {
namespace features {
namespace blink::features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
// Upgrade all mixed content
Expand Down Expand Up @@ -106,5 +105,4 @@ bool IsPrerender2Enabled() {
return false;
}

} // namespace features
} // namespace blink
} // namespace blink::features
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@

#include "base/containers/contains.h"

namespace blink {
namespace origin_trials {
namespace blink::origin_trials {
bool IsTrialValid_ChromiumImpl(std::string_view trial_name);
} // namespace origin_trials
} // namespace blink
} // namespace blink::origin_trials

#define IsTrialValid IsTrialValid_ChromiumImpl
#include "../gen/third_party/blink/common/origin_trials/origin_trials.cc"
#undef IsTrialValid

namespace blink {
namespace origin_trials {
namespace blink::origin_trials {

bool IsTrialDisabledInBrave(std::string_view trial_name) {
// When updating also update the array in the overload below.
Expand Down Expand Up @@ -67,5 +64,4 @@ bool IsTrialValid(std::string_view trial_name) {
return IsTrialValid_ChromiumImpl(trial_name);
}

} // namespace origin_trials
} // namespace blink
} // namespace blink::origin_trials
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

#undef WebPreferences

namespace blink {

namespace web_pref {
namespace blink::web_pref {

WebPreferences::WebPreferences(const WebPreferences& other) = default;
WebPreferences::WebPreferences(WebPreferences&& other) = default;
Expand All @@ -23,6 +21,4 @@ WebPreferences& WebPreferences::operator=(const WebPreferences& other) =
default;
WebPreferences& WebPreferences::operator=(WebPreferences&& other) = default;

} // namespace web_pref

} // namespace blink
} // namespace blink::web_pref
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "third_party/blink/renderer/core/loader/frame_loader.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"

namespace blink {
namespace probe {
namespace blink::probe {

void ApplyBraveHardwareConcurrencyOverride(blink::ExecutionContext* context,
unsigned int* hardware_concurrency) {
Expand Down Expand Up @@ -53,8 +52,7 @@ void ApplyBraveHardwareConcurrencyOverride(blink::ExecutionContext* context,
*hardware_concurrency = farbled_value;
}

} // namespace probe
} // namespace blink
} // namespace blink::probe

#define userAgent userAgent_ChromiumImpl
#define ApplyHardwareConcurrencyOverride \
Expand Down
Loading
Loading