From 828fe45bc127fb6402c8384b16e3114a9ce4b9a3 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 6 Aug 2015 11:47:42 -0700 Subject: [PATCH] Linux: Fix Debug build IO access warning (issue #1565) --- libcef/browser/internal_scheme_handler.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcef/browser/internal_scheme_handler.cc b/libcef/browser/internal_scheme_handler.cc index c4977e9d2..fca7a3a1f 100644 --- a/libcef/browser/internal_scheme_handler.cc +++ b/libcef/browser/internal_scheme_handler.cc @@ -11,6 +11,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/threading/thread_restrictions.h" #include "net/base/mime_util.h" #include "ui/base/resource/resource_bundle.h" @@ -27,6 +28,10 @@ base::FilePath FilePathFromASCII(const std::string& str) { } static std::string GetMimeType(const std::string& filename) { + // Requests should not block on the disk! On POSIX this goes to disk. + // http://code.google.com/p/chromium/issues/detail?id=59849 + base::ThreadRestrictions::ScopedAllowIO allow_io; + std::string mime_type; if (net::GetMimeTypeFromFile(FilePathFromASCII(filename), &mime_type)) return mime_type;