| Index: chrome/browser/net/dns_global.h
|
| ===================================================================
|
| --- chrome/browser/net/dns_global.h (revision 19463)
|
| +++ chrome/browser/net/dns_global.h (working copy)
|
| @@ -11,10 +11,13 @@
|
| #ifndef CHROME_BROWSER_NET_DNS_GLOBAL_H_
|
| #define CHROME_BROWSER_NET_DNS_GLOBAL_H_
|
|
|
| -#include "chrome/browser/net/dns_master.h"
|
|
|
| #include <string>
|
|
|
| +#include "base/field_trial.h"
|
| +#include "base/scoped_ptr.h"
|
| +#include "chrome/browser/net/dns_master.h"
|
| +
|
| class PrefService;
|
|
|
| namespace net {
|
| @@ -25,7 +28,8 @@
|
|
|
| // Initialize dns prefetching subsystem. Must be called before any other
|
| // functions.
|
| -void InitDnsPrefetch(size_t max_concurrent, PrefService* user_prefs);
|
| +void InitDnsPrefetch(TimeDelta max_queue_delay, size_t max_concurrent,
|
| + PrefService* user_prefs);
|
|
|
| // Cancel pending lookup requests and don't make new ones. Does nothing
|
| // if dns prefetching has not been initialized (to simplify its usage).
|
| @@ -66,19 +70,23 @@
|
| // Helper class to handle global init and shutdown.
|
| class DnsPrefetcherInit {
|
| public:
|
| - // Too many concurrent lookups negate benefits of prefetching by trashing the
|
| - // OS cache before all resource loading is complete. This is the default.
|
| + // Too many concurrent lookups negate benefits of prefetching by trashing
|
| + // the OS cache before all resource loading is complete.
|
| + // This is the default.
|
| static const size_t kMaxConcurrentLookups;
|
|
|
| - DnsPrefetcherInit(size_t max_concurrent, PrefService* user_prefs) {
|
| - InitDnsPrefetch(max_concurrent, user_prefs);
|
| - }
|
| + // When prefetch requests are queued beyond some period of time, then the
|
| + // system is congested, and we need to clear all queued requests to get out
|
| + // of that state. The following is the suggested default time limit.
|
| + static const int kMaxQueueingDelayMs;
|
|
|
| - ~DnsPrefetcherInit() {
|
| - FreeDnsPrefetchResources();
|
| - }
|
| + DnsPrefetcherInit(PrefService* user_prefs, PrefService* local_state);
|
| + ~DnsPrefetcherInit();
|
|
|
| private:
|
| + // Maintain a field trial instance when we do A/B testing.
|
| + scoped_refptr<FieldTrial> trial_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(DnsPrefetcherInit);
|
| };
|
|
|
|
|