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

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

Issue 15076: Clean up dns prefetch code, and also port it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: use scoper for init & free 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/dns_global.h
diff --git a/chrome/browser/net/dns_global.h b/chrome/browser/net/dns_global.h
index 2ba0e703f421e042c2ee35573c13a6b6fd000f4c..80cf6ff9b7820bd635b25b1783c7d43fa7ab3857 100644
--- a/chrome/browser/net/dns_global.h
+++ b/chrome/browser/net/dns_global.h
@@ -19,10 +19,17 @@ class PrefService;
namespace chrome_browser_net {
-// Functions to initialize our global state so that PrefetchDns() can be called.
+// Initialize dns prefetching subsystem. Must be called before any other
+// functions.
void InitDnsPrefetch(PrefService* user_prefs);
+
+// Cancel pending lookup requests and don't make new ones.
void ShutdownDnsPrefetch();
+// Free all resources allocated by InitDnsPrefetch. After that you must not call
+// any function from this file.
+void FreeDnsPrefetchResources();
+
//------------------------------------------------------------------------------
// Global APIs relating to Prefetching in browser
void EnableDnsPrefetch(bool enable);
@@ -53,7 +60,10 @@ class DnsPrefetcherInit {
explicit DnsPrefetcherInit(PrefService* user_prefs) {
InitDnsPrefetch(user_prefs);
}
- ~DnsPrefetcherInit() {ShutdownDnsPrefetch();}
+
+ ~DnsPrefetcherInit() {
+ FreeDnsPrefetchResources();
+ }
private:
DISALLOW_COPY_AND_ASSIGN(DnsPrefetcherInit);

Powered by Google App Engine
This is Rietveld 408576698