diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-08 22:04:28 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-08 22:04:28 +0000 |
commit | 9002db96a49fd4ac0d6734f4cca4ec55de27676b (patch) | |
tree | 7bf0905961cb83b66fe2e5f8722bb933967528f5 /base | |
parent | 925cd484e27d1efc562fed88b3303aaa06a336e2 (diff) | |
download | chromium_src-9002db96a49fd4ac0d6734f4cca4ec55de27676b.zip chromium_src-9002db96a49fd4ac0d6734f4cca4ec55de27676b.tar.gz chromium_src-9002db96a49fd4ac0d6734f4cca4ec55de27676b.tar.bz2 |
Linux: Restrict access to xdg-mime functions to the FILE thread.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6312195
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/mime_util_xdg.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/mime_util_xdg.cc b/base/mime_util_xdg.cc index 8be1d0d..5215d01 100644 --- a/base/mime_util_xdg.cc +++ b/base/mime_util_xdg.cc @@ -21,6 +21,7 @@ #include "base/string_split.h" #include "base/string_util.h" #include "base/third_party/xdg_mime/xdgmime.h" +#include "base/threading/thread_restrictions.h" namespace { @@ -155,6 +156,7 @@ class IconTheme { IconTheme::IconTheme(const std::string& name) : index_theme_loaded_(false), info_array_(NULL) { + base::ThreadRestrictions::AssertIOAllowed(); // Iterate on all icon directories to find directories of the specified // theme and load the first encountered index.theme. std::map<FilePath, int>::iterator iter; @@ -550,10 +552,12 @@ MimeUtilConstants::~MimeUtilConstants() { namespace mime_util { std::string GetFileMimeType(const FilePath& filepath) { + base::ThreadRestrictions::AssertIOAllowed(); return xdg_mime_get_mime_type_from_file_name(filepath.value().c_str()); } std::string GetDataMimeType(const std::string& data) { + base::ThreadRestrictions::AssertIOAllowed(); return xdg_mime_get_mime_type_for_data(data.data(), data.length(), NULL); } @@ -576,6 +580,7 @@ void DetectGtkTheme() { } FilePath GetMimeIcon(const std::string& mime_type, size_t size) { + base::ThreadRestrictions::AssertIOAllowed(); std::vector<std::string> icon_names; std::string icon_name; FilePath icon_file; |