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

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

Issue 7064033: Virtual destructors should have virtual keyword. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
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
« no previous file with comments | « net/base/dnsrr_resolver.h ('k') | net/base/ssl_client_auth_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MOCK_HOST_RESOLVER_H_ 5 #ifndef NET_BASE_MOCK_HOST_RESOLVER_H_
6 #define NET_BASE_MOCK_HOST_RESOLVER_H_ 6 #define NET_BASE_MOCK_HOST_RESOLVER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 }; 88 };
89 89
90 // Same as MockHostResolver, except internally it uses a host-cache. 90 // Same as MockHostResolver, except internally it uses a host-cache.
91 // 91 //
92 // Note that tests are advised to use MockHostResolver instead, since it is 92 // Note that tests are advised to use MockHostResolver instead, since it is
93 // more predictable. (MockHostResolver also can be put into synchronous 93 // more predictable. (MockHostResolver also can be put into synchronous
94 // operation mode in case that is what you needed from the caching version). 94 // operation mode in case that is what you needed from the caching version).
95 class MockCachingHostResolver : public MockHostResolverBase { 95 class MockCachingHostResolver : public MockHostResolverBase {
96 public: 96 public:
97 MockCachingHostResolver() : MockHostResolverBase(true /*use_caching*/) {} 97 MockCachingHostResolver() : MockHostResolverBase(true /*use_caching*/) {}
98 ~MockCachingHostResolver() {} 98 virtual ~MockCachingHostResolver() {}
99 }; 99 };
100 100
101 // RuleBasedHostResolverProc applies a set of rules to map a host string to 101 // RuleBasedHostResolverProc applies a set of rules to map a host string to
102 // a replacement host string. It then uses the system host resolver to return 102 // a replacement host string. It then uses the system host resolver to return
103 // a socket address. Generally the replacement should be an IPv4 literal so 103 // a socket address. Generally the replacement should be an IPv4 literal so
104 // there is no network dependency. 104 // there is no network dependency.
105 class NET_TEST RuleBasedHostResolverProc : public HostResolverProc { 105 class NET_TEST RuleBasedHostResolverProc : public HostResolverProc {
106 public: 106 public:
107 explicit RuleBasedHostResolverProc(HostResolverProc* previous); 107 explicit RuleBasedHostResolverProc(HostResolverProc* previous);
108 108
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 virtual int Resolve(const std::string& host, 140 virtual int Resolve(const std::string& host,
141 AddressFamily address_family, 141 AddressFamily address_family,
142 HostResolverFlags host_resolver_flags, 142 HostResolverFlags host_resolver_flags,
143 AddressList* addrlist, 143 AddressList* addrlist,
144 int* os_error); 144 int* os_error);
145 145
146 private: 146 private:
147 struct Rule; 147 struct Rule;
148 typedef std::list<Rule> RuleList; 148 typedef std::list<Rule> RuleList;
149 149
150 ~RuleBasedHostResolverProc(); 150 virtual ~RuleBasedHostResolverProc();
151 151
152 RuleList rules_; 152 RuleList rules_;
153 }; 153 };
154 154
155 // Using WaitingHostResolverProc you can simulate very long lookups. 155 // Using WaitingHostResolverProc you can simulate very long lookups.
156 class NET_TEST WaitingHostResolverProc : public HostResolverProc { 156 class NET_TEST WaitingHostResolverProc : public HostResolverProc {
157 public: 157 public:
158 explicit WaitingHostResolverProc(HostResolverProc* previous); 158 explicit WaitingHostResolverProc(HostResolverProc* previous);
159 159
160 void Signal(); 160 void Signal();
(...skipping 30 matching lines...) Expand all
191 void Init(HostResolverProc* proc); 191 void Init(HostResolverProc* proc);
192 192
193 private: 193 private:
194 scoped_refptr<HostResolverProc> current_proc_; 194 scoped_refptr<HostResolverProc> current_proc_;
195 scoped_refptr<HostResolverProc> previous_proc_; 195 scoped_refptr<HostResolverProc> previous_proc_;
196 }; 196 };
197 197
198 } // namespace net 198 } // namespace net
199 199
200 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ 200 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_
OLDNEW
« no previous file with comments | « net/base/dnsrr_resolver.h ('k') | net/base/ssl_client_auth_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698