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

Unified Diff: net/ftp/ftp_auth_cache.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/ftp/ftp_auth_cache.h ('k') | net/ftp/ftp_auth_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_auth_cache.cc
diff --git a/net/ftp/ftp_auth_cache.cc b/net/ftp/ftp_auth_cache.cc
deleted file mode 100644
index 370cee57379a3e00fc591c47b30523bec95abfc7..0000000000000000000000000000000000000000
--- a/net/ftp/ftp_auth_cache.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#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,
- const AuthCredentials& credentials)
- : origin(origin),
- credentials(credentials) {
-}
-
-FtpAuthCache::Entry::~Entry() {}
-
-FtpAuthCache::FtpAuthCache() {}
-
-FtpAuthCache::~FtpAuthCache() {}
-
-FtpAuthCache::Entry* FtpAuthCache::Lookup(const GURL& origin) {
- for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) {
- if (it->origin == origin)
- return &(*it);
- }
- return NULL;
-}
-
-void FtpAuthCache::Add(const GURL& origin, const AuthCredentials& credentials) {
- DCHECK(origin.SchemeIs("ftp"));
- DCHECK_EQ(origin.GetOrigin(), origin);
-
- Entry* entry = Lookup(origin);
- if (entry) {
- entry->credentials = credentials;
- } else {
- entries_.push_front(Entry(origin, credentials));
-
- // Prevent unbound memory growth of the cache.
- if (entries_.size() > kMaxEntries)
- entries_.pop_back();
- }
-}
-
-void FtpAuthCache::Remove(const GURL& origin,
- const AuthCredentials& credentials) {
- for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) {
- if (it->origin == origin && it->credentials.Equals(credentials)) {
- entries_.erase(it);
- DCHECK(!Lookup(origin));
- return;
- }
- }
-}
-
-} // namespace net
« no previous file with comments | « net/ftp/ftp_auth_cache.h ('k') | net/ftp/ftp_auth_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698