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

Side by Side Diff: chrome/browser/net/dns_global.cc

Issue 27048: Fix a crash when dns prefetching was being shut down without being started.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: drop the ui test Created 11 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/dns_global.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/dns_global.h" 5 #include "chrome/browser/net/dns_global.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/stats_counters.h" 10 #include "base/stats_counters.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 EnableDnsPrefetch(enabled); 392 EnableDnsPrefetch(enabled);
393 } 393 }
394 394
395 DLOG(INFO) << "DNS Prefetch service started"; 395 DLOG(INFO) << "DNS Prefetch service started";
396 396
397 // Start observing real HTTP stack resolutions. 397 // Start observing real HTTP stack resolutions.
398 net::AddDnsResolutionObserver(&dns_resolution_observer); 398 net::AddDnsResolutionObserver(&dns_resolution_observer);
399 } 399 }
400 } 400 }
401 401
402 void ShutdownDnsPrefetch() { 402 void EnsureDnsPrefetchShutdown() {
403 DCHECK(NULL != dns_master); 403 if (NULL != dns_master)
404 dns_master->Shutdown(); 404 dns_master->Shutdown();
405 } 405 }
406 406
407 void FreeDnsPrefetchResources() { 407 void FreeDnsPrefetchResources() {
408 DCHECK(NULL != dns_master); 408 DCHECK(NULL != dns_master);
409 delete dns_master; 409 delete dns_master;
410 dns_master = NULL; 410 dns_master = NULL;
411 } 411 }
412 412
413 static void DiscardAllPrefetchState() { 413 static void DiscardAllPrefetchState() {
414 if (!dns_master) 414 if (!dns_master)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 486 }
487 487
488 void TrimSubresourceReferrers() { 488 void TrimSubresourceReferrers() {
489 if (NULL == dns_master) 489 if (NULL == dns_master)
490 return; 490 return;
491 dns_master->TrimReferrers(); 491 dns_master->TrimReferrers();
492 } 492 }
493 493
494 } // namespace chrome_browser_net 494 } // namespace chrome_browser_net
495 495
OLDNEW
« no previous file with comments | « chrome/browser/net/dns_global.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698