summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 16:34:16 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-26 16:34:16 +0000
commit3a7b66d5ef5a33c53661b01c14721343b6c22859 (patch)
treee1f817d4a72311d20a5199b7ad9be6548112acd7 /net/disk_cache
parent42252e078e8bd3d278bc2c33e8ae593c265210fe (diff)
downloadchromium_src-3a7b66d5ef5a33c53661b01c14721343b6c22859.zip
chromium_src-3a7b66d5ef5a33c53661b01c14721343b6c22859.tar.gz
chromium_src-3a7b66d5ef5a33c53661b01c14721343b6c22859.tar.bz2
Disallow UI/IO thread blocking on any other thread.
By design, there's no ScopedAllowWait that is reachable by all code. From experience with ScopedAllowIO, it will be abused. So instead the existing callers (which should all be fixed other than two) are friends with ThreadRestrictions. Review URL: https://chromiumcodereview.appspot.com/10151009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/backend_impl.cc2
-rw-r--r--net/disk_cache/in_flight_io.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index eb26567..20fd40f 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -369,6 +369,8 @@ BackendImpl::~BackendImpl() {
} else {
background_queue_.background_thread()->PostTask(
FROM_HERE, base::Bind(&FinalCleanupCallback, base::Unretained(this)));
+ // http://crbug.com/74623
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
done_.Wait();
}
}
diff --git a/net/disk_cache/in_flight_io.cc b/net/disk_cache/in_flight_io.cc
index 86c2dcc..51ad986 100644
--- a/net/disk_cache/in_flight_io.cc
+++ b/net/disk_cache/in_flight_io.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/threading/thread_restrictions.h"
namespace disk_cache {
@@ -82,7 +83,11 @@ void InFlightIO::OnIOComplete(BackgroundIO* operation) {
// Runs on the primary thread.
void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
- operation->io_completed()->Wait();
+ {
+ // http://crbug.com/74623
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ operation->io_completed()->Wait();
+ }
running_ = true;
if (cancel_task)