Chromium Code Reviews| Index: net/base/auth.cc |
| diff --git a/net/base/auth.cc b/net/base/auth.cc |
| index 104400f6afb5729cf13f73dd65162c6bd42702e9..b132a0c44a471ed903d7115550f99349d2155a5b 100644 |
| --- a/net/base/auth.cc |
| +++ b/net/base/auth.cc |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "net/base/auth.h" |
| +#include "net/base/zap.h" |
| namespace net { |
| @@ -28,7 +29,29 @@ AuthData::~AuthData() { |
| AuthCredentials::AuthCredentials() { |
| } |
| +AuthCredentials::AuthCredentials(const string16& username, |
| + const string16& password) |
| + : username_(username), |
| + password_(password) { |
| +} |
| + |
| AuthCredentials::~AuthCredentials() { |
| + // Wipe our copy of the password from memory, to reduce the chance of being |
| + // written to the paging file on disk. |
| + ZapString(&password_); |
| +} |
| + |
| +bool AuthCredentials::Equals(const AuthCredentials& other) const { |
| + return username_ == other.username_ && password_ == other.password_; |
| +} |
| + |
| +bool AuthCredentials::Empty() const { |
| + return username_.empty() && password_.empty(); |
| +} |
| + |
| +void AuthCredentials::Set(const string16& username, const string16& password) { |
| + username_ = username; |
| + password_ = password; |
|
asanka
2011/10/27 20:01:20
Zap password_ before assignment?
Also consider as
cbentzel
2011/10/28 02:18:40
As we discussed, I'll change behavior in another C
|
| } |
| } // namespace net |