| Index: chrome/browser/net/dns_global.cc
|
| diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc
|
| index 2f85b5912053e084a825b816efad2fb4feecd753..b34de8a3b4859398feafa70b4dc99f64e5df95bc 100644
|
| --- a/chrome/browser/net/dns_global.cc
|
| +++ b/chrome/browser/net/dns_global.cc
|
| @@ -377,9 +377,13 @@ void DnsPrefetchGetHtmlInfo(std::string* output) {
|
| static PrefetchObserver dns_resolution_observer;
|
|
|
| void InitDnsPrefetch(PrefService* user_prefs) {
|
| + // Use a large shutdown time so that UI tests (that instigate lookups, and
|
| + // then try to shutdown the browser) don't instigate the CHECK about
|
| + // "some slaves have not finished"
|
| + const TimeDelta kAllowableShutdownTime(TimeDelta::FromSeconds(10));
|
| DCHECK(NULL == dns_master);
|
| if (!dns_master) {
|
| - dns_master = new DnsMaster();
|
| + dns_master = new DnsMaster(kAllowableShutdownTime);
|
| // We did the initialization, so we should prime the pump, and set up
|
| // the DNS resolution system to run.
|
| off_the_record_observer.Register();
|
| @@ -398,8 +402,14 @@ void InitDnsPrefetch(PrefService* user_prefs) {
|
|
|
| void ShutdownDnsPrefetch() {
|
| DCHECK(NULL != dns_master);
|
| - delete dns_master;
|
| + DnsMaster* master = dns_master;
|
| dns_master = NULL;
|
| + if (master->ShutdownSlaves()) {
|
| + delete master;
|
| + } else {
|
| + // Leak instance if shutdown problem.
|
| + DCHECK(0);
|
| + }
|
| }
|
|
|
| static void DiscardAllPrefetchState() {
|
|
|