auth.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2011 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/base/auth.h"
  5. namespace net {
  6. AuthChallengeInfo::AuthChallengeInfo() = default;
  7. AuthChallengeInfo::AuthChallengeInfo(const AuthChallengeInfo& other) = default;
  8. bool AuthChallengeInfo::MatchesExceptPath(
  9. const AuthChallengeInfo& other) const {
  10. return (is_proxy == other.is_proxy && challenger == other.challenger &&
  11. scheme == other.scheme && realm == other.realm &&
  12. challenge == other.challenge);
  13. }
  14. AuthChallengeInfo::~AuthChallengeInfo() = default;
  15. AuthCredentials::AuthCredentials() = default;
  16. AuthCredentials::AuthCredentials(const std::u16string& username,
  17. const std::u16string& password)
  18. : username_(username), password_(password) {}
  19. AuthCredentials::~AuthCredentials() = default;
  20. void AuthCredentials::Set(const std::u16string& username,
  21. const std::u16string& password) {
  22. username_ = username;
  23. password_ = password;
  24. }
  25. bool AuthCredentials::Equals(const AuthCredentials& other) const {
  26. return username_ == other.username_ && password_ == other.password_;
  27. }
  28. bool AuthCredentials::Empty() const {
  29. return username_.empty() && password_.empty();
  30. }
  31. } // namespace net