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

Unified Diff: chrome/browser/browser_process_impl.cc

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/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index ee110667d7e6960449a1fa1ca72b232d401707a0..37feb2376d5cbc344c5038c623d95bf0cc011194 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/debugger/debugger_wrapper.h"
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/metrics/metrics_service.h"
+#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
@@ -174,6 +175,11 @@ BrowserProcessImpl::~BrowserProcessImpl() {
resource_dispatcher_host()->Shutdown();
}
+ // Shutdown DNS prefetching now to ensure that network stack objects
+ // living on the IO thread get destroyed before the IO thread goes away.
+ io_thread_->message_loop()->PostTask(FROM_HERE,
+ NewRunnableFunction(chrome_browser_net::ShutdownDnsPrefetch));
+
// Need to stop io_thread_ before resource_dispatcher_host_, since
// io_thread_ may still deref ResourceDispatcherHost and handle resource
// request before going away.

Powered by Google App Engine
This is Rietveld 408576698