OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_FTP_FTP_AUTH_CACHE_H_ | 5 #ifndef NET_FTP_FTP_AUTH_CACHE_H_ |
6 #define NET_FTP_FTP_AUTH_CACHE_H_ | 6 #define NET_FTP_FTP_AUTH_CACHE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Add an entry for |origin| to the cache. If there is already an | 35 // Add an entry for |origin| to the cache. If there is already an |
36 // entry for |origin|, it will be overwritten. Both parameters are IN only. | 36 // entry for |origin|, it will be overwritten. Both parameters are IN only. |
37 void Add(const GURL& origin, AuthData* value); | 37 void Add(const GURL& origin, AuthData* value); |
38 | 38 |
39 // Remove the entry for |origin| from the cache, if one exists. | 39 // Remove the entry for |origin| from the cache, if one exists. |
40 void Remove(const GURL& origin); | 40 void Remove(const GURL& origin); |
41 | 41 |
42 private: | 42 private: |
43 typedef std::string AuthCacheKey; | 43 typedef std::string AuthCacheKey; |
44 typedef scoped_refptr<AuthData> AuthCacheValue; | 44 typedef scoped_refptr<AuthData> AuthCacheValue; |
45 typedef std::map<AuthCacheKey,AuthCacheValue> AuthCacheMap; | 45 typedef std::map<AuthCacheKey, AuthCacheValue> AuthCacheMap; |
46 | 46 |
47 // Get the key in hash table |cache_| where entries for ftp server |origin| | 47 // Get the key in hash table |cache_| where entries for ftp server |origin| |
48 // should be saved. | 48 // should be saved. |
49 static AuthCacheKey MakeKey(const GURL& origin); | 49 static AuthCacheKey MakeKey(const GURL& origin); |
50 | 50 |
51 // internal representation of cache, an STL map. | 51 // internal representation of cache, an STL map. |
52 AuthCacheMap cache_; | 52 AuthCacheMap cache_; |
53 }; | 53 }; |
54 | 54 |
55 } // namespace net | 55 } // namespace net |
56 | 56 |
57 #endif // NET_FTP_FTP_AUTH_CACHE_H_ | 57 #endif // NET_FTP_FTP_AUTH_CACHE_H_ |
OLD | NEW |