summaryrefslogtreecommitdiffstats
path: root/net/base/auth.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-28 18:44:58 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-28 18:44:58 +0000
commitf3cf980ca36d5b557b626d1bba4db6ded3ab2b77 (patch)
tree74028618ccef405480ff6da6a9d0d8c80a8fda7f /net/base/auth.h
parent7f5969dda833a858bc946ca59ba0a9afbee2bc89 (diff)
downloadchromium_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.h')
-rw-r--r--net/base/auth.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/net/base/auth.h b/net/base/auth.h
index 386adad..3f856c4 100644
--- a/net/base/auth.h
+++ b/net/base/auth.h
@@ -47,17 +47,35 @@ class NET_EXPORT AuthChallengeInfo :
class NET_EXPORT AuthCredentials {
public:
AuthCredentials();
+ AuthCredentials(const string16& username, const string16& password);
~AuthCredentials();
+ // Set the |username| and |password|.
+ void Set(const string16& username, const string16& password);
+
+ // Determines if |this| is equivalent to |other|.
+ bool Equals(const AuthCredentials& other) const;
+
+ // Returns true if all credentials are empty.
+ bool Empty() const;
+
+ // Overwrites the password memory to prevent it from being read if
+ // it's paged out to disk.
+ void Zap();
+
+ const string16& username() const { return username_; }
+ const string16& password() const { return password_; }
+
+ private:
// The username to provide, possibly empty. This should be ASCII only to
// minimize compatibility problems, but arbitrary UTF-16 strings are allowed
// and will be attempted.
- string16 username;
+ string16 username_;
// The password to provide, possibly empty. This should be ASCII only to
// minimize compatibility problems, but arbitrary UTF-16 strings are allowed
// and will be attempted.
- string16 password;
+ string16 password_;
// Intentionally allowing the implicit copy constructor and assignment
// operators.