Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/auth.h" | 5 #include "net/base/auth.h" |
| 6 #include "net/base/zap.h" | 6 #include "net/base/zap.h" |
| 7 | 7 |
| 8 namespace net { | 8 namespace net { |
| 9 | 9 |
| 10 AuthChallengeInfo::AuthChallengeInfo() : is_proxy(false) { | 10 AuthChallengeInfo::AuthChallengeInfo() : is_proxy(false) { |
| 11 } | 11 } |
| 12 | 12 |
| 13 bool AuthChallengeInfo::Equals(const AuthChallengeInfo& that) const { | 13 bool AuthChallengeInfo::Equals(const AuthChallengeInfo& that) const { |
| 14 return (this->is_proxy == that.is_proxy && | 14 return (this->is_proxy == that.is_proxy && |
| 15 this->challenger.Equals(that.challenger) && | 15 this->challenger.Equals(that.challenger) && |
| 16 this->scheme == that.scheme && | 16 this->scheme == that.scheme && this->realm == that.realm); |
| 17 this->realm == that.realm); | |
| 18 } | 17 } |
| 19 | 18 |
| 20 AuthChallengeInfo::~AuthChallengeInfo() { | 19 AuthChallengeInfo::~AuthChallengeInfo() { |
| 21 } | 20 } |
| 22 | 21 |
| 23 AuthData::AuthData() : state(AUTH_STATE_NEED_AUTH) { | 22 AuthData::AuthData() : state(AUTH_STATE_NEED_AUTH) { |
| 24 } | 23 } |
| 25 | 24 |
| 26 AuthData::~AuthData() { | 25 AuthData::~AuthData() { |
| 27 } | 26 } |
| 28 | 27 |
| 29 AuthCredentials::AuthCredentials() { | 28 AuthCredentials::AuthCredentials() { |
| 30 } | 29 } |
| 31 | 30 |
| 32 AuthCredentials::AuthCredentials(const base::string16& username, | 31 AuthCredentials::AuthCredentials(const base::string16& username, |
| 33 const base::string16& password) | 32 const base::string16& password) |
| 34 : username_(username), | 33 : username_(username), password_(password) { |
|
mef
2014/10/10 20:38:17
I've heard claims that those should be on separate
| |
| 35 password_(password) { | |
| 36 } | 34 } |
| 37 | 35 |
| 38 AuthCredentials::~AuthCredentials() { | 36 AuthCredentials::~AuthCredentials() { |
| 39 } | 37 } |
| 40 | 38 |
| 41 void AuthCredentials::Set(const base::string16& username, | 39 void AuthCredentials::Set(const base::string16& username, |
| 42 const base::string16& password) { | 40 const base::string16& password) { |
| 43 username_ = username; | 41 username_ = username; |
| 44 password_ = password; | 42 password_ = password; |
| 45 } | 43 } |
| 46 | 44 |
| 47 bool AuthCredentials::Equals(const AuthCredentials& other) const { | 45 bool AuthCredentials::Equals(const AuthCredentials& other) const { |
| 48 return username_ == other.username_ && password_ == other.password_; | 46 return username_ == other.username_ && password_ == other.password_; |
| 49 } | 47 } |
| 50 | 48 |
| 51 bool AuthCredentials::Empty() const { | 49 bool AuthCredentials::Empty() const { |
| 52 return username_.empty() && password_.empty(); | 50 return username_.empty() && password_.empty(); |
| 53 } | 51 } |
| 54 | 52 |
| 55 void AuthCredentials::Zap() { | 53 void AuthCredentials::Zap() { |
| 56 ZapString(&password_); | 54 ZapString(&password_); |
| 57 } | 55 } |
| 58 | 56 |
| 59 } // namespace net | 57 } // namespace net |
| OLD | NEW |