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

Unified Diff: base/thread_restrictions.cc

Issue 3872002: Thread IO safety: file_util annotated, IO thread blocked from doing IO (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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
« no previous file with comments | « base/thread_restrictions.h ('k') | chrome/browser/extensions/autoupdate_interceptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/thread_restrictions.cc
diff --git a/base/thread_restrictions.cc b/base/thread_restrictions.cc
index 1ee8eee433800840b420dcb07d1d8bdcc024f6cd..270d66374bb9b0e65e343497732970aaf95aa0a0 100644
--- a/base/thread_restrictions.cc
+++ b/base/thread_restrictions.cc
@@ -21,8 +21,10 @@ LazyInstance<ThreadLocalBoolean, LeakyLazyInstanceTraits<ThreadLocalBoolean> >
} // anonymous namespace
// static
-void ThreadRestrictions::SetIOAllowed(bool allowed) {
+bool ThreadRestrictions::SetIOAllowed(bool allowed) {
+ bool previous_allowed = g_io_disallowed.Get().Get();
g_io_disallowed.Get().Set(!allowed);
+ return !previous_allowed;
}
// static
« no previous file with comments | « base/thread_restrictions.h ('k') | chrome/browser/extensions/autoupdate_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698