summaryrefslogtreecommitdiffstats
path: root/net/base/host_resolver.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/host_resolver.h')
-rw-r--r--net/base/host_resolver.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h
index 1f649f8..bfae53c 100644
--- a/net/base/host_resolver.h
+++ b/net/base/host_resolver.h
@@ -57,10 +57,24 @@ class HostResolver {
// A helper class used in unit tests to alter hostname mappings. See
// SetHostMapper for details.
-class HostMapper {
+class HostMapper : public base::RefCountedThreadSafe<HostMapper> {
public:
virtual ~HostMapper() {}
virtual std::string Map(const std::string& host) = 0;
+
+ protected:
+ // Ask previous host mapper (if set) for mapping of given host.
+ std::string MapUsingPrevious(const std::string& host);
+
+ private:
+ friend class ScopedHostMapper;
+
+ // Set mapper to ask when this mapper doesn't want to modify the result.
+ void set_previous_mapper(HostMapper* mapper) {
+ previous_mapper_ = mapper;
+ }
+
+ scoped_refptr<HostMapper> previous_mapper_;
};
#ifdef UNIT_TEST