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

Unified Diff: chrome/browser/net/dns_global.h

Issue 147215: Refactor DNS A/B experient, and add test of congestion time limits... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/net/dns_global.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/net/dns_global.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698