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

Unified Diff: chrome/browser/browser_shutdown.cc

Issue 4146004: ThreadRestrictions: disallow blocking IO on the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 10 years, 2 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_shutdown.cc
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
index 98e0af7440ad88c6c04533337ba822b098282556..8f1fb80366cf22f8a9b39826e81e261ea443776f 100644
--- a/chrome/browser/browser_shutdown.cc
+++ b/chrome/browser/browser_shutdown.cc
@@ -16,6 +16,7 @@
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/thread.h"
+#include "base/thread_restrictions.h"
#include "base/time.h"
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
@@ -100,6 +101,12 @@ FilePath GetShutdownMsPath() {
}
void Shutdown() {
+ // During shutdown we will end up some blocking operations. But the
+ // work needs to get done and we're going to wait for them no matter
+ // what thread they're on, so don't worry about it slowing down
+ // shutdown.
+ base::ThreadRestrictions::SetIOAllowed(true);
+
// Unload plugins. This needs to happen on the IO thread.
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698