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

Unified Diff: net/ftp/ftp_auth_cache.cc

Issue 1151843002: DO NOT LAND Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More. Created 5 years, 7 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
Index: net/ftp/ftp_auth_cache.cc
diff --git a/net/ftp/ftp_auth_cache.cc b/net/ftp/ftp_auth_cache.cc
index 370cee57379a3e00fc591c47b30523bec95abfc7..be459bdc09fd7d8a09b0c7636a85c76f8cc921b9 100644
--- a/net/ftp/ftp_auth_cache.cc
+++ b/net/ftp/ftp_auth_cache.cc
@@ -5,17 +5,15 @@
#include "net/ftp/ftp_auth_cache.h"
#include "base/logging.h"
-#include "url/gurl.h"
namespace net {
// static
const size_t FtpAuthCache::kMaxEntries = 10;
-FtpAuthCache::Entry::Entry(const GURL& origin,
+FtpAuthCache::Entry::Entry(const url::Origin& origin,
const AuthCredentials& credentials)
- : origin(origin),
- credentials(credentials) {
+ : origin(origin), credentials(credentials) {
}
FtpAuthCache::Entry::~Entry() {}
@@ -24,17 +22,17 @@ FtpAuthCache::FtpAuthCache() {}
FtpAuthCache::~FtpAuthCache() {}
-FtpAuthCache::Entry* FtpAuthCache::Lookup(const GURL& origin) {
+FtpAuthCache::Entry* FtpAuthCache::Lookup(const url::Origin& origin) {
for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) {
if (it->origin == origin)
return &(*it);
}
- return NULL;
+ return nullptr;
}
-void FtpAuthCache::Add(const GURL& origin, const AuthCredentials& credentials) {
+void FtpAuthCache::Add(const url::Origin& origin,
+ const AuthCredentials& credentials) {
DCHECK(origin.SchemeIs("ftp"));
- DCHECK_EQ(origin.GetOrigin(), origin);
Entry* entry = Lookup(origin);
if (entry) {
@@ -48,7 +46,7 @@ void FtpAuthCache::Add(const GURL& origin, const AuthCredentials& credentials) {
}
}
-void FtpAuthCache::Remove(const GURL& origin,
+void FtpAuthCache::Remove(const url::Origin& origin,
const AuthCredentials& credentials) {
for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) {
if (it->origin == origin && it->credentials.Equals(credentials)) {

Powered by Google App Engine
This is Rietveld 408576698