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

Unified Diff: net/base/auth.cc

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 | « net/base/auth.h ('k') | net/base/zap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/auth.cc
diff --git a/net/base/auth.cc b/net/base/auth.cc
index 104400f6afb5729cf13f73dd65162c6bd42702e9..cef2e25e9aed3094e4025da431165a71618ef11c 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
« no previous file with comments | « net/base/auth.h ('k') | net/base/zap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698