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 
5 #include "net/base/auth.h"
6 
7 namespace net {
8 
AuthChallengeInfo()9 AuthChallengeInfo::AuthChallengeInfo() : is_proxy(false) {
10 }
11 
12 AuthChallengeInfo::AuthChallengeInfo(const AuthChallengeInfo& other) = default;
13 
MatchesExceptPath(const AuthChallengeInfo & other) const14 bool AuthChallengeInfo::MatchesExceptPath(
15     const AuthChallengeInfo& other) const {
16   return (is_proxy == other.is_proxy && challenger == other.challenger &&
17           scheme == other.scheme && realm == other.realm &&
18           challenge == other.challenge);
19 }
20 
21 AuthChallengeInfo::~AuthChallengeInfo() = default;
22 
23 AuthCredentials::AuthCredentials() = default;
24 
AuthCredentials(const base::string16 & username,const base::string16 & password)25 AuthCredentials::AuthCredentials(const base::string16& username,
26                                  const base::string16& password)
27     : username_(username),
28       password_(password) {
29 }
30 
31 AuthCredentials::~AuthCredentials() = default;
32 
Set(const base::string16 & username,const base::string16 & password)33 void AuthCredentials::Set(const base::string16& username,
34                           const base::string16& password) {
35   username_ = username;
36   password_ = password;
37 }
38 
Equals(const AuthCredentials & other) const39 bool AuthCredentials::Equals(const AuthCredentials& other) const {
40   return username_ == other.username_ && password_ == other.password_;
41 }
42 
Empty() const43 bool AuthCredentials::Empty() const {
44   return username_.empty() && password_.empty();
45 }
46 
47 }  // namespace net
48