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

Unified Diff: net/http/http_auth_cache.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/http/http_auth_cache.h ('k') | net/http/http_auth_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_cache.cc
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc
index ac50cec45eab083f4c4d21a0e4ec2e02517eb696..2cc2c0ce556249576f52b298efe7536753b1bca1 100644
--- a/net/http/http_auth_cache.cc
+++ b/net/http/http_auth_cache.cc
@@ -112,8 +112,7 @@ HttpAuthCache::Entry* HttpAuthCache::Add(const GURL& origin,
const std::string& realm,
HttpAuth::Scheme scheme,
const std::string& auth_challenge,
- const string16& username,
- const string16& password,
+ const AuthCredentials& credentials,
const std::string& path) {
CheckOriginIsValid(origin);
CheckPathIsValid(path);
@@ -138,8 +137,7 @@ HttpAuthCache::Entry* HttpAuthCache::Add(const GURL& origin,
DCHECK_EQ(scheme, entry->scheme_);
entry->auth_challenge_ = auth_challenge;
- entry->username_ = username;
- entry->password_ = password;
+ entry->credentials_ = credentials;
entry->nonce_count_ = 1;
entry->AddPath(path);
@@ -199,12 +197,11 @@ bool HttpAuthCache::Entry::HasEnclosingPath(const std::string& dir,
bool HttpAuthCache::Remove(const GURL& origin,
const std::string& realm,
HttpAuth::Scheme scheme,
- const string16& username,
- const string16& password) {
+ const AuthCredentials& credentials) {
for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) {
if (it->origin() == origin && it->realm() == realm &&
it->scheme() == scheme) {
- if (username == it->username() && password == it->password()) {
+ if (credentials.Equals(it->credentials())) {
entries_.erase(it);
return true;
}
@@ -231,7 +228,7 @@ void HttpAuthCache::UpdateAllFrom(const HttpAuthCache& other) {
// Add an Entry with one of the original entry's paths.
DCHECK(it->paths_.size() > 0);
Entry* entry = Add(it->origin(), it->realm(), it->scheme(),
- it->auth_challenge(), it->username(), it->password(),
+ it->auth_challenge(), it->credentials(),
it->paths_.back());
// Copy all other paths.
for (Entry::PathList::const_reverse_iterator it2 = ++it->paths_.rbegin();
« no previous file with comments | « net/http/http_auth_cache.h ('k') | net/http/http_auth_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698