0

Modernize equality operators in //ui

This CL is pure clean-up and contains no functionality changes.
Depending on the files covered in the CL (since the CL was generated
using git cl split), it does a subset of the following:
the following:
- Remove unneeded operator!= declarations/definitions since C++20 can
  automatically derive those from operator==.
- Default operator== where this is equivalent to the current behavior.
- Default operator<=> where this is equivalent to the current
  behavior.

This CL was uploaded by git cl split.

R=arichiv@chromium.org

Bug: 40256175
Change-Id: Iffc23f9f8c732a6cc15b89da191e94a5bb365026
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6540288
Commit-Queue: Jan Keitel <jkeitel@google.com>
Auto-Submit: Jan Keitel <jkeitel@google.com>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1459351}
This commit is contained in:
Jan Keitel
2025-05-13 04:13:06 -07:00
committed by Chromium LUCI CQ
parent 26d820e162
commit ae97571fb8
2 changed files with 7 additions and 19 deletions
services/network/public/cpp/permissions_policy

@ -93,16 +93,6 @@ bool OriginWithPossibleWildcards::DoesMatchOrigin(
network::CSPSourceContext::PermissionsPolicy);
}
bool operator==(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs) {
return lhs.csp_source == rhs.csp_source;
}
bool operator!=(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs) {
return lhs.csp_source != rhs.csp_source;
}
bool operator<(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs) {
return lhs.csp_source < rhs.csp_source;

@ -75,19 +75,17 @@ class COMPONENT_EXPORT(NETWORK_CPP_WEB_PLATFORM) OriginWithPossibleWildcards {
return csp_source;
}
COMPONENT_EXPORT(NETWORK_CPP_WEB_PLATFORM)
friend bool operator==(const OriginWithPossibleWildcards&,
const OriginWithPossibleWildcards&) = default;
COMPONENT_EXPORT(NETWORK_CPP_WEB_PLATFORM)
friend bool operator<(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs);
private:
friend struct mojo::StructTraits<
network::mojom::OriginWithPossibleWildcardsDataView,
network::OriginWithPossibleWildcards>;
COMPONENT_EXPORT(NETWORK_CPP_WEB_PLATFORM)
friend bool operator==(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs);
COMPONENT_EXPORT(NETWORK_CPP_WEB_PLATFORM)
friend bool operator!=(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs);
COMPONENT_EXPORT(NETWORK_CPP_WEB_PLATFORM)
friend bool operator<(const OriginWithPossibleWildcards& lhs,
const OriginWithPossibleWildcards& rhs);
network::mojom::CSPSource csp_source;
};