Chromium Code Reviews

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 5750003: Reland r68893 after fixing allowing blocking IO on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable for Windows. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « base/platform_thread_win.cc ('k') | chrome/browser/geolocation/geolocation_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index ea5279755dc0e514d6d45bc8fda2201bd7c9663b..8facb15a697a23dd40ca6fa3baeafc8a1f7bd6a6 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -13,6 +13,7 @@
#include "base/path_service.h"
#include "base/task.h"
#include "base/thread.h"
+#include "base/thread_restrictions.h"
#include "base/waitable_event.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
#include "chrome/browser/automation/automation_provider_list.h"
@@ -252,6 +253,12 @@ unsigned int BrowserProcessImpl::ReleaseModule() {
DCHECK_NE(0u, module_ref_count_);
module_ref_count_--;
if (0 == module_ref_count_) {
+ // Allow UI and IO threads to do blocking IO on shutdown, since we do a lot
+ // of it on shutdown for valid reasons.
+ base::ThreadRestrictions::SetIOAllowed(true);
+ io_thread()->message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true));
MessageLoop::current()->PostTask(
FROM_HERE, NewRunnableFunction(DidEndMainMessageLoop));
MessageLoop::current()->Quit();
« no previous file with comments | « base/platform_thread_win.cc ('k') | chrome/browser/geolocation/geolocation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine