Index: base/shared_memory_posix.cc |
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc |
index 7283cbda42a40799148abe1cf099579b560939a4..ae814d732d6e444dace1425a6b8d2ef964909233 100644 |
--- a/base/shared_memory_posix.cc |
+++ b/base/shared_memory_posix.cc |
@@ -14,6 +14,7 @@ |
#include "base/logging.h" |
#include "base/platform_thread.h" |
#include "base/safe_strerror_posix.h" |
+#include "base/thread_restrictions.h" |
#include "base/utf_string_conversions.h" |
namespace base { |
@@ -146,6 +147,11 @@ bool SharedMemory::CreateOrOpen(const std::string& name, |
int posix_flags, uint32 size) { |
DCHECK(mapped_file_ == -1); |
+ // This function theoretically can block on the disk, but realistically |
+ // the temporary files we create will just go into the buffer cache |
+ // and be deleted before they ever make it out to disk. |
+ base::ThreadRestrictions::ScopedAllowIO allow_io; |
+ |
file_util::ScopedFILE file_closer; |
FILE *fp; |