diff options
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/run_all_unittests.cc | 2 | ||||
-rw-r--r-- | net/base/scoped_host_mapper.h (renamed from net/base/host_resolver_unittest.h) | 15 | ||||
-rw-r--r-- | net/base/tcp_client_socket_unittest.cc | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/net/base/run_all_unittests.cc b/net/base/run_all_unittests.cc index de79e68..71dada9 100644 --- a/net/base/run_all_unittests.cc +++ b/net/base/run_all_unittests.cc @@ -29,7 +29,7 @@ #include "base/message_loop.h" #include "base/test_suite.h" -#include "net/base/host_resolver_unittest.h" +#include "net/base/scoped_host_mapper.h" class NetTestSuite : public TestSuite { public: diff --git a/net/base/host_resolver_unittest.h b/net/base/scoped_host_mapper.h index c7ecea81..82b6c4e 100644 --- a/net/base/host_resolver_unittest.h +++ b/net/base/scoped_host_mapper.h @@ -22,14 +22,17 @@ // // scoped_host_mapper.AddRule("*.com", "127.0.0.1"); // -// If there are multiple ScopedHostMappers on the stack, then the last one +// If there are multiple ScopedHostMappers in existence, then the last one // allocated will be used. However, if it does not provide a matching rule, -// then it will delegate to the previously allocated ScopedHostMapper. +// then it will delegate to the previously set HostMapper (see SetHostMapper). // Finally, if no HostMapper matches a given hostname, then the hostname will // be unmodified. +// +// IMPORTANT: ScopedHostMapper is only designed to be used on a single thread, +// and it is a requirement that the lifetimes of multiple instances be nested. -#ifndef NET_BASE_HOST_RESOLVER_UNITTEST_H_ -#define NET_BASE_HOST_RESOLVER_UNITTEST_H_ +#ifndef NET_BASE_SCOPED_HOST_MAPPER_H_ +#define NET_BASE_SCOPED_HOST_MAPPER_H_ #ifdef UNIT_TEST @@ -41,7 +44,7 @@ namespace net { -// This class sets the HostResolverProc for a particular scope. +// This class sets the HostMapper for a particular scope. class ScopedHostMapper : public HostMapper { public: ScopedHostMapper() { @@ -83,4 +86,4 @@ class ScopedHostMapper : public HostMapper { #endif // UNIT_TEST -#endif // NET_BASE_HOST_RESOLVER_UNITTEST_H_ +#endif // NET_BASE_SCOPED_HOST_MAPPER_H_ diff --git a/net/base/tcp_client_socket_unittest.cc b/net/base/tcp_client_socket_unittest.cc index 34c0940..7dbbe45 100644 --- a/net/base/tcp_client_socket_unittest.cc +++ b/net/base/tcp_client_socket_unittest.cc @@ -5,8 +5,8 @@ #include "base/platform_test.h" #include "net/base/address_list.h" #include "net/base/host_resolver.h" -#include "net/base/host_resolver_unittest.h" #include "net/base/net_errors.h" +#include "net/base/scoped_host_mapper.h" #include "net/base/tcp_client_socket.h" #include "net/base/test_completion_callback.h" #include "testing/gtest/include/gtest/gtest.h" |