same_party_context.cc 744 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "net/cookies/same_party_context.h"
  5. #include <ostream>
  6. namespace net {
  7. SamePartyContext::SamePartyContext(Type context_type)
  8. : context_type_(context_type) {}
  9. bool SamePartyContext::operator==(const SamePartyContext& other) const {
  10. return context_type_ == other.context_type_;
  11. }
  12. std::ostream& operator<<(std::ostream& os, const SamePartyContext& spc) {
  13. os << "{" << static_cast<int>(spc.context_type()) << "}";
  14. return os;
  15. }
  16. // static
  17. SamePartyContext SamePartyContext::MakeInclusive() {
  18. return SamePartyContext(Type::kSameParty);
  19. }
  20. } // namespace net