diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 18:44:58 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 18:44:58 +0000 |
commit | f3cf980ca36d5b557b626d1bba4db6ded3ab2b77 (patch) | |
tree | 74028618ccef405480ff6da6a9d0d8c80a8fda7f /net/base/auth.cc | |
parent | 7f5969dda833a858bc946ca59ba0a9afbee2bc89 (diff) | |
download | chromium_src-f3cf980ca36d5b557b626d1bba4db6ded3ab2b77.zip chromium_src-f3cf980ca36d5b557b626d1bba4db6ded3ab2b77.tar.gz chromium_src-f3cf980ca36d5b557b626d1bba4db6ded3ab2b77.tar.bz2 |
Use AuthCredentials throughout the network stack instead of username/password.
This is a refactor only - no behavior change should happen.
Review URL: http://codereview.chromium.org/8340026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/auth.cc')
-rw-r--r-- | net/base/auth.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/base/auth.cc b/net/base/auth.cc index 104400f..cef2e25 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,30 @@ AuthData::~AuthData() { AuthCredentials::AuthCredentials() { } +AuthCredentials::AuthCredentials(const string16& username, + const string16& password) + : username_(username), + password_(password) { +} + AuthCredentials::~AuthCredentials() { } +void AuthCredentials::Set(const string16& username, const string16& password) { + username_ = username; + password_ = 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::Zap() { + ZapString(&password_); +} + } // namespace net |