| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_HOST_CACHE_H_ | 5 #ifndef NET_BASE_HOST_CACHE_H_ |
| 6 #define NET_BASE_HOST_CACHE_H_ | 6 #define NET_BASE_HOST_CACHE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "net/base/address_family.h" | 16 #include "net/base/address_family.h" |
| 17 #include "net/base/address_list.h" | 17 #include "net/base/address_list.h" |
| 18 #include "net/base/net_api.h" | 18 #include "net/base/net_export.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 // Cache used by HostResolver to map hostnames to their resolved result. | 22 // Cache used by HostResolver to map hostnames to their resolved result. |
| 23 class NET_API HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 23 class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 24 public: | 24 public: |
| 25 // Stores the latest address list that was looked up for a hostname. | 25 // Stores the latest address list that was looked up for a hostname. |
| 26 struct Entry : public base::RefCounted<Entry> { | 26 struct Entry : public base::RefCounted<Entry> { |
| 27 Entry(int error, const AddressList& addrlist, base::TimeTicks expiration); | 27 Entry(int error, const AddressList& addrlist, base::TimeTicks expiration); |
| 28 | 28 |
| 29 // The resolve results for this entry. | 29 // The resolve results for this entry. |
| 30 int error; | 30 int error; |
| 31 AddressList addrlist; | 31 AddressList addrlist; |
| 32 | 32 |
| 33 // The time when this entry expires. | 33 // The time when this entry expires. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Map from hostname (presumably in lowercase canonicalized format) to | 140 // Map from hostname (presumably in lowercase canonicalized format) to |
| 141 // a resolved result entry. | 141 // a resolved result entry. |
| 142 EntryMap entries_; | 142 EntryMap entries_; |
| 143 | 143 |
| 144 DISALLOW_COPY_AND_ASSIGN(HostCache); | 144 DISALLOW_COPY_AND_ASSIGN(HostCache); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 } // namespace net | 147 } // namespace net |
| 148 | 148 |
| 149 #endif // NET_BASE_HOST_CACHE_H_ | 149 #endif // NET_BASE_HOST_CACHE_H_ |
| OLD | NEW |