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

Side by Side Diff: net/base/host_cache.h

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 19
19 namespace net { 20 namespace net {
20 21
21 // Cache used by HostResolver to map hostnames to their resolved result. 22 // Cache used by HostResolver to map hostnames to their resolved result.
22 class HostCache : public base::NonThreadSafe { 23 MSVC_SUPPRESS_WARNING(4275)
24 class NET_API HostCache : public base::NonThreadSafe {
23 public: 25 public:
24 // Stores the latest address list that was looked up for a hostname. 26 // Stores the latest address list that was looked up for a hostname.
25 struct Entry : public base::RefCounted<Entry> { 27 struct Entry : public base::RefCounted<Entry> {
26 Entry(int error, const AddressList& addrlist, base::TimeTicks expiration); 28 Entry(int error, const AddressList& addrlist, base::TimeTicks expiration);
27 29
28 // The resolve results for this entry. 30 // The resolve results for this entry.
29 int error; 31 int error;
30 AddressList addrlist; 32 AddressList addrlist;
31 33
32 // The time when this entry expires. 34 // The time when this entry expires.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Map from hostname (presumably in lowercase canonicalized format) to 138 // Map from hostname (presumably in lowercase canonicalized format) to
137 // a resolved result entry. 139 // a resolved result entry.
138 EntryMap entries_; 140 EntryMap entries_;
139 141
140 DISALLOW_COPY_AND_ASSIGN(HostCache); 142 DISALLOW_COPY_AND_ASSIGN(HostCache);
141 }; 143 };
142 144
143 } // namespace net 145 } // namespace net
144 146
145 #endif // NET_BASE_HOST_CACHE_H_ 147 #endif // NET_BASE_HOST_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698