Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: net/base/auth.h

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix comments Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/login/login_prompt.cc ('k') | net/base/auth.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/auth.h
diff --git a/net/base/auth.h b/net/base/auth.h
index 386adadcb3b19cf78b4a90a5108814d5de5a5bdf..3f856c409eb86c8b7a87c6b2ec63886a0efb5bad 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.
« no previous file with comments | « chrome/browser/ui/login/login_prompt.cc ('k') | net/base/auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698