| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/icon_manager.h" | 5 #include "chrome/browser/icon_manager.h" |
| 6 | 6 |
| 7 #include "base/nix/mime_util_xdg.h" | 7 #include "base/nix/mime_util_xdg.h" |
| 8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
| 9 | 9 |
| 10 IconGroupID IconManager::GetGroupIDFromFilepath(const FilePath& filepath) { | 10 IconGroupID IconManager::GetGroupIDFromFilepath( |
| 11 const base::FilePath& filepath) { |
| 11 // It turns out the call to base::nix::GetFileMimeType below does IO, but | 12 // It turns out the call to base::nix::GetFileMimeType below does IO, but |
| 12 // callers of GetGroupIDFromFilepath assume it does not do IO (the Windows | 13 // callers of GetGroupIDFromFilepath assume it does not do IO (the Windows |
| 13 // and Mac implementations do not). We should fix this by either not doing IO | 14 // and Mac implementations do not). We should fix this by either not doing IO |
| 14 // in this method, or reworking callers to avoid calling it on the UI thread. | 15 // in this method, or reworking callers to avoid calling it on the UI thread. |
| 15 // See crbug.com/72740. | 16 // See crbug.com/72740. |
| 16 base::ThreadRestrictions::ScopedAllowIO allow_io; | 17 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 17 | 18 |
| 18 return base::nix::GetFileMimeType(filepath); | 19 return base::nix::GetFileMimeType(filepath); |
| 19 } | 20 } |
| OLD | NEW |