From 27a1cae52681fa04d0169d788a35345475953b61 Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Mon, 14 Feb 2011 21:39:43 +0000 Subject: Suppress IO-on-wrong-thread DCHECK during file downloads. BUG=72740 TEST=Downloading a file in linux Debug build should not die with a DCHECK failure. Review URL: http://codereview.chromium.org/6473004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74856 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/icon_manager_linux.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'chrome/browser') diff --git a/chrome/browser/icon_manager_linux.cc b/chrome/browser/icon_manager_linux.cc index c653d2f..53fd124 100644 --- a/chrome/browser/icon_manager_linux.cc +++ b/chrome/browser/icon_manager_linux.cc @@ -5,7 +5,15 @@ #include "chrome/browser/icon_manager.h" #include "base/mime_util.h" +#include "base/threading/thread_restrictions.h" IconGroupID IconManager::GetGroupIDFromFilepath(const FilePath& filepath) { + // It turns out the call to mime_util::GetFileMimeType below does IO, but + // callers of GetGroupIDFromFilepath assume it does not do IO (the Windows + // and Mac implementations do not). We should fix this by either not doing IO + // in this method, or reworking callers to avoid calling it on the UI thread. + // See crbug.com/72740. + base::ThreadRestrictions::ScopedAllowIO allow_io; + return mime_util::GetFileMimeType(filepath); } -- cgit v1.1