Chromium Code Reviews| Index: net/base/host_resolver.h |
| diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h |
| index 58a50449d41f3d60df76870afc85d2ece713c971..d7732335d9e71d8506dbb9ac1377a84c16b06de6 100644 |
| --- a/net/base/host_resolver.h |
| +++ b/net/base/host_resolver.h |
| @@ -7,6 +7,7 @@ |
| #include <string> |
| +#include "base/memory/scoped_ptr.h" |
| #include "net/base/address_family.h" |
| #include "net/base/completion_callback.h" |
| #include "net/base/host_port_pair.h" |
| @@ -95,14 +96,13 @@ class NET_EXPORT HostResolver { |
| // Opaque type used to cancel a request. |
| typedef void* RequestHandle; |
| - // This value can be passed into CreateSystemHostResolver as the |
| + // This value can be passed into CreateSystemResolver as the |
| // |max_concurrent_resolves| parameter. It will select a default level of |
| // concurrency. |
| static const size_t kDefaultParallelism = 0; |
| - // This value can be passed into CreateSystemHostResolver as the |
| - // |max_retry_attempts| parameter. This is the maximum number of times we |
| - // will retry for host resolution. |
| + // This value can be passed into CreateSystemResolver as the |
| + // |max_retry_attempts| parameter. |
| static const size_t kDefaultRetryAttempts = -1; |
| // If any completion callbacks are pending when the resolver is destroyed, |
| @@ -168,6 +168,27 @@ class NET_EXPORT HostResolver { |
| // ownership of the returned Value. |
| virtual base::Value* GetDnsConfigAsValue() const; |
| + // Creates a HostResolver implementation that queries the underlying system. |
| + // (Except if a unit-test has changed the global HostResolverProc using |
| + // ScopedHostResolverProc to intercept requests to the system). |
| + // |max_concurrent_resolves| is how many resolve requests will be allowed to |
| + // run in parallel. Pass HostResolver::kDefaultParallelism to choose a |
| + // default value. |
| + // |max_retry_attempts| is the maximum number of times we will retry for host |
| + // resolution. Pass HostResolver::kDefaultRetryAttempts to choose a default |
| + // value. |
| + // |enable_caching| controls whether a HostCache is used. |
| + // |enable_async| controls whether a DnsClient is used. |
| + static scoped_ptr<HostResolver> CreateSystemResolver( |
| + size_t max_concurrent_resolves, |
|
darin (slow to review)
2012/10/09 17:38:34
an Options struct containing these four fields wou
szym
2012/10/09 21:40:43
Done.
|
| + size_t max_retry_attempts, |
| + bool enable_caching, |
| + bool enable_async, |
| + NetLog* net_log); |
| + |
| + // As above, but uses default parameters. |
| + static scoped_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log); |
| + |
| protected: |
| HostResolver(); |
| @@ -175,37 +196,6 @@ class NET_EXPORT HostResolver { |
| DISALLOW_COPY_AND_ASSIGN(HostResolver); |
| }; |
| -// Creates a HostResolver implementation that queries the underlying system. |
| -// (Except if a unit-test has changed the global HostResolverProc using |
| -// ScopedHostResolverProc to intercept requests to the system). |
| -// |max_concurrent_resolves| is how many resolve requests will be allowed to |
| -// run in parallel. Pass HostResolver::kDefaultParallelism to choose a |
| -// default value. |
| -// |max_retry_attempts| is the maximum number of times we will retry for host |
| -// resolution. Pass HostResolver::kDefaultRetryAttempts to choose a default |
| -// value. |
| -// The created HostResolver uses an instance of DnsConfigService to retrieve |
| -// system DNS configuration. |
| -// This resolver should not be used in test context. Instead, use |
| -// MockHostResolver from net/base/mock_host_resolver.h. |
| -NET_EXPORT HostResolver* CreateSystemHostResolver( |
| - size_t max_concurrent_resolves, |
| - size_t max_retry_attempts, |
| - NetLog* net_log); |
| - |
| -// As above, but the created HostResolver does not use a cache. |
| -NET_EXPORT HostResolver* CreateNonCachingSystemHostResolver( |
| - size_t max_concurrent_resolves, |
| - size_t max_retry_attempts, |
| - NetLog* net_log); |
| - |
| -// As above, but the HostResolver will use the asynchronous DNS client in |
| -// DnsTransaction, which will be configured using DnsConfigService to match |
| -// the system DNS settings. If the client fails, the resolver falls back to |
| -// the global HostResolverProc. |
| -NET_EXPORT HostResolver* CreateAsyncHostResolver(size_t max_concurrent_resolves, |
| - size_t max_retry_attempts, |
| - NetLog* net_log); |
| } // namespace net |
| #endif // NET_BASE_HOST_RESOLVER_H_ |