1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/permissions/permission_usage_session.h"
9 namespace permissions {
11 bool PermissionUsageSession::operator==(
12 const PermissionUsageSession& other) const {
13 return std::tie(origin, type, usage_start, usage_end, had_user_activation,
14 was_foreground, had_focus) ==
15 std::tie(other.origin, other.type, other.usage_start, other.usage_end,
16 other.had_user_activation, other.was_foreground,
20 bool PermissionUsageSession::operator!=(
21 const PermissionUsageSession& other) const {
22 return !(*this == other);
25 bool PermissionUsageSession::IsValid() const {
26 return !(origin.opaque() || usage_start.is_null() || usage_end.is_null() ||
27 usage_end < usage_start);
30 } // namespace permissions